|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjp.go.aist.rtm.RTC.Manager
public class Manager
This is a manager class that manages various information such as components.
Nested Class Summary | |
---|---|
(package private) class |
Manager.cleanupComponentsClass
Listener Class for deletion of RT component |
(package private) class |
Manager.ECFactoryPredicate
Helper class to find ECFactory |
protected class |
Manager.FactoryPredicate
Helper class to find Factory |
protected class |
Manager.Finalized
Class |
protected class |
Manager.InstanceName
Helper class to find Object |
protected class |
Manager.OrbRunner
ORB exrcution helper class |
(package private) class |
Manager.shutdownOnNoRtcsClass
Listener Class for deletion of Manager |
protected class |
Manager.Terminator
ORB termination helper class. |
Field Summary | |
---|---|
(package private) Manager.cleanupComponentsClass |
m_cleanupComponents
Listener for timer processing |
protected ObjectManager<java.lang.String,RTObject_impl> |
m_compManager
Component Manager |
protected Properties |
m_config
Managaer's configuration Properties |
protected ObjectManager<java.lang.String,java.lang.Object> |
m_ecfactory
ExecutionContext Factory |
protected java.util.Vector<ExecutionContextBase> |
m_ecs
ExecutionContext |
protected ObjectManager<java.lang.String,FactoryBase> |
m_factory
Component Factory Manager |
(package private) Manager.Finalized |
m_finalized
List for component deletion |
protected ModuleInitProc |
m_initProc
User component initialization procedure object |
(package private) ManagerServant |
m_mgrservant
The object to the ManagerServant |
protected ModuleManager |
m_module
Module Manager |
protected NamingManager |
m_namingManager
Naming Manager |
protected CorbaObjectManager |
m_objManager
CORBA Object Manager |
protected org.omg.CORBA.ORB |
m_pORB
ORB |
protected org.omg.PortableServer.POA |
m_pPOA
POA |
protected org.omg.PortableServer.POAManager |
m_pPOAManager
POAManager |
protected Manager.OrbRunner |
m_runner
ORB Runner |
(package private) Manager.shutdownOnNoRtcsClass |
m_shutdownOnNoRtcs
Listener for timer processing |
protected int |
m_terminate_waiting
Counter for Terminator |
protected Manager.Terminator |
m_terminator
Terminator |
protected Timer |
m_timer
Timer Object |
protected static Manager |
manager
This field is the only Manager instance. |
protected static java.lang.String |
manager_mutex
This field is a mutex variable for Manager. |
protected Logbuf |
rtcout
Logger stream |
Constructor Summary | |
---|---|
protected |
Manager()
Constructor |
|
Manager(Manager rhs)
Copy Constructor |
Method Summary | |
---|---|
boolean |
activateManager()
Activate the Manager |
protected boolean |
bindManagerServant()
Binds ManagerServant. |
void |
cleanupComponent(RTObject_impl comp)
Unregister RT-Components |
void |
clearModules()
Clears the RT component manager. |
void |
clearModulesFactories()
Clears the factory for RT component. |
protected void |
configureComponent(RTObject_impl comp,
Properties prop)
Configure RT-Component |
RTObject_impl |
createComponent(java.lang.String comp_args)
Create RT-Components |
ExecutionContextBase |
createContext(java.lang.String ec_args)
Create Context |
protected void |
createORBEndpointOption(java.lang.String opt,
java.util.Vector<java.lang.String> endpoints)
Create a command optional line of Endpoint of ORB. |
protected void |
createORBEndpoints(java.util.Vector<java.lang.String> endpoints)
Create Endpoints |
protected java.lang.String |
createORBOptions()
Create ORB command options |
protected java.util.Properties |
createORBProperties()
Creates ORB Properties. |
void |
deleteComponent(RTObject_impl comp)
Unregister RT-Components that have been registered to Manager |
void |
deleteComponent(java.lang.String instanceName)
Unregister RT-Components that have been registered to Manager |
protected java.lang.String |
formatString(java.lang.String namingFormat,
Properties properties)
Construct registration information when registering to Naming server |
RTObject_impl |
getComponent(java.lang.String instanceName)
Get RT-Component's pointer |
java.util.Vector<RTObject_impl> |
getComponents()
Get all RT-Components registered in the Manager |
Properties |
getConfig()
Get the manager configuration |
java.util.Vector<Properties> |
getFactoryProfiles()
Get profiles of factories. |
java.util.Vector<Properties> |
getLoadableModules()
Get a list of loadable modules |
java.util.Vector<Properties> |
getLoadedModules()
Get a list of loaded modules |
java.util.Vector<java.lang.String> |
getModulesFactories()
Get the list of all Factories |
org.omg.CORBA.ORB |
getORB()
Get the pointer to ORB |
org.omg.PortableServer.POA |
getPOA()
Get a pointer to RootPOA held by Manager |
org.omg.PortableServer.POAManager |
getPOAManager()
Get POAManager that Manager has |
static Manager |
init(java.lang.String[] argv)
Initialize manager |
protected boolean |
initComposite()
PeriodicECSharedComposite initialization |
protected boolean |
initExecContext()
ExecutionContextManager initialization |
protected boolean |
initFactories()
Factories initialization |
protected boolean |
initLogger()
System logger initialization |
protected void |
initManager(java.lang.String[] argv)
Manager internal initialization |
protected boolean |
initManagerServant()
ManagerServant initialization |
protected boolean |
initNaming()
NamingManager initialization |
protected boolean |
initORB()
CORBA ORB initialization |
protected boolean |
initTimer()
Timer initialization |
static Manager |
instance()
Get instance of the manager |
void |
join()
Wait for Manager's termination |
java.lang.String |
load(java.lang.String moduleFileName,
java.lang.String initFunc)
[CORBA interface] Load module |
protected boolean |
mergeProperty(Properties properties,
java.lang.String fileName)
Merge property information |
void |
notifyFinalized(RTObject_impl comp)
This method deletes RT-Components. |
boolean |
procComponentArgs(java.lang.String comp_arg,
Properties comp_id,
Properties comp_conf)
Extracting component type/properties from the given string |
boolean |
procContextArgs(java.lang.String ec_args,
java.lang.StringBuffer ec_id,
Properties ec_conf)
Extracting ExecutionContext's name/properties from the given string |
boolean |
registerComponent(RTObject_impl comp)
Register RT-Component directly without Factory |
boolean |
registerECFactory(java.lang.String name)
Register ExecutionContext Factory Register Factory to create ExecutionContext's instances. |
boolean |
registerFactory(Properties profile,
RtcNewFunc new_func,
RtcDeleteFunc delete_func)
Register RT-Component Factory |
void |
runManager()
Run the Manager |
void |
runManager(boolean noBlocking)
Run the Manager |
void |
setModuleInitProc(ModuleInitProc initProc)
Set initial procedure |
void |
shutdown()
Shutdown Manager |
protected void |
shutdownComponents()
NamingManager finalization |
protected void |
shutdownLogger()
System Logger finalization |
protected void |
shutdownManager()
Shutdown Manager |
protected void |
shutdownNaming()
NamingManager finalization |
protected void |
shutdownORB()
ORB finalization |
void |
terminate()
Terminate manager |
void |
unload(java.lang.String moduleFileName)
Unload module |
void |
unloadAll()
Unload all modules |
boolean |
unregisterComponent(RTObject_impl comp)
Unregister RT-Components |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
Manager.cleanupComponentsClass m_cleanupComponents
Manager.shutdownOnNoRtcsClass m_shutdownOnNoRtcs
ManagerServant m_mgrservant
protected static Manager manager
protected static java.lang.String manager_mutex
protected org.omg.CORBA.ORB m_pORB
protected org.omg.PortableServer.POA m_pPOA
protected org.omg.PortableServer.POAManager m_pPOAManager
protected ModuleInitProc m_initProc
protected Properties m_config
protected ModuleManager m_module
protected NamingManager m_namingManager
protected CorbaObjectManager m_objManager
protected Timer m_timer
protected Logbuf rtcout
protected ObjectManager<java.lang.String,RTObject_impl> m_compManager
protected ObjectManager<java.lang.String,FactoryBase> m_factory
protected ObjectManager<java.lang.String,java.lang.Object> m_ecfactory
protected java.util.Vector<ExecutionContextBase> m_ecs
protected Manager.OrbRunner m_runner
protected Manager.Terminator m_terminator
protected int m_terminate_waiting
Manager.Finalized m_finalized
Constructor Detail |
---|
protected Manager()
Protected Constructor
public Manager(Manager rhs)
Protected Copy Constructor
rhs
-
Manager object of copy sourceMethod Detail |
---|
public static Manager init(java.lang.String[] argv)
This is the static member function to initialize the Manager. The Manager is initialized by given commandline arguments. To use the manager, this initialization member function init() must be called. The manager has two static functions to get the instance such as init() and instance(). Since initializing process is only performed by the init() function, the init() has to be called at the beginning of the lifecycle of the Manager. *Initialization of manager
argv
-
The array of the command line arguments.
public static Manager instance()
This is the static member function to get the instance of the Manager. Before calling this function, ensure that the initialization function "init()" is called.
public void terminate()
Terminate manager's processing
public void shutdown()
Terminate manager's processing. After terminating ORB, shutdown manager in sync.
public void join()
Wait for Manager's termination to synchronize.
public Properties getConfig()
Get the manager configuration that has been set to manager.
public void setModuleInitProc(ModuleInitProc initProc)
This operation sets the initial procedure call to process module initialization, other user defined initialization and so on. The given procedure will be called at the proper timing after the manager initialization, activation and run.
initProc
-
Callback interfacepublic boolean activateManager()
This operation do the following:
public void runManager()
This operation processes the main event loop of the Manager. In this main loop, CORBA's ORB event loop or other processes are performed. This operation is going to blocking mode and never returns until Manager::destroy() is called.
public void runManager(boolean noBlocking)
This operation processes the main event loop of the Manager. In this main loop, CORBA's ORB event loop or other processes are performed. As the default behavior, this operation is going to blocking mode and never returns until Manager::destroy() is called. When the given argument "no_block" is set to "true", this operation creates a thread to process the event loop internally, and it doesn't block and returns.
noBlocking
-
false: Blocking mode, true: non-blocking mode.public java.lang.String load(java.lang.String moduleFileName, java.lang.String initFunc)
Load specified module (shared library, DLL etc..), and invoke initialize function.
moduleFileName
-
The module file nameinitFunc
-
The initialize function namepublic void unload(java.lang.String moduleFileName) throws java.lang.Exception
Unload module.
moduleFileName
-
The module file name
java.lang.Exception
public void unloadAll()
Unload all modules.
public java.util.Vector<Properties> getLoadedModules()
Get module list that is currently loaded into manager.
public java.util.Vector<Properties> getLoadableModules()
Get loadable module list. (Currently, unimplemented on ModuleManager side)
public boolean registerFactory(Properties profile, RtcNewFunc new_func, RtcDeleteFunc delete_func)
Register Factory to create RT-Component's instances.
profile
-
RT-Component profilenew_func
-
RT-Component creation functiondelete_func
-
RT-Component destruction function
public java.util.Vector<Properties> getFactoryProfiles()
Get profiles of factories.
public boolean registerECFactory(java.lang.String name)
name
-
ExecutionContext name
public java.util.Vector<java.lang.String> getModulesFactories()
Get the list of all factories that have been registered.
public void clearModulesFactories()
public void clearModules()
public RTObject_impl createComponent(java.lang.String comp_args)
Create specified RT-Component's instances via registered Factory. When its instances have been created successfully, the following processings are also executed.
comp_args
-
Target RT-Component names for the creation.public void cleanupComponent(RTObject_impl comp)
Unregister specified RT-Component's instances from naming service.
comp
-
Target RT-Components for the unregistrationpublic void notifyFinalized(RTObject_impl comp)
The deleted RT-Component is registered. The registered RT-Components are deleted by cleanupComponents().
comp
-
Deleted RT componentpublic boolean procComponentArgs(java.lang.String comp_arg, Properties comp_id, Properties comp_conf)
This operation extracts component type name and its properties from the figen character string. The given string formats is the following. [RTC type]?[key(0)]=[val(0)]&[key(1)]=[val(1)]...[key(n)]=[val(n)] Returned value "comp_id" has keys of "vendor", "category", "implementation_id", "version", and returned as Properties type object. "comp_conf" is returned as Properties type object includeing component properties to be given to component.
comp_arg
-
character string to be processedcomp_id
-
extracted component type namecomp_conf
-
extracted component's properties
public boolean registerComponent(RTObject_impl comp)
Register specified RT-Component's instances not via Factory to Manager directly.
comp
-
Target RT-Component's instances for the registration
public boolean unregisterComponent(RTObject_impl comp)
Unregister specified RT-Components
comp
-
Target RT-Component's instances for the unregistration
public ExecutionContextBase createContext(java.lang.String ec_args)
ec_args
-
Arguments
public boolean procContextArgs(java.lang.String ec_args, java.lang.StringBuffer ec_id, Properties ec_conf)
This operation extracts ExecutionContext's name and its properties from the figen character string. The given string formats is the following. [ExecutionContext's name]?[key(0)] =[val(0)]&[key(1)]=[val(1)]...[key(n)]=[val(n)] "ec_conf" is returned as Properties type object includeing component properties to be given to component.
ec_args
-
character string to be processedec_id
-
extracted ExecutionContext's nameec_conf
-
extracted ExecutionContext's properties
public void deleteComponent(RTObject_impl comp)
Unregister RT-Components that have been registered to manager Remove specified RT-Component from naming service, terminate itself and release its instances.
comp
-
Target RT-Component's instances for the unregistrationpublic void deleteComponent(java.lang.String instanceName)
Unregister RT-Components that have been registered to manager Remove specified RT-Component from naming service, terminate itself and release its instances.
instanceName
-
Target RT-Component's instances for the unregistrationpublic RTObject_impl getComponent(java.lang.String instanceName)
Search RT-Component that has been registered to Manager by its specified name, and get it that matches.
instanceName
-
Target RT-Component's name for searching
public java.util.Vector<RTObject_impl> getComponents()
Get all RT-Component's instances that have been registered to Manager.
public org.omg.CORBA.ORB getORB()
Get the pointer to ORB that has been set to Manager.
public org.omg.PortableServer.POA getPOA()
Get the pointer to RootPOA that has been set to Manager.
public org.omg.PortableServer.POAManager getPOAManager()
Get POAMAnager that has been set to Manager.
protected void initManager(java.lang.String[] argv) throws java.lang.Exception
Execute Manager's internal initialization processing.
argv
-
Commandline arguments
java.lang.Exception
protected void shutdownManager()
Shutdown Manager
protected boolean initLogger()
Initialize System logger. Initialize logger and set it according to the set information in configuration file,
protected void shutdownLogger()
protected boolean initORB()
Initialize ORB based on the configuration given by arguments.
protected java.lang.String createORBOptions()
Create ORB launch options from configuration information that has been set.
protected void createORBEndpoints(java.util.Vector<java.lang.String> endpoints)
Create Endpoints from the configuration.
endpoints
-
endpoints Endpoints listprotected void createORBEndpointOption(java.lang.String opt, java.util.Vector<java.lang.String> endpoints)
opt
-
ORB optionsendpoints
-
Endpoints listprotected java.util.Properties createORBProperties()
protected void shutdownORB()
Finalize ORB . When the waiting process exists, wait until it completes. In actual finalization, deactivate POA Manager and then shutdown of ORB.
protected boolean initNaming()
Initialize NamingManager . However, operate nothing, if it is set to property that NamingManager is not used. Register default NamingServer that is set to property information, when NamingManager is used. Also, launch a timer that updates information automatically at specified cycle and register the method for the update to the timer, when it is set to update it reguraly.
protected void shutdownNaming()
Finalize NamingManager. Unbind all registered elements and shutdown them.
protected void shutdownComponents()
Get a list of RT-Components that have been registered to NamingManager, and shutdown all components.
protected void configureComponent(RTObject_impl comp, Properties prop)
Read property files described each RT-Component's type and instance, * and configure it to the component. Also, get each component's registered name when registering to NamingService and configure it.
comp
-
Target RT-Component for the configurationprotected boolean initExecContext()
Initialize each ExecutionContext that is used, and register each ExecutionContext creation Factory to ExecutionContextManager.
protected boolean initComposite()
protected boolean initFactories()
Initialize buffer factories, thread factories, publisher factories, provider factories, and consumer factories.
protected boolean initTimer()
Initialize each Timer that is used. (In current implementation, nothing is done.)
protected boolean initManagerServant()
protected boolean bindManagerServant()
protected boolean mergeProperty(Properties properties, java.lang.String fileName)
Load property information that is configured in the specified file, and merge existing properties that has been configured.
properties
-
Target properties for the mergefileName
-
File name that property information is described
protected java.lang.String formatString(java.lang.String namingFormat, Properties properties)
Construct information when registering to NameServer based on specified format and property information. Each format specification character means as follows:
namingFormat
-
Format specification for NamingService registrationproperties
-
Property information that is used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |