jp.go.aist.rtm.RTC
クラス Manager

java.lang.Object
  上位を拡張 jp.go.aist.rtm.RTC.Manager

public class Manager
extends java.lang.Object

This is a manager class that manages various information such as components.


入れ子のクラスの概要
(package private)  class Manager.cleanupComponentsClass
           
(package private)  class Manager.ECFactoryPredicate
          ECFactory検索用ヘルパークラスです。
protected  class Manager.FactoryPredicate
          Factory検索用ヘルパークラスです。
protected  class Manager.Finalized
           
protected  class Manager.InstanceName
          Object検索用ヘルパークラスです。
protected  class Manager.OrbRunner
          ORB実行用ヘルパークラスです。
(package private)  class Manager.shutdownOnNoRtcsClass
           
protected  class Manager.Terminator
          終了処理用ヘルパークラスです。
 
フィールドの概要
(package private)  Manager.cleanupComponentsClass m_cleanupComponents
           
protected  ObjectManager<java.lang.String,RTObject_impl> m_compManager
          Component Manager
protected  Properties m_config
          Managerコンフィギュレーション
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
           
protected  ModuleInitProc m_initProc
          ユーザコンポーネント初期化プロシジャオブジェクト
(package private)  ManagerServant m_mgrservant
          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
           
protected  int m_terminate_waiting
          Terminator用カウンタ
protected  Manager.Terminator m_terminator
          Terminator
protected  Timer m_timer
          Timer
protected static Manager manager
          唯一のManagerインスタンスです。
protected static java.lang.String manager_mutex
          Manager用ミューテックス変数です。
protected  Logbuf rtcout
          ロガーストリーム
 
コンストラクタの概要
protected Manager()
          コンストラクタです。
  Manager(Manager rhs)
          コピーコンストラクタです。
 
メソッドの概要
 boolean activateManager()
           Activate the Manager
protected  boolean bindManagerServant()
           bindManagerServant
 void cleanupComponent(RTObject_impl comp)
          指定したRTコンポーネントを登録解除します。
 void clearModules()
          RTコンポーネントマネージャをクリアする。
 void clearModulesFactories()
          RTコンポーネントファクトリをクリアする。
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)
           createContext
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)
          指定されたPropertiesオブジェクトの内容を、指定された書式に従って文字列として出力します。
 RTObject_impl getComponent(java.lang.String instanceName)
          Managerに登録されているRTコンポーネントを取得します。
 java.util.Vector<RTObject_impl> getComponents()
          Managerに登録されている全てのRTコンポーネントを取得します。
 Properties getConfig()
          マネージャのコンフィギュレーションを取得します。
 java.util.Vector<Properties> getFactoryProfiles()
           getFactoryProfiles
 java.util.Vector<Properties> getLoadableModules()
          ロード可能なモジュール名リストを取得します。
 java.util.Vector<Properties> getLoadedModules()
          ロード済みのモジュール名リストを取得します。
 java.util.Vector<java.lang.String> getModulesFactories()
          すべてのRTコンポーネントファクトリのリストを取得します。
 org.omg.CORBA.ORB getORB()
          ORBを取得します。
 org.omg.PortableServer.POA getPOA()
          RootPOAを取得します。
 org.omg.PortableServer.POAManager getPOAManager()
          POAマネージャを取得します。
static Manager init(java.lang.String[] argv)
          初期化を行います。Managerを使用する場合には、必ず本メソッドを呼ぶ必要があります。
コマンドライン引数を与えて初期化を行います。Managerオブジェクトを取得する方法としては、 init(), instance()の2メソッドがありますが、初期化はinit()でのみ行われるため、 Managerオブジェクトの生存期間の最初にinit()メソッドを呼び出す必要があります。
protected  boolean initComposite()
           intiComposite
protected  boolean initExecContext()
          ExecutionContextを初期化します。
protected  boolean initFactories()
           intiFactories
protected  boolean initLogger()
          System loggerを初期化します。
