Package jadex.base
Class Starter
- java.lang.Object
- 
- jadex.base.Starter
 
- 
 public class Starter extends java.lang.ObjectStarter class for starting the Jadex platform.
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringDATA_BOOTSTRAPFACTORYThe bootstrap component factory.static java.lang.StringDATA_CMSSTATEThe CMS state.static java.lang.StringDATA_DEFAULT_TIMEOUTConstant for default timeout name.static java.lang.StringDATA_INVOKEDMETHODSThe weak set of invoked init, start or shutdown methods - to not invoke twice.static java.lang.StringDATA_NETWORKNAMESCACHEThe used to store the current network names.static java.lang.StringDATA_PARAMETERCOPYFlag if copying parameters for local service calls is allowed.static java.lang.StringDATA_PLATFORMACCESSThe bootstrap component factory.static java.lang.StringDATA_PLATFORMSETTINGSThe platform settings.static java.lang.StringDATA_REALTIMETIMEOUTFlag if local timeouts should be realtime (instead of clock dependent).static java.lang.StringDATA_SERIALIZATIONSERVICESThe serialization services for serializing and en/decoding objects including remote reference handling.static java.lang.StringDATA_SERVICEREGISTRYThe local service registry data key.static java.lang.StringDATA_TRANSPORTCACHEThe transport cache used to .protected static IRwMap<IComponentIdentifier,IRwMap<java.lang.String,java.lang.Object>>platformmemGlobal platform data.protected static java.util.Map<IComponentIdentifier,Tuple2<BlockingQueue,java.lang.Thread>>rescuethreadsThe rescue threads - per platform.
 - 
Constructor SummaryConstructors Constructor Description Starter()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static IFuture<IExternalAccess>createAgent(java.lang.String filename, IComponentFactory cfac, IExecutionService es, IClockService cs)Create an agent based on filename, agent factory and platform services.static IFuture<IExternalAccess>createPlatform()Create the platform.static IFuture<IExternalAccess>createPlatform(IPlatformConfiguration config)Create the platform.static IFuture<IExternalAccess>createPlatform(IPlatformConfiguration pconfig, java.lang.String[] args)Create the platform.static IFuture<IExternalAccess>createPlatform(IPlatformConfiguration pconfig, java.util.Map<java.lang.String,java.lang.Object> pargs)Create the platform.static IFuture<IExternalAccess>createPlatform(java.lang.String... args)Create the platform.static IFuture<IExternalAccess>createPlatform(java.util.Map<java.lang.String,java.lang.String> args)Create the platform.static IComponentIdentifiercreatePlatformIdentifier(java.lang.String pfname)Internal method to create a component identifier.static IFuture<IExternalAccess>createProxy(IExternalAccess local, IExternalAccess remote)Create a proxy for the remote platform.static Tuple2<IExecutionService,IClockService>createServices()Create the necessary platform service replacements.static booleangetBooleanValueWithArgs(java.util.Map<java.lang.String,java.lang.Object> args, java.lang.String argname, boolean def)Get a boolean value from args (otherwise return default value passed as arg).static IClockServicegetClockService(IInternalAccess ia)Get the clock service.static longgetDefaultTimeout(IComponentIdentifier platform)Get the default timeout.static IExecutionServicegetExecutionService(IInternalAccess ia)Get the execution service.static IPlatformSettingsgetPlatformSettings(IComponentIdentifier platform)static java.lang.ObjectgetPlatformValue(IComponentIdentifier platform, java.lang.String key)Get a global platform value.static longgetScaledDefaultTimeout(IComponentIdentifier platform, double scale)Get the scaled default timeout.static booleanhasPlatformValue(IComponentIdentifier platform, java.lang.String key)Get a global platform value.static voidinitRescueThread(IComponentIdentifier cid, IPlatformConfiguration rootconfig)Init the rescue thread for a platform..static booleanisNoPlatformMode(IInternalAccess agent)Test if agent runs in no platform mode.static booleanisParameterCopy(IComponentIdentifier platform)Check if the parameter copy flag is set for a platform.static booleanisRealtimeTimeout(IComponentIdentifier platform)Check if the real time timeout flag is set for a platform.static booleanisRescueThread(IComponentIdentifier cid)Test if the current thread is the rescue thread of the platform.static voidmain(java.lang.String[] args)Main for starting the platform (with meaningful fallbacks)static voidparseArg(java.lang.String okey, java.lang.String val, java.util.Map<java.lang.String,java.lang.Object> vals)static java.util.Map<java.lang.String,java.lang.Object>parseArgs(java.lang.String args)Create a platform configuration.static java.util.Map<java.lang.String,java.lang.Object>parseArgs(java.lang.String[] args)static voidputPlatformValue(IComponentIdentifier platform, java.lang.String key, java.lang.Object value)Get a global platform value.static voidremovePlatformMemory(IComponentIdentifier platform)Get a global platform value.static voidscheduleRescueStep(IComponentIdentifier cid, java.lang.Runnable run)Schedule a rescue step.static voidsetDefaultTimeout(IComponentIdentifier platform, long timeout)Set the default timeout.static voidshutdownRescueThread(IComponentIdentifier cid)Shutdown the rescue thread of a platform.protected static IFuture<java.lang.Void>startComponents(int i, java.util.List<java.lang.String> components, IInternalAccess instance)Loop for starting components.protected static java.lang.Stringunescape(java.lang.String str)Unescape a string.
 
- 
- 
- 
Field Detail- 
DATA_PARAMETERCOPYpublic static java.lang.String DATA_PARAMETERCOPY Flag if copying parameters for local service calls is allowed.
 - 
DATA_REALTIMETIMEOUTpublic static java.lang.String DATA_REALTIMETIMEOUT Flag if local timeouts should be realtime (instead of clock dependent).
 - 
DATA_SERVICEREGISTRYpublic static java.lang.String DATA_SERVICEREGISTRY The local service registry data key.
 - 
DATA_SERIALIZATIONSERVICESpublic static java.lang.String DATA_SERIALIZATIONSERVICES The serialization services for serializing and en/decoding objects including remote reference handling.
 - 
DATA_TRANSPORTCACHEpublic static java.lang.String DATA_TRANSPORTCACHE The transport cache used to .
 - 
DATA_NETWORKNAMESCACHEpublic static java.lang.String DATA_NETWORKNAMESCACHE The used to store the current network names.
 - 
DATA_CMSSTATEpublic static java.lang.String DATA_CMSSTATE The CMS state.
 - 
DATA_DEFAULT_TIMEOUTpublic static java.lang.String DATA_DEFAULT_TIMEOUT Constant for default timeout name.
 - 
DATA_PLATFORMACCESSpublic static java.lang.String DATA_PLATFORMACCESS The bootstrap component factory.
 - 
DATA_PLATFORMSETTINGSpublic static java.lang.String DATA_PLATFORMSETTINGS The platform settings.
 - 
DATA_BOOTSTRAPFACTORYpublic static java.lang.String DATA_BOOTSTRAPFACTORY The bootstrap component factory.
 - 
DATA_INVOKEDMETHODSpublic static java.lang.String DATA_INVOKEDMETHODS The weak set of invoked init, start or shutdown methods - to not invoke twice.
 - 
platformmemprotected static final IRwMap<IComponentIdentifier,IRwMap<java.lang.String,java.lang.Object>> platformmem Global platform data. For each platform stored by
 - 
rescuethreadsprotected static java.util.Map<IComponentIdentifier,Tuple2<BlockingQueue,java.lang.Thread>> rescuethreads The rescue threads - per platform.
 
- 
 - 
Method Detail- 
unescapeprotected static java.lang.String unescape(java.lang.String str) Unescape a string.
 - 
mainpublic static void main(java.lang.String[] args) Main for starting the platform (with meaningful fallbacks)- Parameters:
- args- The arguments.
- Throws:
- java.lang.Exception
 
 - 
createPlatformpublic static IFuture<IExternalAccess> createPlatform(java.util.Map<java.lang.String,java.lang.String> args) Create the platform.- Parameters:
- args- The command line arguments.
- Returns:
- The external access of the root component.
 
 - 
createPlatformpublic static IFuture<IExternalAccess> createPlatform(java.lang.String... args) Create the platform.- Parameters:
- args- The command line arguments.
- Returns:
- The external access of the root component.
 
 - 
createPlatformpublic static IFuture<IExternalAccess> createPlatform(IPlatformConfiguration config) Create the platform.- Returns:
- The external access of the root component.
 
 - 
createPlatformpublic static IFuture<IExternalAccess> createPlatform() Create the platform.- Returns:
- The external access of the root component.
 
 - 
createPlatformpublic static IFuture<IExternalAccess> createPlatform(IPlatformConfiguration pconfig, java.lang.String[] args) Create the platform.- Parameters:
- config- The PlatformConfiguration object.
- Returns:
- The external access of the root component.
 
 - 
getBooleanValueWithArgspublic static boolean getBooleanValueWithArgs(java.util.Map<java.lang.String,java.lang.Object> args, java.lang.String argname, boolean def)Get a boolean value from args (otherwise return default value passed as arg).- Parameters:
- args- The args map.
- argname- The argument name.
- def- The default value.
- Returns:
- The args value.
 
 - 
createPlatformpublic static IFuture<IExternalAccess> createPlatform(IPlatformConfiguration pconfig, java.util.Map<java.lang.String,java.lang.Object> pargs) Create the platform.- Parameters:
- config- The PlatformConfiguration object.
- Returns:
- The external access of the root component.
 
 - 
