public class PlatformConfiguration
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUTOSHUTDOWN
Automatically shut down the platform when no user agents are running anymore.
|
static java.lang.String |
COMPONENT
The component flag argument (for starting an additional component).
|
static java.lang.String |
COMPONENT_FACTORY
The component factory classname argument.
|
static java.lang.String |
CONFIGURATION_FILE
The configuration file argument.
|
static java.lang.String |
CONFIGURATION_NAME
The configuration to use.
|
static java.lang.String |
DATA_ADDRESSBOOK
The transport address book data key.
|
static java.lang.String |
DATA_DEFAULT_LOCAL_TIMEOUT
Constant for local default timeout name.
|
static java.lang.String |
DATA_DEFAULT_REMOTE_TIMEOUT
Constant for remote default timeout name.
|
static java.lang.String |
DATA_PARAMETERCOPY
Flag if copying parameters for local service calls is allowed.
|
static java.lang.String |
DATA_REALTIMETIMEOUT
Flag if local timeouts should be realtime (instead of clock dependent).
|
static java.lang.String |
DATA_SERVICEREGISTRY
The local service registry data key.
|
static java.lang.String |
DEBUGFUTURES
The debug futures flag argument.
|
static java.lang.String |
DEBUGSERVICES
The debug futures services argument.
|
static java.lang.String |
DEBUGSTEPS
The debug futures services argument.
|
static java.lang.String |
DEFTIMEOUT
The default timeout argument.
|
static java.lang.String |
DHT
Flag to enable or disable dht features (service discovery).
|
static java.lang.String |
DHT_PROVIDE
Flag to enable or disable dht providing features (service discovery).
|
static java.lang.String |
FALLBACK_COMPONENT_FACTORY
The default component factory to be used for platform component.
|
static java.lang.String |
FALLBACK_PLATFORM_CONFIGURATION
The default platform configuration.
|
static java.lang.String |
MONITORING
The monitoring flag argument.
|
static java.lang.String |
NOSTACKCOMPACTION
The stack compaction disable flag argument.
|
static java.lang.String |
OPENGL
The opengl disable flag argument.
|
static java.lang.String |
PERSIST
The persist flag argument.
|
static java.lang.String |
PLATFORM_COMPONENT
Tell the starter to use the default platform component implementation (usually no need to change).
|
static java.lang.String |
PLATFORM_NAME
The name of the platform component (null for auto generation).
|
protected static java.util.Map<IComponentIdentifier,java.util.Map<java.lang.String,java.lang.Object>> |
platformmem
Global platform data.
|
static java.util.Set<java.lang.String> |
RESERVED
The reserved platform parameters.
|
Constructor and Description |
---|
PlatformConfiguration()
Creates an empty configuration.
|
PlatformConfiguration(PlatformConfiguration source)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(java.lang.String path)
Add a component that is started after platform startup.
|
protected void |
checkConsistency()
Checks this configuration for consistency errors.
|
void |
enhanceWith(PlatformConfiguration other)
Enhance this config with given other config.
|
static PlatformConfiguration |
getAndroidDefault()
Returns a PlatformConfiguration with the default parameters.
|
boolean |
getAutoShutdown()
Get autoshutdown flag.
|
java.lang.String |
getComponentFactory()
Get the component factory.
|
java.util.List<java.lang.String> |
getComponents()
Get the list of components to be started at startup.
|
java.lang.String |
getConfigurationFile()
Get the main configuration file, e.g.
|
java.lang.String |
getConfigurationName()
Get the configuration name.
|
boolean |
getDebugFutures()
Get the debug futures flag.
|
boolean |
getDebugServices()
Get the debug services flag.
|
boolean |
getDebugSteps()
Get the debug steps flag.
|
static PlatformConfiguration |
getDefault()
Returns a PlatformConfiguration with the default parameters.
|
java.lang.Long |
getDefaultTimeout()
Gets the default timeout.
|
boolean |
getDht()
Get the DHT flag.
|
boolean |
getDhtProvide()
Get the provide DHT flag.
|
long |
getLocalDefaultTimeout()
Get the default timeout for local calls.
|
static long |
getLocalDefaultTimeout(IComponentIdentifier platform)
Get the local default timeout.
|
static PlatformConfiguration |
getMinimal()
Returns a minimal platform configuration without any network connectivity.
|
static PlatformConfiguration |
getMinimalRelayAwareness()
Returns a minimal platform configuration that communicates via relay.
|
IMonitoringService.PublishEventLevel |
getMonitoring()
Get the monitoring level.
|
boolean |
getNoStackCompaction()
Get the no stack compaction flag.
|
boolean |
getOpenGl()
Get the OPENGL flag.
|
boolean |
getPersist()
Get the persist flag.
|
java.lang.Class |
getPlatformComponent()
Get platform component.
|
java.lang.String |
getPlatformName()
Get the platform name.
|
static java.lang.Object |
getPlatformValue(IComponentIdentifier platform,
java.lang.String key)
Get a global platform value.
|
long |
getRemoteDefaultTimeout()
Get the default timeout for remote calls.
|
static long |
getRemoteDefaultTimeout(IComponentIdentifier platform)
Get the remote default timeout.
|
RootComponentConfiguration |
getRootConfig()
Returns the configuration of the root component.
|
static long |
getScaledLocalDefaultTimeout(IComponentIdentifier platform,
double scale)
Get the scaled local default timeout.
|
static long |
getScaledRemoteDefaultTimeout(IComponentIdentifier platform,
double scale)
Get the scaled remote default timeout.
|
java.lang.Object |
getValue(java.lang.String key)
Generic getter for configuration parameters.
|
static boolean |
hasPlatformValue(IComponentIdentifier platform,
java.lang.String key)
Get a global platform value.
|
static boolean |
isParameterCopy(IComponentIdentifier platform)
Check if the parameter copy flag is set for a platform.
|
static boolean |
isRealtimeTimeout(IComponentIdentifier platform)
Check if the real time timeout flag is set for a platform.
|
static void |
parseArg(java.lang.String okey,
java.lang.String val,
PlatformConfiguration config)
Parse an argument.
|
static PlatformConfiguration |
processArgs(java.util.Map<java.lang.String,java.lang.String> args)
Create a platform configuration.
|
static PlatformConfiguration |
processArgs(java.lang.String args)
Create a platform configuration.
|
static PlatformConfiguration |
processArgs(java.lang.String[] args)
Create a platform configuration.
|
static void |
putPlatformValue(IComponentIdentifier platform,
java.lang.String key,
java.lang.Object value)
Get a global platform value.
|
static void |
removePlatformMemory(IComponentIdentifier platform)
Get a global platform value.
|
void |
setAutoShutdown(boolean value)
Set autoshutdown flag.
|
void |
setComponents(java.util.List<java.lang.String> newcomps)
Set the list of components to be started at startup.
|
void |
setConfigurationFile(java.lang.String value)
Set the main configuration file, e.g.
|
void |
setConfigurationName(java.lang.String value)
Set the configuration name.
|
void |
setDebugFutures(boolean value)
Set the debug futures flag.
|
void |
setDebugServices(boolean value)
Set the debug services flag.
|
void |
setDebugSteps(boolean value)
Set the debug steps flag.
|
void |
setDefaultTimeout(long to)
Set the default timeout.
|
void |
setDht(boolean value)
Set the DHT flag.
|
void |
setDhtProvide(boolean value)
Set the provide DHT flag.
|
static void |
setLocalDefaultTimeout(IComponentIdentifier platform,
long timeout)
Set the local default timeout.
|
void |
setMonitoring(IMonitoringService.PublishEventLevel level)
Set the monitoring level.
|
void |
setNoStackCompaction(boolean value)
Set the no stack compaction flag.
|
void |
setOpenGl(boolean value)
Set the OPENGL flag.
|
void |
setPersist(boolean value)
Set the persist flag.
|
void |
setPlatformComponent(java.lang.Class value)
Set platform component.
|
void |
setPlatformModel(IModelInfo model)
Sets the platform model to extract configuration values from it.
|
void |
setPlatformName(java.lang.String value)
Set the platform name.
|
static void |
setRemoteDefaultTimeout(IComponentIdentifier platform,
long timeout)
Set the remote default timeout.
|
void |
setValue(java.lang.String key,
java.lang.Object value)
Generic setter for cmd args.
|
java.lang.String |
toString() |
public static final java.lang.String PLATFORM_NAME
public static final java.lang.String CONFIGURATION_NAME
public static final java.lang.String AUTOSHUTDOWN
public static final java.lang.String PLATFORM_COMPONENT
public static final java.lang.String DATA_PARAMETERCOPY
public static final java.lang.String DATA_REALTIMETIMEOUT
public static final java.lang.String DATA_SERVICEREGISTRY
public static final java.lang.String DATA_ADDRESSBOOK
public static final java.lang.String DATA_DEFAULT_LOCAL_TIMEOUT
public static final java.lang.String DATA_DEFAULT_REMOTE_TIMEOUT
protected static final java.util.Map<IComponentIdentifier,java.util.Map<java.lang.String,java.lang.Object>> platformmem
public static final java.lang.String FALLBACK_PLATFORM_CONFIGURATION
public static final java.lang.String FALLBACK_COMPONENT_FACTORY
public static final java.lang.String CONFIGURATION_FILE
public static final java.lang.String COMPONENT_FACTORY
public static final java.lang.String MONITORING
public static final java.lang.String COMPONENT
public static final java.lang.String PERSIST
public static final java.lang.String DEFTIMEOUT
public static final java.lang.String DEBUGFUTURES
public static final java.lang.String DEBUGSERVICES
public static final java.lang.String DEBUGSTEPS
public static final java.lang.String NOSTACKCOMPACTION
public static final java.lang.String OPENGL
public static final java.lang.String DHT
public static final java.lang.String DHT_PROVIDE
public static final java.util.Set<java.lang.String> RESERVED
public PlatformConfiguration()
public PlatformConfiguration(PlatformConfiguration source)
public static PlatformConfiguration getDefault()
public static PlatformConfiguration getAndroidDefault()
public static PlatformConfiguration getMinimal()
public static PlatformConfiguration getMinimalRelayAwareness()
public RootComponentConfiguration getRootConfig()
public void setPlatformModel(IModelInfo model)
model
- public void setValue(java.lang.String key, java.lang.Object value)
key
- value
- public java.lang.Object getValue(java.lang.String key)
key
- public java.lang.String getPlatformName()
public void setPlatformName(java.lang.String value)
public java.lang.String getConfigurationName()
public void setConfigurationName(java.lang.String value)
public boolean getAutoShutdown()
public void setAutoShutdown(boolean value)
public java.lang.Class getPlatformComponent()
public void setPlatformComponent(java.lang.Class value)
public void setDefaultTimeout(long to)
to
- timeout in ms.public java.lang.Long getDefaultTimeout()
public long getLocalDefaultTimeout()
public long getRemoteDefaultTimeout()
public void addComponent(java.lang.String path)
path
- Path to the component.public void setComponents(java.util.List<java.lang.String> newcomps)
newcomps
- List of components.public java.util.List<java.lang.String> getComponents()
public java.lang.String getComponentFactory()
public void setConfigurationFile(java.lang.String value)
value
- Path to configuration filepublic java.lang.String getConfigurationFile()
public void setMonitoring(IMonitoringService.PublishEventLevel level)
level
- public IMonitoringService.PublishEventLevel getMonitoring()
public void setPersist(boolean value)
value
- public boolean getPersist()
public void setDebugFutures(boolean value)
value
- public boolean getDebugFutures()
public void setDebugServices(boolean value)
value
- public boolean getDebugServices()
public void setDebugSteps(boolean value)
value
- public boolean getDebugSteps()
public void setNoStackCompaction(boolean value)
value
- public boolean getNoStackCompaction()
public void setOpenGl(boolean value)
value
- public boolean getOpenGl()
public void setDht(boolean value)
value
- public boolean getDht()
public void setDhtProvide(boolean value)
value
- public boolean getDhtProvide()
public static java.lang.Object getPlatformValue(IComponentIdentifier platform, java.lang.String key)
platform
- The platform name.key
- The key.public static void putPlatformValue(IComponentIdentifier platform, java.lang.String key, java.lang.Object value)
platform
- The platform name.key
- The key.value
- The value.public static boolean hasPlatformValue(IComponentIdentifier platform, java.lang.String key)
platform
- The platform name.key
- The key.public static void removePlatformMemory(IComponentIdentifier platform)
platform
- The platform name.public static long getRemoteDefaultTimeout(IComponentIdentifier platform)
public static long getScaledRemoteDefaultTimeout(IComponentIdentifier platform, double scale)
public static long getLocalDefaultTimeout(IComponentIdentifier platform)
public static long getScaledLocalDefaultTimeout(IComponentIdentifier platform, double scale)
public static void setRemoteDefaultTimeout(IComponentIdentifier platform, long timeout)
public static void setLocalDefaultTimeout(IComponentIdentifier platform, long timeout)
public static boolean isRealtimeTimeout(IComponentIdentifier platform)
public static boolean isParameterCopy(IComponentIdentifier platform)
public static PlatformConfiguration processArgs(java.lang.String args)
args
- The command line arguments.public static PlatformConfiguration processArgs(java.lang.String[] args)
args
- The command line arguments.public static PlatformConfiguration processArgs(java.util.Map<java.lang.String,java.lang.String> args)
args
- The command line arguments.public static void parseArg(java.lang.String okey, java.lang.String val, PlatformConfiguration config)
okey
- The key.val
- The value.config
- The config.public java.lang.String toString()
toString
in class java.lang.Object
public void enhanceWith(PlatformConfiguration other)
other
- protected void checkConsistency()