protected  void initManager(java.lang.String[] argv)
           Manager internal initialization
protected  boolean initManagerServant()
           ManagerServant initialization
protected  boolean initNaming()
          NamingManagerを初期化します。
protected  boolean initORB()
           CORBA ORB initialization
protected  boolean initTimer()
          Timerを初期化します。
static Manager instance()
          Managerオブジェクトを取得します。
 void join()
          Manager終了処理の待ち合わせを行います。
 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)
          プロパティファイルを読み込んで、指定されたPropertiesオブジェクトに設定します。
 void notifyFinalized(RTObject_impl comp)
           This method deletes RT-Components.
 boolean procComponentArgs(java.lang.String comp_arg, Properties comp_id, Properties comp_conf)
           procComponentArgs
 boolean procContextArgs(java.lang.String ec_args, java.lang.StringBuffer ec_id, Properties ec_conf)
           procContextArgs
 boolean registerComponent(RTObject_impl comp)
          RTコンポーネントを、直接にManagerに登録します。
 boolean registerECFactory(java.lang.String name)
          ExecutionContextファクトリを登録します。
 boolean registerFactory(Properties profile, RtcNewFunc new_func, RtcDeleteFunc delete_func)
          RTコンポーネントファクトリを登録します。
 void runManager()
          Managerのメインループを実行します。本メソッドは、runManager(false)の呼び出しと同等です。
 void runManager(boolean noBlocking)
          Managerのメインループを実行します。 このメインループ内では、CORBA ORBのイベントループなどが処理されます。
ブロッキングモードで起動された場合は、Manager#destroy()メソッドが呼び出されるまで、 本runManager()メソッドは処理を戻しません。
非ブロッキングモードで起動された場合は、内部でイベントループを別スレッドで開始後、 ブロックせずに処理を戻します。
 void setModuleInitProc(ModuleInitProc initProc)
          初期化プロシジャコールバックインタフェースを設定します。 マネージャが初期化されてアクティブ化された後に、 設定されたコールバックインタフェースが呼び出されます。
 void shutdown()
          Managerオブジェクトを終了します。 ORBの終了後,同期を取って終了します。
protected  void shutdownComponents()
          ネーミングサービスに登録されているコンポーネントの終了処理を行います。
protected  void shutdownLogger()
          System Loggerの終了処理を行います。
protected  void shutdownManager()
           @brief Shutdown Manager
protected  void shutdownNaming()
          NamingManagerの終了処理を行います。
protected  void shutdownORB()
          ORBの終了処理を行います。
 void terminate()
          Managerの終了処理を行います。
 void unload(java.lang.String moduleFileName)
          モジュールをアンロードします。
 void unloadAll()
          すべてのモジュールをアンロードします。
 boolean unregisterComponent(RTObject_impl comp)
          指定したRTコンポーネントを登録解除します。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

m_cleanupComponents

Manager.cleanupComponentsClass m_cleanupComponents

m_shutdownOnNoRtcs

Manager.shutdownOnNoRtcsClass m_shutdownOnNoRtcs

m_mgrservant

ManagerServant m_mgrservant
ManagerServant


manager

protected static Manager manager

唯一のManagerインスタンスです。


manager_mutex

protected static java.lang.String manager_mutex

Manager用ミューテックス変数です。


m_pORB

protected org.omg.CORBA.ORB m_pORB

ORB


m_pPOA

protected org.omg.PortableServer.POA m_pPOA

POA


m_pPOAManager

protected org.omg.PortableServer.POAManager m_pPOAManager

POAManager


m_initProc

protected ModuleInitProc m_initProc

ユーザコンポーネント初期化プロシジャオブジェクト


m_config

protected Properties m_config

Managerコンフィギュレーション


m_module

protected ModuleManager m_module

Module Manager


m_namingManager

protected NamingManager m_namingManager

Naming Manager


m_objManager

protected CorbaObjectManager m_objManager

CORBA Object Manager


m_timer

protected Timer m_timer

Timer


rtcout

protected Logbuf rtcout