createPlatformIdentifierpublic static IComponentIdentifier createPlatformIdentifier(java.lang.String pfname) Internal method to create a component identifier.- Parameters:
- pfname- The platform name.
 
 - 
startComponentsprotected static IFuture<java.lang.Void> startComponents(int i, java.util.List<java.lang.String> components, IInternalAccess instance) Loop for starting components.- Parameters:
- i- Number to start.
- components- The list of components.
- instance- The instance.
- Returns:
- True, when done.
 
 - 
initRescueThreadpublic static void initRescueThread(IComponentIdentifier cid, IPlatformConfiguration rootconfig) Init the rescue thread for a platform..
 - 
scheduleRescueSteppublic static void scheduleRescueStep(IComponentIdentifier cid, java.lang.Runnable run) Schedule a rescue step.- Parameters:
- cid- The id of a component of the platform.
- run- The runnable to execute.
 
 - 
isRescueThreadpublic static boolean isRescueThread(IComponentIdentifier cid) Test if the current thread is the rescue thread of the platform.- Parameters:
- cid- The id of a component of the platform.
- Returns:
- True, if is the rescue thread.
 
 - 
shutdownRescueThreadpublic static void shutdownRescueThread(IComponentIdentifier cid) Shutdown the rescue thread of a platform.
 - 
createProxypublic static IFuture<IExternalAccess> createProxy(IExternalAccess local, IExternalAccess remote) Create a proxy for the remote platform.
 - 
getPlatformValuepublic static java.lang.Object getPlatformValue(IComponentIdentifier platform, java.lang.String key) Get a global platform value.- Parameters:
- platform- The platform name.
- key- The key.
- Returns:
- The value.
 
 - 
putPlatformValuepublic static void putPlatformValue(IComponentIdentifier platform, java.lang.String key, java.lang.Object value) Get a global platform value.- Parameters:
- platform- The platform name.
- key- The key.
- value- The value.
 
 - 
hasPlatformValuepublic static boolean hasPlatformValue(IComponentIdentifier platform, java.lang.String key) Get a global platform value.- Parameters:
- platform- The platform name.
- key- The key.
- Returns:
- The value.
 
 - 
removePlatformMemorypublic static void removePlatformMemory(IComponentIdentifier platform) Get a global platform value.- Parameters:
- platform- The platform name.
 
 - 
getPlatformSettingspublic static final IPlatformSettings getPlatformSettings(IComponentIdentifier platform) 
 - 
getDefaultTimeoutpublic static long getDefaultTimeout(IComponentIdentifier platform) Get the default timeout.
 - 
getScaledDefaultTimeoutpublic static long getScaledDefaultTimeout(IComponentIdentifier platform, double scale) Get the scaled default timeout.
 - 
setDefaultTimeoutpublic static void setDefaultTimeout(IComponentIdentifier platform, long timeout) Set the default timeout.
 - 
isRealtimeTimeoutpublic static boolean isRealtimeTimeout(IComponentIdentifier platform) Check if the real time timeout flag is set for a platform.
 - 
isParameterCopypublic static boolean isParameterCopy(IComponentIdentifier platform) Check if the parameter copy flag is set for a platform.
 - 
parseArgspublic static java.util.Map<java.lang.String,java.lang.Object> parseArgs(java.lang.String args) Create a platform configuration.- Parameters:
- args- The command line arguments.
- Returns:
- StarterConfiguration
 
 - 
parseArgspublic static java.util.Map<java.lang.String,java.lang.Object> parseArgs(java.lang.String[] args) - Parameters:
- args-
- config-
 
 - 
parseArgpublic static void parseArg(java.lang.String okey, java.lang.String val, java.util.Map<java.lang.String,java.lang.Object> vals)- Parameters:
- okey-
- val-
- config-
 
 - 
createAgentpublic static IFuture<IExternalAccess> createAgent(java.lang.String filename, IComponentFactory cfac, IExecutionService es, IClockService cs) Create an agent based on filename, agent factory and platform services.- Parameters:
- filename- The model filename.
- es- The execution service.
- cs- The clock service.
- Returns:
- External access of the created agent.
 
 - 
isNoPlatformModepublic static boolean isNoPlatformMode(IInternalAccess agent) Test if agent runs in no platform mode.- Parameters:
- agent- The agent.
- Returns:
- True, if runs in no platform mode.
 
 - 
getClockServicepublic static IClockService getClockService(IInternalAccess ia) Get the clock service.- Returns:
- The clock service.
 
 - 
getExecutionServicepublic static IExecutionService getExecutionService(IInternalAccess ia) Get the execution service.- Returns:
- The execution service.
 
 - 
createServicespublic static Tuple2<IExecutionService,IClockService> createServices() Create the necessary platform service replacements.- Returns:
- The services (execution and clock).
 
 
- 
 
-