[openrtm-commit:00578] r638 - in trunk/jp.go.aist.rtm.RTC/src: Extension/LocalService/nameservice_file jp/go/aist/rtm/RTC
openrtm @ openrtm.org
openrtm @ openrtm.org
2012年 1月 13日 (金) 12:05:36 JST
Author: fsi-katami
Date: 2012-01-13 12:05:35 +0900 (Fri, 13 Jan 2012)
New Revision: 638
Modified:
trunk/jp.go.aist.rtm.RTC/src/Extension/LocalService/nameservice_file/FileNameservice.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
Log:
added service module loader refs #2301
Modified: trunk/jp.go.aist.rtm.RTC/src/Extension/LocalService/nameservice_file/FileNameservice.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/Extension/LocalService/nameservice_file/FileNameservice.java 2012-01-12 06:20:04 UTC (rev 637)
+++ trunk/jp.go.aist.rtm.RTC/src/Extension/LocalService/nameservice_file/FileNameservice.java 2012-01-13 03:05:35 UTC (rev 638)
@@ -13,6 +13,7 @@
import jp.go.aist.rtm.RTC.Manager;
import jp.go.aist.rtm.RTC.ObjectCreator;
import jp.go.aist.rtm.RTC.ObjectDestructor;
+import jp.go.aist.rtm.RTC.RegisterModuleFunc;
import jp.go.aist.rtm.RTC.log.Logbuf;
import jp.go.aist.rtm.RTC.util.CallbackFunction;
import jp.go.aist.rtm.RTC.util.Properties;
@@ -22,7 +23,7 @@
* {@.ja FileNameservice クラス}
* {@.en FileNameservice class}
*/
-public class FileNameservice implements LocalServiceBase, CallbackFunction, ObjectCreator<LocalServiceBase>, ObjectDestructor{
+public class FileNameservice implements LocalServiceBase, CallbackFunction, ObjectCreator<LocalServiceBase>, ObjectDestructor, RegisterModuleFunc{
private static String service_name
= "org.openrtm.local_service.nameservice.file_nameservice";
@@ -342,7 +343,7 @@
* {@.en This initialization function registers FileNameservice to the factory.}
*
*/
- public static void FileNameserviceInit() {
+ public void registerModule() {
final LocalServiceFactory<LocalServiceBase,String> factory
= LocalServiceFactory.instance();
factory.addFactory(service_name,
Modified: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2012-01-12 06:20:04 UTC (rev 637)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2012-01-13 03:05:35 UTC (rev 638)
@@ -389,10 +389,15 @@
bindManagerServant();
+ String[] lsvc
+ = m_config.getProperty("manager.local_service.modules").split(",");
+ loadComponent(lsvc);
+
initLocalService();
+
+ lsvc = m_config.getProperty("manager.modules.preload").split(",");
+ loadComponent(lsvc);
- preloadComponent();
-
if (m_initProc != null) {
m_initProc.myModuleInit(this);
}
@@ -405,15 +410,18 @@
/**
* {@.ja コンポーネントをロードする。}
* {@.en Loads components.}
+ *
+ * <p>
+ * {@.ja コンポーネントをロードする。}
+ * {@.en This method loads components .}
*
- * <p>
- * {@.ja このメソッドは、"manager.modules.preload"に設定されている
- * コンポーネントをロードする。}
- * {@.en This method loads components set to "Manager.modules.preload".}
+ * @param mods
+ * {@.ja ロードするモジュール名}
+ * {@.en Loaded module names}
+ *
*/
- private void preloadComponent() {
- String[] mods
- = m_config.getProperty("manager.modules.preload").split(",");
+ private void loadComponent(String[] mods) {
+
for (int i=0; i < mods.length; ++i) {
if ( mods[i].length() == 0) {
continue;
@@ -432,7 +440,6 @@
}
}
}
-
/**
* {@.ja コンポーネントを生成する。}
* {@.en Creates components}
openrtm-commit メーリングリストの案内