ロガーストリーム


m_compManager

protected ObjectManager<java.lang.String,RTObject_impl> m_compManager

Component Manager


m_factory

protected ObjectManager<java.lang.String,FactoryBase> m_factory

Component Factory Manager


m_ecfactory

protected ObjectManager<java.lang.String,java.lang.Object> m_ecfactory

ExecutionContext Factory


m_ecs

protected java.util.Vector<ExecutionContextBase> m_ecs

ExecutionContext


m_runner

protected Manager.OrbRunner m_runner

ORB Runner


m_terminator

protected Manager.Terminator m_terminator

Terminator


m_terminate_waiting

protected int m_terminate_waiting

Terminator用カウンタ


m_finalized

Manager.Finalized m_finalized
コンストラクタの詳細

Manager

protected Manager()

コンストラクタです。

Protected コンストラクタ


Manager

public Manager(Manager rhs)

コピーコンストラクタです。

パラメータ:
rhs - コピー元のManagerオブジェクト
メソッドの詳細

init

public static Manager init(java.lang.String[] argv)

初期化を行います。Managerを使用する場合には、必ず本メソッドを呼ぶ必要があります。
コマンドライン引数を与えて初期化を行います。Managerオブジェクトを取得する方法としては、 init(), instance()の2メソッドがありますが、初期化はinit()でのみ行われるため、 Managerオブジェクトの生存期間の最初にinit()メソッドを呼び出す必要があります。

パラメータ:
argv - コマンドライン引数の配列

instance

public static Manager instance()

Managerオブジェクトを取得します。

戻り値:
Managerオブジェクト

terminate

public void terminate()

Managerの終了処理を行います。


shutdown

public void shutdown()

Managerオブジェクトを終了します。 ORBの終了後,同期を取って終了します。


join

public void join()

Manager終了処理の待ち合わせを行います。


getConfig

public Properties getConfig()

マネージャのコンフィギュレーションを取得します。

戻り値:
マネージャコンフィギュレーション

setModuleInitProc

public void setModuleInitProc(ModuleInitProc initProc)

初期化プロシジャコールバックインタフェースを設定します。 マネージャが初期化されてアクティブ化された後に、 設定されたコールバックインタフェースが呼び出されます。

パラメータ:
initProc - コールバックインタフェース

activateManager

public boolean activateManager()
Activate the Manager

This operation do the following: - Activate CORBA POAManager - Activate Manager CORBA object - Bind object reference of the Manager to the nameserver This operation should be invoked after Manager:init(), and before runManager().

戻り値:
Activation result (Successful:true, Failed:false)

runManager

public void runManager()

Managerのメインループを実行します。本メソッドは、runManager(false)の呼び出しと同等です。


runManager

public void runManager(boolean noBlocking)

Managerのメインループを実行します。 このメインループ内では、CORBA ORBのイベントループなどが処理されます。
ブロッキングモードで起動された場合は、Manager#destroy()メソッドが呼び出されるまで、 本runManager()メソッドは処理を戻しません。
非ブロッキングモードで起動された場合は、内部でイベントループを別スレッドで開始後、 ブロックせずに処理を戻します。

パラメータ:
noBlocking - 非ブロッキングモードの場合はtrue、ブロッキングモードの場合はfalse

load

public java.lang.String load(java.lang.String moduleFileName,
                             java.lang.String initFunc)
[CORBA interface] Load module

Load specified module (shared library, DLL etc..), and invoke initialize function.

パラメータ:
moduleFileName - The module file name
initFunc - The initialize function name

unload

public void unload(java.lang.String moduleFileName)
            throws java.lang.Exception

モジュールをアンロードします。

パラメータ:
moduleFileName - モジュールファイル名
例外:
java.lang.Exception

unloadAll

public void unloadAll()

すべてのモジュールをアンロードします。


getLoadedModules

public java.util.Vector<Properties> getLoadedModules()

ロード済みのモジュール名リストを取得します。

戻り値:
ロード済みモジュール名リスト

getLoadableModules

public java.util.Vector<Properties> getLoadableModules()

ロード可能なモジュール名リストを取得します。

戻り値:
ロード可能モジュール名リスト

registerFactory

public boolean registerFactory(Properties profile,
                               RtcNewFunc new_func,
                               RtcDeleteFunc delete_func)

RTコンポーネントファクトリを登録します。

パラメータ:
profile - コンポーネントプロファイル
new_func - コンポーネント生成オブジェクト
delete_func - コンポーネント削除オブジェクト
戻り値:
登録に成功した場合はtrueを、さもなくばfalseを返します。

getFactoryProfiles

public java.util.Vector<Properties> getFactoryProfiles()

getFactoryProfiles


registerECFactory

public boolean registerECFactory(java.lang.String name)

ExecutionContextファクトリを登録します。

パラメータ:
name - ExecutionContext名称
戻り値:
登録に成功した場合はtrueを、さもなくばfalseを返します。

getModulesFactories

public java.util.Vector<java.lang.String> getModulesFactories()

すべてのRTコンポーネントファクトリのリストを取得します。

戻り値:
すべてのRTコンポーネントファクトリのリスト

clearModulesFactories

public void clearModulesFactories()

RTコンポーネントファクトリをクリアする。


clearModules

public void clearModules()

RTコンポーネントマネージャをクリアする。


createComponent

public RTObject_impl createComponent(java.lang.String comp_args)
Create RT-Components

Create specified RT-Component's instances via registered Factory. When its instances have been created successfully, the following processings are also executed. - Read and set configuration information that was set by external file. - Bind ExecutionContext and start operation. - Register to naming service.

パラメータ:
comp_args - Target RT-Component names for the creation
戻り値:
Created RT-Component's instances

cleanupComponent

public void cleanupComponent(RTObject_impl comp)

指定したRTコンポーネントを登録解除します。

パラメータ:
comp - 登録解除するRTコンポーネントオブジェクト

notifyFinalized

public void notifyFinalized(RTObject_impl comp)
This method deletes RT-Components.

The deleted RT-Component is registered. The registered RT-Components are deleted by cleanupComponents().

パラメータ:
comp - Deleted RT component

procComponentArgs

public boolean procComponentArgs(java.lang.String comp_arg,
                                 Properties comp_id,
                                 Properties comp_conf)

procComponentArgs

パラメータ:
comp_arg - String
comp_id - Properties
comp_conf - Propertie
戻り値:
boolean

registerComponent

public boolean registerComponent(RTObject_impl comp)

RTコンポーネントを、直接にManagerに登録します。

パラメータ:
comp - 登録対象のRTコンポーネントオブジェクト
戻り値:
正常に登録できた場合はtrueを、さもなくばfalseを返します。

unregisterComponent

public boolean unregisterComponent(RTObject_impl comp)

指定したRTコンポーネントを登録解除します。

パラメータ:
comp - 登録解除するRTコンポーネントオブジェクト

createContext

public ExecutionContextBase createContext(java.lang.String ec_args)

createContext

パラメータ:
ec_args - String
戻り値:
ExecutionContextBase

procContextArgs

public boolean procContextArgs(java.lang.String ec_args,
                               java.lang.StringBuffer ec_id,
                               Properties ec_conf)

procContextArgs

パラメータ:
ec_args - String
ec_id - StringBuffer
ec_conf - Properties
戻り値:
boolean

deleteComponent

public void deleteComponent(RTObject_impl comp)
Unregister RT-Components that have been registered to Manager

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 unregistration

deleteComponent

public void deleteComponent(java.lang.String instanceName)
Unregister RT-Components that have been registered to Manager

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 unregistration

getComponent

public RTObject_impl getComponent(java.lang.String instanceName)

Managerに登録されているRTコンポーネントを取得します。

※未実装

パラメータ:
instanceName - 取得対象RTコンポーネント名
戻り値:
対象RTコンポーネントオブジェクト

getComponents

public java.util.Vector<RTObject_impl> getComponents()

Managerに登録されている全てのRTコンポーネントを取得します。

戻り値:
RTコンポーネントのリスト

getORB

public org.omg.CORBA.ORB getORB()

ORBを取得します。

戻り値:
ORBオブジェクト

getPOA

public org.omg.PortableServer.POA getPOA()

RootPOAを取得します。

戻り値:
RootPOAオブジェクト

getPOAManager

public org.omg.PortableServer.POAManager getPOAManager()

POAマネージャを取得します。

戻り値:
POAマネージャ

initManager

protected void initManager(java.lang.String[] argv)
                    throws java.lang.Exception
Manager internal initialization

Execute Manager's internal initialization processing.

パラメータ:
argv - Commandline arguments
例外:
java.lang.Exception

shutdownManager

protected void shutdownManager()
@brief Shutdown Manager

Shutdown Manager


initLogger

protected boolean initLogger()

System loggerを初期化します。

戻り値:
正常に初期化できた場合はtrueを、さもなくばfalseを返します。

shutdownLogger

protected void shutdownLogger()

System Loggerの終了処理を行います。


initORB

protected boolean initORB()
CORBA ORB initialization

Initialize ORB based on the configuration given by arguments.

戻り値:
ORB initialization result (Successful:true, Failed:false)

createORBOptions

protected java.lang.String createORBOptions()
Create ORB command options

Create ORB launch options from configuration information that has been set.

戻り値:
ORB launch options

createORBEndpoints

protected void createORBEndpoints(java.util.Vector<java.lang.String> endpoints)
Create Endpoints

Create Endpoints from the configuration.

パラメータ:
endpoints - endpoints Endpoints list

createORBEndpointOption

protected void createORBEndpointOption(java.lang.String opt,
                                       java.util.Vector<java.lang.String> endpoints)
Create a command optional line of Endpoint of ORB.

パラメータ:
opt - ORB options
endpoints - Endpoints list

createORBProperties

protected java.util.Properties createORBProperties()
Creates ORB Properties.

戻り値:
java.util.Properties Property of ORB.init().

shutdownORB

protected void shutdownORB()

ORBの終了処理を行います。


initNaming

protected boolean initNaming()

NamingManagerを初期化します。


shutdownNaming

protected void shutdownNaming()

NamingManagerの終了処理を行います。


shutdownComponents

protected void shutdownComponents()

ネーミングサービスに登録されているコンポーネントの終了処理を行います。


configureComponent

protected void configureComponent(RTObject_impl comp,
                                  Properties prop)
Configure RT-Component

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 configuration

initExecContext

protected boolean initExecContext()

ExecutionContextを初期化します。

戻り値:
正常に初期化できた場合はtrueを、さもなくばfalseを返します。

initComposite

protected boolean initComposite()

intiComposite

戻り値:
boolan

initFactories

protected boolean initFactories()

intiFactories

戻り値:
boolan

initTimer

protected boolean initTimer()

Timerを初期化します。


initManagerServant

protected boolean initManagerServant()
ManagerServant initialization

戻り値:
Initialization result (Successful:true, Failed:false)

bindManagerServant

protected boolean bindManagerServant()

bindManagerServant

戻り値:
boolean

mergeProperty

protected boolean mergeProperty(Properties properties,
                                java.lang.String fileName)

プロパティファイルを読み込んで、指定されたPropertiesオブジェクトに設定します。

パラメータ:
properties - 設定対象のPropertiesオブジェクト
fileName - プロパティファイル名
戻り値:
正常に設定できた場合はtrueを、さもなくばfalseを返します。

formatString

protected java.lang.String formatString(java.lang.String namingFormat,
                                        Properties properties)

指定されたPropertiesオブジェクトの内容を、指定された書式に従って文字列として出力します。

パラメータ:
namingFormat - 書式指定
properties - 出力対象となるPropertiesオブジェクト
戻り値:
Propertiesオブジェクトの内容を文字列出力したもの