[openrtm-commit:00505] r604 - in trunk: . jp.go.aist.rtm.RTC jp.go.aist.rtm.RTC/src/jp/go/aist jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/port jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/port jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util jp.go.aist.rtm.RTC/src/jp/go/aist/rtm jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util
openrtm @ openrtm.org
openrtm @ openrtm.org
2011年 12月 21日 (水) 17:23:24 JST
Author: fsi-katami
Date: 2011-12-21 17:23:23 +0900 (Wed, 21 Dec 2011)
New Revision: 604
Added:
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/Constants.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/IopIorInterceptor.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/port/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/port/EncapsOutputStreamExt.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ManagerServantUtil.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ORBUtil.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/Constants.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/IopIorInterceptor.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/port/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/port/EncapsOutputStreamExt.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ManagerServantUtil.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ORBUtil.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/Constants.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/ManagerServantUtil.java
Removed:
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/Constants.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/IopIorInterceptor.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/port/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/port/EncapsOutputStreamExt.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ManagerServantUtil.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ORBUtil.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/Constants.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/IopIorInterceptor.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/port/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/port/EncapsOutputStreamExt.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ManagerServantUtil.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ORBUtil.java
Modified:
trunk/
trunk/buildRTC.sh
trunk/jp.go.aist.rtm.RTC/
trunk/jp.go.aist.rtm.RTC/build.xml
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/IopIorInterceptor.java
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/ManagerConfig.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortBase.java
trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortBase.java
Log:
For JacORB.
Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/RELENG_1_0_0:60-401
/branches/work/ForComponentActionListener:521-522
/branches/work/ForComponentObserverConsumer:534-543
/branches/work/ForConfigurationListener:524-526
/branches/work/ForLogFormat:518-519
/branches/work/ForPortConnectListener:528-532
/branches/work/ForSDOServiceAdminClass:505-507
/branches/work/SourceSharing:591-596
/branches/work/ToGetProperties:545-548
/branches/work/ToIFR_ID:509-514
+ /branches/RELENG_1_0_0:60-401
/branches/work/ForComponentActionListener:521-522
/branches/work/ForComponentObserverConsumer:534-543
/branches/work/ForConfigurationListener:524-526
/branches/work/ForLogFormat:518-519
/branches/work/ForPortConnectListener:528-532
/branches/work/ForSDOServiceAdminClass:505-507
/branches/work/SourceSharing:591-603
/branches/work/ToGetProperties:545-548
/branches/work/ToIFR_ID:509-514
Modified: trunk/buildRTC.sh
===================================================================
--- trunk/buildRTC.sh 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/buildRTC.sh 2011-12-21 08:23:23 UTC (rev 604)
@@ -2,21 +2,30 @@
#
#
-set DUMMY=$ANT_HOME
+DUMMY=$ANT_HOME
export ANT_HOME=$ECLIPSE_HOME/plugins/org.apache.ant_1.6.5/
+
+
+if test $# -eq 0 ; then
+ var_for="buildAllLinux"
+else
+ var_for=$1
+fi
+
#
#
#
cd jp.go.aist.rtm.RTC
-ant buildAllLinux -lib $ECLIPSE_HOME/plugins/net.sf.ant4eclipse.plugin_0.5.0.rc1/lib/
+#ant buildAllLinux -lib $ECLIPSE_HOME/plugins/net.sf.ant4eclipse.plugin_0.5.0.rc1/lib/
+ant $var_for -lib $ECLIPSE_HOME/plugins/net.sf.ant4eclipse.plugin_0.5.0.rc1/lib/
if [ $? -ne 0 ];
then
- exit 1
+ exit 1
fi
echo "--"
cd ..
-set ANT_HOME=$DUMMY
+export ANT_HOME=$DUMMY
Property changes on: trunk/jp.go.aist.rtm.RTC
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/RELENG_1_0/jp.go.aist.rtm.RTC:408-498
/branches/RELENG_1_0_0/jp.go.aist.rtm.RTC:60-401
/branches/work/ForComponentActionListener/jp.go.aist.rtm.RTC:521-522
/branches/work/ForComponentObserverConsumer/jp.go.aist.rtm.RTC:534-543
/branches/work/ForConfigurationListener/jp.go.aist.rtm.RTC:524-526
/branches/work/ForLogFormat/jp.go.aist.rtm.RTC:518-519
/branches/work/ForPortConnectListener/jp.go.aist.rtm.RTC:528-532
/branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC:505-507
/branches/work/SourceSharing/jp.go.aist.rtm.RTC:591-596
/branches/work/ToGetProperties/jp.go.aist.rtm.RTC:545-548
/branches/work/ToIFR_ID/jp.go.aist.rtm.RTC:509-514
+ /branches/RELENG_1_0/jp.go.aist.rtm.RTC:408-498
/branches/RELENG_1_0_0/jp.go.aist.rtm.RTC:60-401
/branches/work/ForComponentActionListener/jp.go.aist.rtm.RTC:521-522
/branches/work/ForComponentObserverConsumer/jp.go.aist.rtm.RTC:534-543
/branches/work/ForConfigurationListener/jp.go.aist.rtm.RTC:524-526
/branches/work/ForLogFormat/jp.go.aist.rtm.RTC:518-519
/branches/work/ForPortConnectListener/jp.go.aist.rtm.RTC:528-532
/branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC:505-507
/branches/work/SourceSharing/jp.go.aist.rtm.RTC:591-603
/branches/work/ToGetProperties/jp.go.aist.rtm.RTC:545-548
/branches/work/ToIFR_ID/jp.go.aist.rtm.RTC:509-514
Modified: trunk/jp.go.aist.rtm.RTC/build.xml
===================================================================
--- trunk/jp.go.aist.rtm.RTC/build.xml 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/build.xml 2011-12-21 08:23:23 UTC (rev 604)
@@ -30,6 +30,12 @@
<property name="source.main" value="src/jp"/>
+ <property name="source.common" value="src/jp/go/aist/rtm"/>
+
+ <property name="source.sunorb" value="src/jp/go/aist/ForSunOrb"/>
+
+ <property name="source.jacorb" value="src/jp/go/aist/ForJacOrb"/>
+
<property name="source.samples.class" value="bin/RTMExamples"/>
<property name="source.samples.java" value="src/RTMExamples"/>
@@ -172,6 +178,25 @@
</target>
+ <target name="buildAllAndroid">
+
+ <antcall target="idlCompile" />
+
+ <antcall target="idlCompileEtc" />
+
+ <antcall target="clean" />
+
+ <antcall target="compile_android" />
+
+ <antcall target="jar" />
+
+ <antcall target="javaExamples" />
+
+ <antcall target="javaDoc" />
+
+ </target>
+
+
<target name="buildTests">
<antcall target="idlCompile" />
@@ -619,9 +644,246 @@
<javac srcdir="${source.examples}:" destdir="${build.dir}" classpath="lib/commons-cli-1.1.jar" encoding="UTF-8" />
+ <copy todir="${source.sdo}">
+
+ <fileset dir="${source.sdotemp}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <delete dir="${source.sdotemp}" />
+
+ <native2ascii encoding="UTF-8" src="${source.rtc}" dest="${source.rtctemp}" >
+
+ <include name="**/*.java" />
+
+ </native2ascii>
+
+ <copy todir="${source.rtc}">
+
+ <fileset dir="${source.rtctemp}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <delete dir="${source.rtctemp}" />
+
+ <native2ascii encoding="UTF-8" src="${source.rtm}" dest="${source.rtmtemp}" >
+
+ <include name="**/*.java" />
+
+ </native2ascii>
+
+ <copy todir="${source.rtm}">
+
+ <fileset dir="${source.rtmtemp}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <delete dir="${source.rtmtemp}" />
+
+ <native2ascii encoding="UTF-8" src="${source.openrtm}" dest="${source.openrtmtemp}" >
+
+ <include name="**/*.java" />
+
+ </native2ascii>
+
+ <copy todir="${source.openrtm}">
+
+ <fileset dir="${source.openrtmtemp}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <delete dir="${source.openrtmtemp}" />
+
+ <javac srcdir="${source.sdo}:${source.rtc}:${source.rtm}:${source.openrtm}" destdir="${build.dir}" classpath="lib/commons-cli-1.1.jar" encoding="UTF-8" />
+
+ <copy todir="${source.common}" overwrite="true">
+
+ <fileset dir="${source.sunorb}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <javac srcdir="${source.main}:${source.rtcd}:${source.rtcprof}" destdir="${build.dir}" classpath="lib/commons-cli-1.1.jar" encoding="UTF-8" includes="go/aist/**" excludes="go/aist/ForSunOrb/**,go/aist/ForJacOrb/**" />
+
+ <delete dir="${source.examplestemp}" />
+
+ <native2ascii encoding="UTF-8" src="${source.examples}" dest="${source.examplestemp}" >
+
+ <include name="**/*.java" />
+
+ </native2ascii>
+
+ <fixcrlf srcdir="${source.examplestemp}" eol="crlf" >
+
+ <include name="**/*.java" />
+
+ </fixcrlf>
+
+ <copy todir="${source.examples}">
+
+ <fileset dir="${source.examplestemp}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <delete dir="${source.examplestemp}" />
+
+ <javac srcdir="${source.examples}:" destdir="${build.dir}" classpath="lib/commons-cli-1.1.jar" encoding="UTF-8" />
+
</target>
+ <target name="compile_android" description="ソースをコンパイルします">
+
+ <native2ascii encoding="UTF-8" src="${source.sdo}" dest="${source.sdotemp}" >
+
+ <include name="**/*.java" />
+
+ </native2ascii>
+
+ <copy todir="${source.sdo}">
+
+ <fileset dir="${source.sdotemp}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <delete dir="${source.sdotemp}" />
+
+ <native2ascii encoding="UTF-8" src="${source.rtc}" dest="${source.rtctemp}" >
+
+ <include name="**/*.java" />
+
+ </native2ascii>
+
+ <copy todir="${source.rtc}">
+
+ <fileset dir="${source.rtctemp}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <delete dir="${source.rtctemp}" />
+
+ <native2ascii encoding="UTF-8" src="${source.rtm}" dest="${source.rtmtemp}" >
+
+ <include name="**/*.java" />
+
+ </native2ascii>
+
+ <copy todir="${source.rtm}">
+
+ <fileset dir="${source.rtmtemp}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <delete dir="${source.rtmtemp}" />
+
+ <native2ascii encoding="UTF-8" src="${source.openrtm}" dest="${source.openrtmtemp}" >
+
+ <include name="**/*.java" />
+
+ </native2ascii>
+
+ <copy todir="${source.openrtm}">
+
+ <fileset dir="${source.openrtmtemp}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <delete dir="${source.openrtmtemp}" />
+
+ <javac srcdir="${source.sdo}:${source.rtc}:${source.rtm}:${source.openrtm}" destdir="${build.dir}" classpath="lib/commons-cli-1.1.jar:/usr/local/JacORB/lib/jacorb.jar:" encoding="UTF-8" />
+
+ <copy todir="${source.common}" overwrite="true" >
+
+ <fileset dir="${source.jacorb}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <javac srcdir="${source.main}:${source.rtcd}:${source.rtcprof}" destdir="${build.dir}" classpath="lib/commons-cli-1.1.jar:/usr/local/JacORB/lib/jacorb.jar:" encoding="UTF-8" includes="go/aist/**" excludes="go/aist/ForSunOrb/**,go/aist/ForJacOrb/**" />
+
+ <delete dir="${source.examplestemp}" />
+
+ <native2ascii encoding="UTF-8" src="${source.examples}" dest="${source.examplestemp}" >
+
+ <include name="**/*.java" />
+
+ </native2ascii>
+
+ <fixcrlf srcdir="${source.examplestemp}" eol="crlf" >
+
+ <include name="**/*.java" />
+
+ </fixcrlf>
+
+ <copy todir="${source.examples}">
+
+ <fileset dir="${source.examplestemp}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <delete dir="${source.examplestemp}" />
+
+ <copy todir="${source.common}" overwrite="true">
+
+ <fileset dir="${source.jacorb}" >
+
+ <include name="**/*.java" />
+
+ </fileset>
+
+ </copy>
+
+ <javac srcdir="${source.examples}:" destdir="${build.dir}" classpath="lib/commons-cli-1.1.jar:/usr/local/JacORB/lib/jacorb.jar:" encoding="UTF-8" includes="go/aist/**" excludes="go/aist/ForSunOrb/**,go/aist/ForJacOrb/**" />
+
+ </target>
+
+
<target name="compile_tests" description="ソースをコンパイルします">
<javac srcdir="${source.sdo}:${source.rtc}:${source.rtm}:${source.openrtm}:${source.main}:${source.examples}:${source.test}:${source.tests.bind}" destdir="${build.dir.test}" classpath="lib/commons-cli-1.1.jar:${env.JUNIT_HOME}/junit.jar:" encoding="UTF-8" />
Deleted: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/Constants.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/Constants.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/Constants.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -1,31 +0,0 @@
-package jp.go.aist.rtm;
-
-/**
- * {@.ja JacORB 用の定数}
- * {@.en Constants for JacORB}
- */
-public interface Constants {
-
- public static final String SERVER_HOST = "OAIAddr";
- public static final String SERVER_PORT = "OAPort";
- public static final String LISTENER_PORT = "OAPort";
-
- /**
- * {@.ja Managerのデフォルト・コンフィグレーションのファイル・パス}
- * {@.en The default configuration file path for manager}
- */
- public static final String[] CONFIG_FILE_PATH = {
- "./rtc.conf",
- "/sdcard/rtc.conf",
- "/mnt/sdcard/rtc.conf",
- null
- };
- /**
- * {@.ja 対応してるエンディアン}
- * {@.en supported endian}
- */
- public static final String[] SUPPORTED_CDR_ENDIAN = {
- "big",
- null
- };
-}
Copied: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/Constants.java (from rev 603, branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/Constants.java)
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/Constants.java (rev 0)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/Constants.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -0,0 +1,31 @@
+package jp.go.aist.rtm;
+
+/**
+ * {@.ja JacORB 用の定数}
+ * {@.en Constants for JacORB}
+ */
+public interface Constants {
+
+ public static final String SERVER_HOST = "OAIAddr";
+ public static final String SERVER_PORT = "OAPort";
+ public static final String LISTENER_PORT = "OAPort";
+
+ /**
+ * {@.ja Managerのデフォルト・コンフィグレーションのファイル・パス}
+ * {@.en The default configuration file path for manager}
+ */
+ public static final String[] CONFIG_FILE_PATH = {
+ "./rtc.conf",
+ "/sdcard/rtc.conf",
+ "/mnt/sdcard/rtc.conf",
+ null
+ };
+ /**
+ * {@.ja 対応してるエンディアン}
+ * {@.en supported endian}
+ */
+ public static final String[] SUPPORTED_CDR_ENDIAN = {
+ "big",
+ null
+ };
+}
Deleted: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/IopIorInterceptor.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/IopIorInterceptor.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/IopIorInterceptor.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -1,225 +0,0 @@
-package jp.go.aist.rtm.RTC;
-
-import java.util.ArrayList;
-
-import jp.go.aist.rtm.RTC.log.Logbuf;
-import jp.go.aist.rtm.RTC.util.IiopAddressComp;
-import jp.go.aist.rtm.RTC.util.IiopAddressCompHelper;
-
-import org.omg.CORBA.Any;
-import org.omg.CORBA.LocalObject;
-import org.omg.CORBA.ORB;
-import org.omg.IOP.Codec;
-import org.omg.IOP.TAG_INTERNET_IOP;
-import org.omg.IOP.TaggedComponent;
-import org.omg.PortableInterceptor.IORInterceptor;
-
-//<+JacORB
-import org.jacorb.orb.etf.ProtocolAddressBase;
-import org.jacorb.orb.iiop.IIOPAddress;
-import org.jacorb.orb.iiop.IIOPProfile;
-import java.util.List;
-import java.util.Iterator;
-//+>
-
-/**
- * {@.ja ポータブルインターセプタを利用してIORを書き換える.}
- * {@.en Rewrites IOR by using a portable interceptor.}
- *
- */
-public class IopIorInterceptor extends LocalObject
- implements org.omg.PortableInterceptor.IORInterceptor{
-
- private static final long serialVersionUID = 7953662324638701357L;
-
- /**
- * {@.ja Codec}
- * {@.en Codec}
- */
- static private Codec codec;
- /**
- * {@.ja エンドポイント}
- * {@.en endpoints}
- */
- static private ArrayList<IiopAddressComp> m_endpoints
- = new ArrayList<IiopAddressComp>();
-
- /**
- * {@.ja エンドポイントを設定.}
- * {@.en Sets the end points.}
- * @param endpoints
- * {@.ja エンドポイント}
- * {@.en endpoints}
- *
- */
- public static void setEndpoints(ArrayList endpoints){
- m_endpoints = endpoints;
- }
-
- /**
- * {@.ja エンドポイントを設定.}
- * {@.en Sets the end points.}
- * @param hostString
- * {@.ja ホスト}
- * {@.en host}
- * @param portString
- * {@.ja ポート}
- * {@.en port}
- *
- */
- public static void setEndpoints(String hostString, String portString){
- short port = 0;
- try {
- port = (short)Integer.parseInt(portString);
- }
- catch(Exception ex){
- }
-
- IiopAddressComp comp = new IiopAddressComp(hostString,port);
- m_endpoints.add(comp);
- }
-
- /**
- * {@.ja エンドポイントを書き換える.}
- * {@.en Replaces the end point the end point.}
- * <p>
- * {@.ja エンドポイントリスト内のポート番号が 0 のエンドポイントを
- * 与えられたポート番号に置き換える。}
- * {@.en Replaces the port number of the end point with the port number
- * of the argument.Only the end point of port number 0 is replaced.}
- * </p>
- * @param orb
- * {@.ja ORB}
- * {@.en ORB}
- */
- public static void replacePort0(ORB orb) {
- if(orb==null){
- return;
- }
- if(m_endpoints==null){
- return;
- }
- if(m_endpoints.size()==0){
- return;
- }
- else {
- int ic;
- for(ic=0;ic<m_endpoints.size();++ic){
- if(m_endpoints.get(ic).Port==0){
- break;
- }
- }
- if(ic==m_endpoints.size()){
- return ;
- }
- }
-
- //<+ JacORB
- ProtocolAddressBase address = null;
- org.jacorb.orb.ORB jacorb = (org.jacorb.orb.ORB)orb;
- if (jacorb.getBasicAdapter() == null) {
- return;
- }
- List eplist = jacorb.getBasicAdapter().getEndpointProfiles();
- for (Iterator i = eplist.iterator(); i.hasNext(); ) {
- org.omg.ETF.Profile p = (org.omg.ETF.Profile)i.next();
- if (p instanceof IIOPProfile) {
- address = ((IIOPProfile)p).getAddress();
- break;
- }
- }
- if (address == null) {
- return;
- }
- short port = (short)((IIOPAddress)address).getPort();
- //+>
-
- for(int ic=0;ic<m_endpoints.size();ic++){
- if(m_endpoints.get(ic).Port==0){
- m_endpoints.get(ic).Port = port;
- }
- }
- }
- /**
- * {@.ja コンストラクタ.}
- * {@.en Constructor.}
- * @param codec
- * {@.ja エンコード}
- * {@.en Encoding}
- *
- */
- public IopIorInterceptor( Codec codec ){
- rtcout = new Logbuf("IopIorInterceptor");
- this.codec = codec;
- }
-
- /**
- * {@.ja インターセプタ名を返す}
- * {@.en Returns the name of the interceptor.}
- * @return
- * {@.ja インターセプタ名}
- * {@.en the name of the interceptor.}
- *
- */
- public String name() {
- return IORInterceptor.class.getName();
- }
-
- /**
- * {@.ja インターセプタの破棄}
- * {@.en Destroys he interceptor.}
- *
- */
- public void destroy() {
- }
-
- /**
- * {@.ja TAG_ALTERNATE_IIOP_ADDRESS へ endpoint を設定する}
- * {@.en sets endpoint to TAG_ALTERNATE_IIOP_ADDRESS.}
- * @param info
- * {@.ja IORInfo}
- * {@.en IORInfo}
- */
- public void establish_components(org.omg.PortableInterceptor.IORInfo info){
- rtcout.println(Logbuf.TRACE, "establish_components()");
-
- //Gets any type.
- ORB orb = ORB.init();
- Any any = orb.create_any();
-
- //Creates TaggedComponents
- TaggedComponent[] components = new TaggedComponent[m_endpoints.size()];
- for(int ic=0;ic<m_endpoints.size();++ic){
- IiopAddressComp lp = m_endpoints.get(ic);
-
- IiopAddressCompHelper.insert(any, lp);
- byte[] by = null;
- try {
- by = codec.encode_value(any);
- }
- catch (Exception ex){
- rtcout.println(Logbuf.WARN,
- "Invalid Type For Encoding:" +lp.HostID+","+lp.Port);
- continue;
- }
- components[ic] = new TaggedComponent(
- org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS.value, by);
- }
-
-
- for ( int ic=0; ic<components.length; ++ic ) {
- info.add_ior_component_to_profile( components[ic],
- TAG_INTERNET_IOP.value );
- }
-
- }
-
- /**
- * {@.ja ロガーストリーム}
- */
- private Logbuf rtcout;
-}
-
-
-
-
Copied: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/IopIorInterceptor.java (from rev 603, branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/IopIorInterceptor.java)
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/IopIorInterceptor.java (rev 0)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/IopIorInterceptor.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -0,0 +1,225 @@
+package jp.go.aist.rtm.RTC;
+
+import java.util.ArrayList;
+
+import jp.go.aist.rtm.RTC.log.Logbuf;
+import jp.go.aist.rtm.RTC.util.IiopAddressComp;
+import jp.go.aist.rtm.RTC.util.IiopAddressCompHelper;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.LocalObject;
+import org.omg.CORBA.ORB;
+import org.omg.IOP.Codec;
+import org.omg.IOP.TAG_INTERNET_IOP;
+import org.omg.IOP.TaggedComponent;
+import org.omg.PortableInterceptor.IORInterceptor;
+
+//<+JacORB
+import org.jacorb.orb.etf.ProtocolAddressBase;
+import org.jacorb.orb.iiop.IIOPAddress;
+import org.jacorb.orb.iiop.IIOPProfile;
+import java.util.List;
+import java.util.Iterator;
+//+>
+
+/**
+ * {@.ja ポータブルインターセプタを利用してIORを書き換える.}
+ * {@.en Rewrites IOR by using a portable interceptor.}
+ *
+ */
+public class IopIorInterceptor extends LocalObject
+ implements org.omg.PortableInterceptor.IORInterceptor{
+
+ private static final long serialVersionUID = 7953662324638701357L;
+
+ /**
+ * {@.ja Codec}
+ * {@.en Codec}
+ */
+ static private Codec codec;
+ /**
+ * {@.ja エンドポイント}
+ * {@.en endpoints}
+ */
+ static private ArrayList<IiopAddressComp> m_endpoints
+ = new ArrayList<IiopAddressComp>();
+
+ /**
+ * {@.ja エンドポイントを設定.}
+ * {@.en Sets the end points.}
+ * @param endpoints
+ * {@.ja エンドポイント}
+ * {@.en endpoints}
+ *
+ */
+ public static void setEndpoints(ArrayList endpoints){
+ m_endpoints = endpoints;
+ }
+
+ /**
+ * {@.ja エンドポイントを設定.}
+ * {@.en Sets the end points.}
+ * @param hostString
+ * {@.ja ホスト}
+ * {@.en host}
+ * @param portString
+ * {@.ja ポート}
+ * {@.en port}
+ *
+ */
+ public static void setEndpoints(String hostString, String portString){
+ short port = 0;
+ try {
+ port = (short)Integer.parseInt(portString);
+ }
+ catch(Exception ex){
+ }
+
+ IiopAddressComp comp = new IiopAddressComp(hostString,port);
+ m_endpoints.add(comp);
+ }
+
+ /**
+ * {@.ja エンドポイントを書き換える.}
+ * {@.en Replaces the end point the end point.}
+ * <p>
+ * {@.ja エンドポイントリスト内のポート番号が 0 のエンドポイントを
+ * 与えられたポート番号に置き換える。}
+ * {@.en Replaces the port number of the end point with the port number
+ * of the argument.Only the end point of port number 0 is replaced.}
+ * </p>
+ * @param orb
+ * {@.ja ORB}
+ * {@.en ORB}
+ */
+ public static void replacePort0(ORB orb) {
+ if(orb==null){
+ return;
+ }
+ if(m_endpoints==null){
+ return;
+ }
+ if(m_endpoints.size()==0){
+ return;
+ }
+ else {
+ int ic;
+ for(ic=0;ic<m_endpoints.size();++ic){
+ if(m_endpoints.get(ic).Port==0){
+ break;
+ }
+ }
+ if(ic==m_endpoints.size()){
+ return ;
+ }
+ }
+
+ //<+ JacORB
+ ProtocolAddressBase address = null;
+ org.jacorb.orb.ORB jacorb = (org.jacorb.orb.ORB)orb;
+ if (jacorb.getBasicAdapter() == null) {
+ return;
+ }
+ List eplist = jacorb.getBasicAdapter().getEndpointProfiles();
+ for (Iterator i = eplist.iterator(); i.hasNext(); ) {
+ org.omg.ETF.Profile p = (org.omg.ETF.Profile)i.next();
+ if (p instanceof IIOPProfile) {
+ address = ((IIOPProfile)p).getAddress();
+ break;
+ }
+ }
+ if (address == null) {
+ return;
+ }
+ short port = (short)((IIOPAddress)address).getPort();
+ //+>
+
+ for(int ic=0;ic<m_endpoints.size();ic++){
+ if(m_endpoints.get(ic).Port==0){
+ m_endpoints.get(ic).Port = port;
+ }
+ }
+ }
+ /**
+ * {@.ja コンストラクタ.}
+ * {@.en Constructor.}
+ * @param codec
+ * {@.ja エンコード}
+ * {@.en Encoding}
+ *
+ */
+ public IopIorInterceptor( Codec codec ){
+ rtcout = new Logbuf("IopIorInterceptor");
+ this.codec = codec;
+ }
+
+ /**
+ * {@.ja インターセプタ名を返す}
+ * {@.en Returns the name of the interceptor.}
+ * @return
+ * {@.ja インターセプタ名}
+ * {@.en the name of the interceptor.}
+ *
+ */
+ public String name() {
+ return IORInterceptor.class.getName();
+ }
+
+ /**
+ * {@.ja インターセプタの破棄}
+ * {@.en Destroys he interceptor.}
+ *
+ */
+ public void destroy() {
+ }
+
+ /**
+ * {@.ja TAG_ALTERNATE_IIOP_ADDRESS へ endpoint を設定する}
+ * {@.en sets endpoint to TAG_ALTERNATE_IIOP_ADDRESS.}
+ * @param info
+ * {@.ja IORInfo}
+ * {@.en IORInfo}
+ */
+ public void establish_components(org.omg.PortableInterceptor.IORInfo info){
+ rtcout.println(Logbuf.TRACE, "establish_components()");
+
+ //Gets any type.
+ ORB orb = ORB.init();
+ Any any = orb.create_any();
+
+ //Creates TaggedComponents
+ TaggedComponent[] components = new TaggedComponent[m_endpoints.size()];
+ for(int ic=0;ic<m_endpoints.size();++ic){
+ IiopAddressComp lp = m_endpoints.get(ic);
+
+ IiopAddressCompHelper.insert(any, lp);
+ byte[] by = null;
+ try {
+ by = codec.encode_value(any);
+ }
+ catch (Exception ex){
+ rtcout.println(Logbuf.WARN,
+ "Invalid Type For Encoding:" +lp.HostID+","+lp.Port);
+ continue;
+ }
+ components[ic] = new TaggedComponent(
+ org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS.value, by);
+ }
+
+
+ for ( int ic=0; ic<components.length; ++ic ) {
+ info.add_ior_component_to_profile( components[ic],
+ TAG_INTERNET_IOP.value );
+ }
+
+ }
+
+ /**
+ * {@.ja ロガーストリーム}
+ */
+ private Logbuf rtcout;
+}
+
+
+
+
Deleted: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/port/EncapsOutputStreamExt.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/port/EncapsOutputStreamExt.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/port/EncapsOutputStreamExt.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -1,30 +0,0 @@
-package jp.go.aist.rtm.RTC.port;
-/**
- * {@.ja EncapsOutputStreamの拡張クラス。}
- * {@.en Expansion class of EncapsOutputStream}
- */
-
-import org.jacorb.orb.CDROutputStream;
-import org.omg.CORBA.ORB;
-
-
-public class EncapsOutputStreamExt extends CDROutputStream {
- /**
- * {@.ja コンストラクタ}
- * {@.en Constructor}
- * <p>
- *
- */
- public EncapsOutputStreamExt(org.omg.CORBA.ORB orb, boolean isLittleEndian) {
- super(orb);
- }
-
- /**
- * {@.ja ストリームの内容を配列で取得する。}
- * {@.en Gets the content of the stream in the array.}
- * <p>
- */
- public final byte[] getByteArray(){
- return getBufferCopy();
- }
-}
Copied: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/port/EncapsOutputStreamExt.java (from rev 603, branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/port/EncapsOutputStreamExt.java)
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/port/EncapsOutputStreamExt.java (rev 0)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/port/EncapsOutputStreamExt.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -0,0 +1,30 @@
+package jp.go.aist.rtm.RTC.port;
+/**
+ * {@.ja EncapsOutputStreamの拡張クラス。}
+ * {@.en Expansion class of EncapsOutputStream}
+ */
+
+import org.jacorb.orb.CDROutputStream;
+import org.omg.CORBA.ORB;
+
+
+public class EncapsOutputStreamExt extends CDROutputStream {
+ /**
+ * {@.ja コンストラクタ}
+ * {@.en Constructor}
+ * <p>
+ *
+ */
+ public EncapsOutputStreamExt(org.omg.CORBA.ORB orb, boolean isLittleEndian) {
+ super(orb);
+ }
+
+ /**
+ * {@.ja ストリームの内容を配列で取得する。}
+ * {@.en Gets the content of the stream in the array.}
+ * <p>
+ */
+ public final byte[] getByteArray(){
+ return getBufferCopy();
+ }
+}
Deleted: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ManagerServantUtil.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ManagerServantUtil.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ManagerServantUtil.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -1,16 +0,0 @@
-package jp.go.aist.rtm.RTC.util;
-
-import org.omg.PortableServer.Servant;
-import jp.go.aist.rtm.RTC.Manager;
-
-public class ManagerServantUtil {
- public static void createManagerCORBAServant(Manager mgr,Servant servant) throws Exception {
-
- mgr.getPOA().activate_object( servant );
- org.jacorb.orb.ORB orb
- = (org.jacorb.orb.ORB)mgr.getORB();
- orb.register_initial_reference(
- "manager", mgr.getPOA().servant_to_reference(servant) );
- }
-}
-
Copied: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ManagerServantUtil.java (from rev 603, branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ManagerServantUtil.java)
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ManagerServantUtil.java (rev 0)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ManagerServantUtil.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -0,0 +1,16 @@
+package jp.go.aist.rtm.RTC.util;
+
+import org.omg.PortableServer.Servant;
+import jp.go.aist.rtm.RTC.Manager;
+
+public class ManagerServantUtil {
+ public static void createManagerCORBAServant(Manager mgr,Servant servant) throws Exception {
+
+ mgr.getPOA().activate_object( servant );
+ org.jacorb.orb.ORB orb
+ = (org.jacorb.orb.ORB)mgr.getORB();
+ orb.register_initial_reference(
+ "manager", mgr.getPOA().servant_to_reference(servant) );
+ }
+}
+
Deleted: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ORBUtil.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ORBUtil.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ORBUtil.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -1,76 +0,0 @@
-package jp.go.aist.rtm.RTC.util;
-
-import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.omg.CORBA.ORB;
-
-/**
- * {@.ja ORBオブジェクトを生成、管理するクラス}
- * {@.en Class that generates, and manages ORB object}
- */
-public class ORBUtil {
-
- private static ORB orb = null;
-
- /**
- * {@.ja ORBオブジェクトを取得する}
- * {@.en Gets ORB object}
- *
- * @return
- * {@.ja ORBオブジェクト}
- * {@.en ORB object}
- */
- public static ORB getOrb() {
- return getOrb(null);
- }
-
- /**
- * {@.ja 管理しているORBオブジェクトをクリアする}
- * {@.en Clears the managed ORB object}
- *
- */
- public static void clearOrb() {
- orb = null;
- }
-
- /**
- * {@.ja ORBオブジェクトを取得する}
- * {@.en Gets ORB object}
- *
- * @param args
- * {@.ja アプリケーションの main メソッドのコマンド行引数}
- * {@.en command-line arguments for the application's main method}
- *
- * @return
- * {@.ja ORBオブジェクト}
- * {@.en ORB object}
- */
- public static ORB getOrb(String[] args) {
- return getOrb(args, null);
- }
- /**
- * {@.ja 指定された引数に基づいてORBオブジェクトを生成後、取得する}
- * {@.en Generates the ORB object based on the specified argument,
- * and gets it. }
- * <p>
- * {@.ja すでにORBオブジェクトが生成済みの場合は、それが取得される}
- * {@.en When the ORB object is generated, it is returned}
- *
- * @param args
- * {@.ja ORBオブジェクト生成時の引数}
- * {@.en Argument for ORB object generation}
- * @return
- * {@.ja ORBオブジェクト}
- * {@.en ORB object}
- */
- public static ORB getOrb(String[] args, Properties prop) {
-
- if (orb == null) {
- orb = ORB.init(args, prop);
- }
-
- return orb;
- }
-}
Copied: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ORBUtil.java (from rev 603, branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ORBUtil.java)
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ORBUtil.java (rev 0)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForJacOrb/RTC/util/ORBUtil.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -0,0 +1,76 @@
+package jp.go.aist.rtm.RTC.util;
+
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.omg.CORBA.ORB;
+
+/**
+ * {@.ja ORBオブジェクトを生成、管理するクラス}
+ * {@.en Class that generates, and manages ORB object}
+ */
+public class ORBUtil {
+
+ private static ORB orb = null;
+
+ /**
+ * {@.ja ORBオブジェクトを取得する}
+ * {@.en Gets ORB object}
+ *
+ * @return
+ * {@.ja ORBオブジェクト}
+ * {@.en ORB object}
+ */
+ public static ORB getOrb() {
+ return getOrb(null);
+ }
+
+ /**
+ * {@.ja 管理しているORBオブジェクトをクリアする}
+ * {@.en Clears the managed ORB object}
+ *
+ */
+ public static void clearOrb() {
+ orb = null;
+ }
+
+ /**
+ * {@.ja ORBオブジェクトを取得する}
+ * {@.en Gets ORB object}
+ *
+ * @param args
+ * {@.ja アプリケーションの main メソッドのコマンド行引数}
+ * {@.en command-line arguments for the application's main method}
+ *
+ * @return
+ * {@.ja ORBオブジェクト}
+ * {@.en ORB object}
+ */
+ public static ORB getOrb(String[] args) {
+ return getOrb(args, null);
+ }
+ /**
+ * {@.ja 指定された引数に基づいてORBオブジェクトを生成後、取得する}
+ * {@.en Generates the ORB object based on the specified argument,
+ * and gets it. }
+ * <p>
+ * {@.ja すでにORBオブジェクトが生成済みの場合は、それが取得される}
+ * {@.en When the ORB object is generated, it is returned}
+ *
+ * @param args
+ * {@.ja ORBオブジェクト生成時の引数}
+ * {@.en Argument for ORB object generation}
+ * @return
+ * {@.ja ORBオブジェクト}
+ * {@.en ORB object}
+ */
+ public static ORB getOrb(String[] args, Properties prop) {
+
+ if (orb == null) {
+ orb = ORB.init(args, prop);
+ }
+
+ return orb;
+ }
+}
Deleted: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/Constants.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/Constants.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/Constants.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -1,34 +0,0 @@
-package jp.go.aist.rtm;
-
-/**
- * {@.ja sun-orb 用の定数}
- * {@.en Constants for sun-orb}
- */
-public interface Constants {
-
- public static final String SERVER_HOST = "com.sun.CORBA.ORBServerHost";
- public static final String SERVER_PORT = "com.sun.CORBA.ORBServerPort";
- public static final String LISTENER_PORT = "com.sun.CORBA.POA.ORBPersistentServerPort";
-
- /**
- * {@.ja Managerのデフォルト・コンフィグレーションのファイル・パス}
- * {@.en The default configuration file path for manager}
- */
- public static final String[] CONFIG_FILE_PATH = {
- "./rtc.conf",
- "/etc/rtc.conf",
- "/etc/rtc/rtc.conf",
- "/usr/local/etc/rtc.conf",
- "/usr/local/etc/rtc/rtc.conf",
- null
- };
- /**
- * {@.ja 対応してるエンディアン}
- * {@.en supported endian}
- */
- public static final String[] SUPPORTED_CDR_ENDIAN = {
- "little",
- "big",
- null
- };
-}
Copied: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/Constants.java (from rev 603, branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/Constants.java)
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/Constants.java (rev 0)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/Constants.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -0,0 +1,34 @@
+package jp.go.aist.rtm;
+
+/**
+ * {@.ja sun-orb 用の定数}
+ * {@.en Constants for sun-orb}
+ */
+public interface Constants {
+
+ public static final String SERVER_HOST = "com.sun.CORBA.ORBServerHost";
+ public static final String SERVER_PORT = "com.sun.CORBA.ORBServerPort";
+ public static final String LISTENER_PORT = "com.sun.CORBA.POA.ORBPersistentServerPort";
+
+ /**
+ * {@.ja Managerのデフォルト・コンフィグレーションのファイル・パス}
+ * {@.en The default configuration file path for manager}
+ */
+ public static final String[] CONFIG_FILE_PATH = {
+ "./rtc.conf",
+ "/etc/rtc.conf",
+ "/etc/rtc/rtc.conf",
+ "/usr/local/etc/rtc.conf",
+ "/usr/local/etc/rtc/rtc.conf",
+ null
+ };
+ /**
+ * {@.ja 対応してるエンディアン}
+ * {@.en supported endian}
+ */
+ public static final String[] SUPPORTED_CDR_ENDIAN = {
+ "little",
+ "big",
+ null
+ };
+}
Deleted: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/IopIorInterceptor.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/IopIorInterceptor.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/IopIorInterceptor.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -1,198 +0,0 @@
-package jp.go.aist.rtm.RTC;
-
-import java.util.ArrayList;
-
-import jp.go.aist.rtm.RTC.log.Logbuf;
-import jp.go.aist.rtm.RTC.util.IiopAddressComp;
-import jp.go.aist.rtm.RTC.util.IiopAddressCompHelper;
-
-import org.omg.CORBA.Any;
-import org.omg.CORBA.LocalObject;
-import org.omg.CORBA.ORB;
-import org.omg.IOP.Codec;
-import org.omg.IOP.TAG_INTERNET_IOP;
-import org.omg.IOP.TaggedComponent;
-import org.omg.PortableInterceptor.IORInterceptor;
-
-
-/**
- * {@.ja ポータブルインターセプタを利用してIORを書き換える.}
- * {@.en Rewrites IOR by using a portable interceptor.}
- *
- */
-public class IopIorInterceptor extends LocalObject
- implements org.omg.PortableInterceptor.IORInterceptor{
-
- private static final long serialVersionUID = 7953662324638701357L;
-
- /**
- * {@.ja Codec}
- * {@.en Codec}
- */
- static private Codec codec;
- /**
- * {@.ja エンドポイント}
- * {@.en endpoints}
- */
- static private ArrayList<IiopAddressComp> m_endpoints
- = new ArrayList<IiopAddressComp>();
-
- /**
- * {@.ja エンドポイントを設定.}
- * {@.en Sets the end points.}
- * @param endpoints
- * {@.ja エンドポイント}
- * {@.en endpoints}
- *
- */
- public static void setEndpoints(ArrayList endpoints){
- m_endpoints = endpoints;
- }
-
- /**
- * {@.ja エンドポイントを設定.}
- * {@.en Sets the end points.}
- * @param hostString
- * {@.ja ホスト}
- * {@.en host}
- * @param portString
- * {@.ja ポート}
- * {@.en port}
- *
- */
- public static void setEndpoints(String hostString, String portString){
- short port = 0;
- try {
- port = (short)Integer.parseInt(portString);
- }
- catch(Exception ex){
- }
-
- IiopAddressComp comp = new IiopAddressComp(hostString,port);
- m_endpoints.add(comp);
- }
-
- /**
- * {@.ja エンドポイントを書き換える.}
- * {@.en Replaces the end point the end point.}
- * <p>
- * {@.ja エンドポイントリスト内のポート番号が 0 のエンドポイントを
- * 与えられたポート番号に置き換える。}
- * {@.en Replaces the port number of the end point with the port number
- * of the argument.Only the end point of port number 0 is replaced.}
- * </p>
- * @param orb
- * {@.ja ORB}
- * {@.en ORB}
- */
- public static void replacePort0(ORB orb) {
- if(orb==null){
- return;
- }
- if(m_endpoints==null){
- return;
- }
-
- //<+ sun
- com.sun.corba.se.spi.orb.ORB sunorb
- = (com.sun.corba.se.spi.orb.ORB)orb;
-
- com.sun.corba.se.spi.ior.IOR inior = sunorb.getFVDCodeBaseIOR();
- com.sun.corba.se.spi.ior.iiop.IIOPProfile iop
- = inior.getProfile();
- com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ptemp
- = (com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate)iop.getTaggedProfileTemplate();
- String host = ptemp.getPrimaryAddress().getHost();
- short port = (short)ptemp.getPrimaryAddress().getPort();
- //+>
-
-
- for(int ic=0;ic<m_endpoints.size();ic++){
- if(m_endpoints.get(ic).Port==0){
- m_endpoints.get(ic).Port = port;
- }
- }
- }
- /**
- * {@.ja コンストラクタ.}
- * {@.en Constructor.}
- * @param codec
- * {@.ja エンコード}
- * {@.en Encoding}
- *
- */
- public IopIorInterceptor( Codec codec ){
- rtcout = new Logbuf("IopIorInterceptor");
- this.codec = codec;
- }
-
- /**
- * {@.ja インターセプタ名を返す}
- * {@.en Returns the name of the interceptor.}
- * @return
- * {@.ja インターセプタ名}
- * {@.en the name of the interceptor.}
- *
- */
- public String name() {
- return IORInterceptor.class.getName();
- }
-
- /**
- * {@.ja インターセプタの破棄}
- * {@.en Destroys he interceptor.}
- *
- */
- public void destroy() {
- }
-
- /**
- * {@.ja TAG_ALTERNATE_IIOP_ADDRESS へ endpoint を設定する}
- * {@.en sets endpoint to TAG_ALTERNATE_IIOP_ADDRESS.}
- * @param info
- * {@.ja IORInfo}
- * {@.en IORInfo}
- */
- public void establish_components(org.omg.PortableInterceptor.IORInfo info){
- rtcout.println(Logbuf.TRACE, "establish_components()");
-
- //Gets any type.
- ORB orb = ORB.init();
- Any any = orb.create_any();
-
- //Creates TaggedComponents
- TaggedComponent[] components = new TaggedComponent[m_endpoints.size()];
- for(int ic=0;ic<m_endpoints.size();++ic){
- IiopAddressComp lp = m_endpoints.get(ic);
-
- IiopAddressCompHelper.insert(any, lp);
- byte[] by = null;
- try {
- by = codec.encode_value(any);
- }
- catch (Exception ex){
- rtcout.println(Logbuf.WARN,
- "Invalid Type For Encoding:" +lp.HostID+","+lp.Port);
- continue;
- }
- components[ic] = new TaggedComponent(
- org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS.value, by);
- }
-
-
- for ( int ic=0; ic<components.length; ++ic ) {
- info.add_ior_component_to_profile( components[ic],
- TAG_INTERNET_IOP.value );
- }
-
- }
-
- /**
- * {@.ja ロガーストリーム}
- */
- private Logbuf rtcout;
-}
-
-
-
-
Copied: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/IopIorInterceptor.java (from rev 603, branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/IopIorInterceptor.java)
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/IopIorInterceptor.java (rev 0)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/IopIorInterceptor.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -0,0 +1,198 @@
+package jp.go.aist.rtm.RTC;
+
+import java.util.ArrayList;
+
+import jp.go.aist.rtm.RTC.log.Logbuf;
+import jp.go.aist.rtm.RTC.util.IiopAddressComp;
+import jp.go.aist.rtm.RTC.util.IiopAddressCompHelper;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.LocalObject;
+import org.omg.CORBA.ORB;
+import org.omg.IOP.Codec;
+import org.omg.IOP.TAG_INTERNET_IOP;
+import org.omg.IOP.TaggedComponent;
+import org.omg.PortableInterceptor.IORInterceptor;
+
+
+/**
+ * {@.ja ポータブルインターセプタを利用してIORを書き換える.}
+ * {@.en Rewrites IOR by using a portable interceptor.}
+ *
+ */
+public class IopIorInterceptor extends LocalObject
+ implements org.omg.PortableInterceptor.IORInterceptor{
+
+ private static final long serialVersionUID = 7953662324638701357L;
+
+ /**
+ * {@.ja Codec}
+ * {@.en Codec}
+ */
+ static private Codec codec;
+ /**
+ * {@.ja エンドポイント}
+ * {@.en endpoints}
+ */
+ static private ArrayList<IiopAddressComp> m_endpoints
+ = new ArrayList<IiopAddressComp>();
+
+ /**
+ * {@.ja エンドポイントを設定.}
+ * {@.en Sets the end points.}
+ * @param endpoints
+ * {@.ja エンドポイント}
+ * {@.en endpoints}
+ *
+ */
+ public static void setEndpoints(ArrayList endpoints){
+ m_endpoints = endpoints;
+ }
+
+ /**
+ * {@.ja エンドポイントを設定.}
+ * {@.en Sets the end points.}
+ * @param hostString
+ * {@.ja ホスト}
+ * {@.en host}
+ * @param portString
+ * {@.ja ポート}
+ * {@.en port}
+ *
+ */
+ public static void setEndpoints(String hostString, String portString){
+ short port = 0;
+ try {
+ port = (short)Integer.parseInt(portString);
+ }
+ catch(Exception ex){
+ }
+
+ IiopAddressComp comp = new IiopAddressComp(hostString,port);
+ m_endpoints.add(comp);
+ }
+
+ /**
+ * {@.ja エンドポイントを書き換える.}
+ * {@.en Replaces the end point the end point.}
+ * <p>
+ * {@.ja エンドポイントリスト内のポート番号が 0 のエンドポイントを
+ * 与えられたポート番号に置き換える。}
+ * {@.en Replaces the port number of the end point with the port number
+ * of the argument.Only the end point of port number 0 is replaced.}
+ * </p>
+ * @param orb
+ * {@.ja ORB}
+ * {@.en ORB}
+ */
+ public static void replacePort0(ORB orb) {
+ if(orb==null){
+ return;
+ }
+ if(m_endpoints==null){
+ return;
+ }
+
+ //<+ sun
+ com.sun.corba.se.spi.orb.ORB sunorb
+ = (com.sun.corba.se.spi.orb.ORB)orb;
+
+ com.sun.corba.se.spi.ior.IOR inior = sunorb.getFVDCodeBaseIOR();
+ com.sun.corba.se.spi.ior.iiop.IIOPProfile iop
+ = inior.getProfile();
+ com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ptemp
+ = (com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate)iop.getTaggedProfileTemplate();
+ String host = ptemp.getPrimaryAddress().getHost();
+ short port = (short)ptemp.getPrimaryAddress().getPort();
+ //+>
+
+
+ for(int ic=0;ic<m_endpoints.size();ic++){
+ if(m_endpoints.get(ic).Port==0){
+ m_endpoints.get(ic).Port = port;
+ }
+ }
+ }
+ /**
+ * {@.ja コンストラクタ.}
+ * {@.en Constructor.}
+ * @param codec
+ * {@.ja エンコード}
+ * {@.en Encoding}
+ *
+ */
+ public IopIorInterceptor( Codec codec ){
+ rtcout = new Logbuf("IopIorInterceptor");
+ this.codec = codec;
+ }
+
+ /**
+ * {@.ja インターセプタ名を返す}
+ * {@.en Returns the name of the interceptor.}
+ * @return
+ * {@.ja インターセプタ名}
+ * {@.en the name of the interceptor.}
+ *
+ */
+ public String name() {
+ return IORInterceptor.class.getName();
+ }
+
+ /**
+ * {@.ja インターセプタの破棄}
+ * {@.en Destroys he interceptor.}
+ *
+ */
+ public void destroy() {
+ }
+
+ /**
+ * {@.ja TAG_ALTERNATE_IIOP_ADDRESS へ endpoint を設定する}
+ * {@.en sets endpoint to TAG_ALTERNATE_IIOP_ADDRESS.}
+ * @param info
+ * {@.ja IORInfo}
+ * {@.en IORInfo}
+ */
+ public void establish_components(org.omg.PortableInterceptor.IORInfo info){
+ rtcout.println(Logbuf.TRACE, "establish_components()");
+
+ //Gets any type.
+ ORB orb = ORB.init();
+ Any any = orb.create_any();
+
+ //Creates TaggedComponents
+ TaggedComponent[] components = new TaggedComponent[m_endpoints.size()];
+ for(int ic=0;ic<m_endpoints.size();++ic){
+ IiopAddressComp lp = m_endpoints.get(ic);
+
+ IiopAddressCompHelper.insert(any, lp);
+ byte[] by = null;
+ try {
+ by = codec.encode_value(any);
+ }
+ catch (Exception ex){
+ rtcout.println(Logbuf.WARN,
+ "Invalid Type For Encoding:" +lp.HostID+","+lp.Port);
+ continue;
+ }
+ components[ic] = new TaggedComponent(
+ org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS.value, by);
+ }
+
+
+ for ( int ic=0; ic<components.length; ++ic ) {
+ info.add_ior_component_to_profile( components[ic],
+ TAG_INTERNET_IOP.value );
+ }
+
+ }
+
+ /**
+ * {@.ja ロガーストリーム}
+ */
+ private Logbuf rtcout;
+}
+
+
+
+
Deleted: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/port/EncapsOutputStreamExt.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/port/EncapsOutputStreamExt.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/port/EncapsOutputStreamExt.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -1,35 +0,0 @@
-package jp.go.aist.rtm.RTC.port;
-/**
- * {@.ja EncapsOutputStreamの拡張クラス。}
- * {@.en Expansion class of EncapsOutputStream}
- */
-
-import com.sun.corba.se.impl.encoding.EncapsOutputStream;
-import com.sun.corba.se.spi.orb.ORB;
-//import org.jacorb.orb.CDROutputStream;
-//import org.omg.CORBA.ORB;
-
-
-//public class EncapsOutputStreamExt extends CDROutputStream {
-public class EncapsOutputStreamExt extends EncapsOutputStream {
- /**
- * {@.ja コンストラクタ}
- * {@.en Constructor}
- * <p>
- *
- */
- public EncapsOutputStreamExt(org.omg.CORBA.ORB orb, boolean isLittleEndian) {
- super((ORB)orb,isLittleEndian);
- //super((ORB)orb);
- }
-
- /**
- * {@.ja ストリームの内容を配列で取得する。}
- * {@.en Gets the content of the stream in the array.}
- * <p>
- */
- public final byte[] getByteArray(){
- return toByteArray();
- //return getBufferCopy();
- }
-}
Copied: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/port/EncapsOutputStreamExt.java (from rev 603, branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/port/EncapsOutputStreamExt.java)
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/port/EncapsOutputStreamExt.java (rev 0)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/port/EncapsOutputStreamExt.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -0,0 +1,35 @@
+package jp.go.aist.rtm.RTC.port;
+/**
+ * {@.ja EncapsOutputStreamの拡張クラス。}
+ * {@.en Expansion class of EncapsOutputStream}
+ */
+
+import com.sun.corba.se.impl.encoding.EncapsOutputStream;
+import com.sun.corba.se.spi.orb.ORB;
+//import org.jacorb.orb.CDROutputStream;
+//import org.omg.CORBA.ORB;
+
+
+//public class EncapsOutputStreamExt extends CDROutputStream {
+public class EncapsOutputStreamExt extends EncapsOutputStream {
+ /**
+ * {@.ja コンストラクタ}
+ * {@.en Constructor}
+ * <p>
+ *
+ */
+ public EncapsOutputStreamExt(org.omg.CORBA.ORB orb, boolean isLittleEndian) {
+ super((ORB)orb,isLittleEndian);
+ //super((ORB)orb);
+ }
+
+ /**
+ * {@.ja ストリームの内容を配列で取得する。}
+ * {@.en Gets the content of the stream in the array.}
+ * <p>
+ */
+ public final byte[] getByteArray(){
+ return toByteArray();
+ //return getBufferCopy();
+ }
+}
Deleted: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ManagerServantUtil.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ManagerServantUtil.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ManagerServantUtil.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -1,16 +0,0 @@
-package jp.go.aist.rtm.RTC.util;
-
-import org.omg.PortableServer.Servant;
-import jp.go.aist.rtm.RTC.Manager;
-
-public class ManagerServantUtil {
- public static void createManagerCORBAServant(Manager mgr,Servant servant) throws Exception {
-
- mgr.getPOA().activate_object( servant );
- com.sun.corba.se.impl.orb.ORBImpl orb
- = (com.sun.corba.se.impl.orb.ORBImpl)mgr.getORB();
- orb.register_initial_reference(
- "manager", mgr.getPOA().servant_to_reference(servant) );
- }
-}
-
Copied: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ManagerServantUtil.java (from rev 603, branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ManagerServantUtil.java)
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ManagerServantUtil.java (rev 0)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ManagerServantUtil.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -0,0 +1,16 @@
+package jp.go.aist.rtm.RTC.util;
+
+import org.omg.PortableServer.Servant;
+import jp.go.aist.rtm.RTC.Manager;
+
+public class ManagerServantUtil {
+ public static void createManagerCORBAServant(Manager mgr,Servant servant) throws Exception {
+
+ mgr.getPOA().activate_object( servant );
+ com.sun.corba.se.impl.orb.ORBImpl orb
+ = (com.sun.corba.se.impl.orb.ORBImpl)mgr.getORB();
+ orb.register_initial_reference(
+ "manager", mgr.getPOA().servant_to_reference(servant) );
+ }
+}
+
Deleted: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ORBUtil.java
===================================================================
--- branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ORBUtil.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ORBUtil.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -1,87 +0,0 @@
-package jp.go.aist.rtm.RTC.util;
-
-import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.omg.CORBA.ORB;
-
-/**
- * {@.ja ORBオブジェクトを生成、管理するクラス}
- * {@.en Class that generates, and manages ORB object}
- */
-public class ORBUtil {
-
- private static ORB orb = null;
-
- /**
- * {@.ja ORBオブジェクトを取得する}
- * {@.en Gets ORB object}
- *
- * @return
- * {@.ja ORBオブジェクト}
- * {@.en ORB object}
- */
- public static ORB getOrb() {
- return getOrb(null);
- }
-
- /**
- * {@.ja 管理しているORBオブジェクトをクリアする}
- * {@.en Clears the managed ORB object}
- *
- */
- public static void clearOrb() {
- orb = null;
- }
-
- /**
- * {@.ja ORBオブジェクトを取得する}
- * {@.en Gets ORB object}
- *
- * @param args
- * {@.ja アプリケーションの main メソッドのコマンド行引数}
- * {@.en command-line arguments for the application's main method}
- *
- * @return
- * {@.ja ORBオブジェクト}
- * {@.en ORB object}
- */
- public static ORB getOrb(String[] args) {
- return getOrb(args, null);
- }
- /**
- * {@.ja 指定された引数に基づいてORBオブジェクトを生成後、取得する}
- * {@.en Generates the ORB object based on the specified argument,
- * and gets it. }
- * <p>
- * {@.ja すでにORBオブジェクトが生成済みの場合は、それが取得される}
- * {@.en When the ORB object is generated, it is returned}
- *
- * @param args
- * {@.ja ORBオブジェクト生成時の引数}
- * {@.en Argument for ORB object generation}
- * @return
- * {@.ja ORBオブジェクト}
- * {@.en ORB object}
- */
- public static ORB getOrb(String[] args, Properties prop) {
-
- if (orb == null) {
- orb = ORB.init(args, prop);
- try {
- if (orb instanceof com.sun.corba.se.spi.orb.ORB) {
- Logger logger = ((com.sun.corba.se.spi.orb.ORB) orb).getLogger("");
- logger.setLevel(Level.SEVERE); // log
- }
- } catch (Exception e) {
- e.printStackTrace(); // system error
-
- } catch (NoClassDefFoundError e) {
- e.printStackTrace(); // system error
- }
- }
-
- return orb;
- }
-}
Copied: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ORBUtil.java (from rev 603, branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ORBUtil.java)
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ORBUtil.java (rev 0)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/ForSunOrb/RTC/util/ORBUtil.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -0,0 +1,87 @@
+package jp.go.aist.rtm.RTC.util;
+
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.omg.CORBA.ORB;
+
+/**
+ * {@.ja ORBオブジェクトを生成、管理するクラス}
+ * {@.en Class that generates, and manages ORB object}
+ */
+public class ORBUtil {
+
+ private static ORB orb = null;
+
+ /**
+ * {@.ja ORBオブジェクトを取得する}
+ * {@.en Gets ORB object}
+ *
+ * @return
+ * {@.ja ORBオブジェクト}
+ * {@.en ORB object}
+ */
+ public static ORB getOrb() {
+ return getOrb(null);
+ }
+
+ /**
+ * {@.ja 管理しているORBオブジェクトをクリアする}
+ * {@.en Clears the managed ORB object}
+ *
+ */
+ public static void clearOrb() {
+ orb = null;
+ }
+
+ /**
+ * {@.ja ORBオブジェクトを取得する}
+ * {@.en Gets ORB object}
+ *
+ * @param args
+ * {@.ja アプリケーションの main メソッドのコマンド行引数}
+ * {@.en command-line arguments for the application's main method}
+ *
+ * @return
+ * {@.ja ORBオブジェクト}
+ * {@.en ORB object}
+ */
+ public static ORB getOrb(String[] args) {
+ return getOrb(args, null);
+ }
+ /**
+ * {@.ja 指定された引数に基づいてORBオブジェクトを生成後、取得する}
+ * {@.en Generates the ORB object based on the specified argument,
+ * and gets it. }
+ * <p>
+ * {@.ja すでにORBオブジェクトが生成済みの場合は、それが取得される}
+ * {@.en When the ORB object is generated, it is returned}
+ *
+ * @param args
+ * {@.ja ORBオブジェクト生成時の引数}
+ * {@.en Argument for ORB object generation}
+ * @return
+ * {@.ja ORBオブジェクト}
+ * {@.en ORB object}
+ */
+ public static ORB getOrb(String[] args, Properties prop) {
+
+ if (orb == null) {
+ orb = ORB.init(args, prop);
+ try {
+ if (orb instanceof com.sun.corba.se.spi.orb.ORB) {
+ Logger logger = ((com.sun.corba.se.spi.orb.ORB) orb).getLogger("");
+ logger.setLevel(Level.SEVERE); // log
+ }
+ } catch (Exception e) {
+ e.printStackTrace(); // system error
+
+ } catch (NoClassDefFoundError e) {
+ e.printStackTrace(); // system error
+ }
+ }
+
+ return orb;
+ }
+}
Copied: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/Constants.java (from rev 603, branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/Constants.java)
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/Constants.java (rev 0)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/Constants.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -0,0 +1,34 @@
+package jp.go.aist.rtm;
+
+/**
+ * {@.ja sun-orb 用の定数}
+ * {@.en Constants for sun-orb}
+ */
+public interface Constants {
+
+ public static final String SERVER_HOST = "com.sun.CORBA.ORBServerHost";
+ public static final String SERVER_PORT = "com.sun.CORBA.ORBServerPort";
+ public static final String LISTENER_PORT = "com.sun.CORBA.POA.ORBPersistentServerPort";
+
+ /**
+ * {@.ja Managerのデフォルト・コンフィグレーションのファイル・パス}
+ * {@.en The default configuration file path for manager}
+ */
+ public static final String[] CONFIG_FILE_PATH = {
+ "./rtc.conf",
+ "/etc/rtc.conf",
+ "/etc/rtc/rtc.conf",
+ "/usr/local/etc/rtc.conf",
+ "/usr/local/etc/rtc/rtc.conf",
+ null
+ };
+ /**
+ * {@.ja 対応してるエンディアン}
+ * {@.en supported endian}
+ */
+ public static final String[] SUPPORTED_CDR_ENDIAN = {
+ "little",
+ "big",
+ null
+ };
+}
Modified: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/IopIorInterceptor.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/IopIorInterceptor.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/IopIorInterceptor.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -14,15 +14,6 @@
import org.omg.IOP.TaggedComponent;
import org.omg.PortableInterceptor.IORInterceptor;
-/*
-//<+JacORB
-import org.jacorb.orb.etf.ProtocolAddressBase;
-import org.jacorb.orb.iiop.IIOPAddress;
-import org.jacorb.orb.iiop.IIOPProfile;
-import java.util.List;
-import java.util.Iterator;
-//+>
-*/
/**
* {@.ja ポータブルインターセプタを利用してIORを書き換える.}
@@ -115,27 +106,6 @@
short port = (short)ptemp.getPrimaryAddress().getPort();
//+>
-/*
- //<+ JacORB
- ProtocolAddressBase address = null;
- org.jacorb.orb.ORB jacorb = (org.jacorb.orb.ORB)orb;
- if (jacorb.getBasicAdapter() == null) {
- return;
- }
- List eplist = jacorb.getBasicAdapter().getEndpointProfiles();
- for (Iterator i = eplist.iterator(); i.hasNext(); ) {
- org.omg.ETF.Profile p = (org.omg.ETF.Profile)i.next();
- if (p instanceof IIOPProfile) {
- address = ((IIOPProfile)p).getAddress();
- break;
- }
- }
- if (address == null) {
- return;
- }
- short port = (short)((IIOPAddress)address).getPort();
- //+>
-*/
for(int ic=0;ic<m_endpoints.size();ic++){
if(m_endpoints.get(ic).Port==0){
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 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -10,6 +10,7 @@
import java.util.logging.FileHandler;
import java.util.logging.ConsoleHandler;
+import jp.go.aist.rtm.Constants;
import jp.go.aist.rtm.RTC.executionContext.ECFactoryBase;
import jp.go.aist.rtm.RTC.executionContext.ECFactoryJava;
import jp.go.aist.rtm.RTC.executionContext.ExecutionContextBase;
@@ -2182,12 +2183,12 @@
if(endpoint != null && (endpoint.indexOf(":")>=0)) {
String[] endPointInfo = endpoint.split(":");
if( !endPointInfo[0].equals("") ) {
- result.put(SERVER_HOST, endPointInfo[0]);
+ result.put(Constants.SERVER_HOST, endPointInfo[0]);
}
if( endPointInfo.length>1 ) {
try {
short port = (short)Integer.parseInt(endPointInfo[1]);
- result.put(SERVER_PORT, endPointInfo[1]);
+ result.put(Constants.SERVER_PORT, endPointInfo[1]);
}
catch(Exception ex){
rtcout.println(Logbuf.WARN, ""+endPointInfo[1]);
@@ -2216,7 +2217,7 @@
"localhost:2810");
String portNumber[] = mm.split(":");
- result.put(LISTENER_PORT,
+ result.put(Constants.LISTENER_PORT,
portNumber[1]);
}
@@ -2271,7 +2272,7 @@
String[] endPoints = endpoints.split(",");
int loopstart = 0;
for(int ic=loopstart;ic<endPoints.length;++ic) {
- if(result.getProperty(SERVER_HOST)==null){
+ if(result.getProperty(Constants.SERVER_HOST)==null){
parsesCorbaEndpoint(endPoints[ic], result);
}
else{
@@ -2283,7 +2284,7 @@
}
else{
- if(result.getProperty(SERVER_HOST)==null){
+ if(result.getProperty(Constants.SERVER_HOST)==null){
parsesCorbaEndpoint(endpoints, result);
}
else {
@@ -3472,9 +3473,9 @@
*/
Finalized m_finalized = new Finalized();
- private static final String SERVER_HOST = "com.sun.CORBA.ORBServerHost";
- private static final String SERVER_PORT = "com.sun.CORBA.ORBServerPort";
- private static final String LISTENER_PORT = "com.sun.CORBA.POA.ORBPersistentServerPort";
+ //private static final String SERVER_HOST = "com.sun.CORBA.ORBServerHost";
+ //private static final String SERVER_PORT = "com.sun.CORBA.ORBServerPort";
+ //private static final String LISTENER_PORT = "com.sun.CORBA.POA.ORBPersistentServerPort";
//private static final String SERVER_HOST = "OAIAddr";
//private static final String SERVER_PORT = "OAPort";
//private static final String LISTENER_PORT = "OAPort";
Modified: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerConfig.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerConfig.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerConfig.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -8,6 +8,7 @@
import java.net.InetAddress;
import java.util.Random;
+import jp.go.aist.rtm.Constants;
import jp.go.aist.rtm.RTC.util.Properties;
import org.apache.commons.cli.BasicParser;
@@ -63,6 +64,7 @@
* {@.ja Managerのデフォルト・コンフィグレーションのファイル・パス}
* {@.en The default configuration file path for manager}
*/
+/*
public static final String[] CONFIG_FILE_PATH = {
"./rtc.conf",
"/etc/rtc.conf",
@@ -71,7 +73,7 @@
"/usr/local/etc/rtc/rtc.conf",
null
};
-
+*/
/**
* {@.ja デフォルト・コンフィグレーションのファイル・パスを識別する
* 環境変数です。}
@@ -335,9 +337,9 @@
}
// Search rtc configuration file from default search path
- for (int i = 0; CONFIG_FILE_PATH[i] != null; i++) {
- if (fileExist(CONFIG_FILE_PATH[i])) {
- m_configFile = CONFIG_FILE_PATH[i];
+ for (int i = 0; Constants.CONFIG_FILE_PATH[i] != null; i++) {
+ if (fileExist(Constants.CONFIG_FILE_PATH[i])) {
+ m_configFile = Constants.CONFIG_FILE_PATH[i];
return true;
}
}
Modified: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -12,6 +12,7 @@
import jp.go.aist.rtm.RTC.util.Properties;
import jp.go.aist.rtm.RTC.util.StringUtil;
import jp.go.aist.rtm.RTC.util.equalFunctor;
+import jp.go.aist.rtm.RTC.util.ManagerServantUtil;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Object;
@@ -1214,6 +1215,8 @@
*
*/
private void createManagerCORBAServant() throws Exception {
+ ManagerServantUtil.createManagerCORBAServant(m_mgr,this);
+/*
m_mgr.getPOA().activate_object( this );
com.sun.corba.se.impl.orb.ORBImpl orb
= (com.sun.corba.se.impl.orb.ORBImpl)m_mgr.getORB();
@@ -1221,6 +1224,7 @@
// = (org.jacorb.orb.ORB)m_mgr.getORB();
orb.register_initial_reference(
"manager", m_mgr.getPOA().servant_to_reference(this) );
+*/
}
/**
* <p></p>
Modified: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortBase.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortBase.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortBase.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -5,6 +5,7 @@
import java.util.Set;
import java.util.Vector;
+import jp.go.aist.rtm.Constants;
import jp.go.aist.rtm.RTC.BufferFactory;
import jp.go.aist.rtm.RTC.InPortProviderFactory;
import jp.go.aist.rtm.RTC.OutPortConsumerFactory;
@@ -498,9 +499,24 @@
int index =
NVUtil.find_index(nvholder,"dataport.serializer.cdr.endian");
if(index<0){
+ String endian_str = new String();
+ if(Constants.SUPPORTED_CDR_ENDIAN.length==0){
+ endian_str = "";
+ }
+ else {
+ int ic;
+ for(ic=0;ic<Constants.SUPPORTED_CDR_ENDIAN.length-1;++ic){
+ endian_str = endian_str + Constants.SUPPORTED_CDR_ENDIAN[ic] + ", ";
+ }
+ endian_str = endian_str + Constants.SUPPORTED_CDR_ENDIAN[ic];
+ }
+
+// CORBA_SeqUtil.push_back(nvholder,
+// NVUtil.newNVString("dataport.serializer.cdr.endian",
+// "little,big"));
CORBA_SeqUtil.push_back(nvholder,
NVUtil.newNVString("dataport.serializer.cdr.endian",
- "little,big"));
+ endian_str));
connector_profile.value.properties = nvholder.value;
}
}
@@ -580,6 +596,17 @@
endian_type = "";
for(int ic=0;ic<endian.length;++ic){
String str = endian[ic].trim();
+ for(int icc=0;icc<Constants.SUPPORTED_CDR_ENDIAN.length;++icc){
+ if(str.equals(Constants.SUPPORTED_CDR_ENDIAN[icc])){
+ if(endian_type.length()!=0){
+ endian_type = endian_type + ","+ str;
+ }
+ else{
+ endian_type = endian_type + str;
+ }
+ }
+ }
+/*
if(str.equals("big") || str.equals("little")){
if(endian_type.length()!=0){
endian_type = endian_type + ","+ str;
@@ -588,6 +615,7 @@
endian_type = endian_type + str;
}
}
+*/
}
int index = NVUtil.find_index(holder, "dataport.serializer.cdr.endian");
holder.value[index].value.insert_string(endian_type);
Modified: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortBase.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortBase.java 2011-12-21 06:47:15 UTC (rev 603)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortBase.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -7,6 +7,7 @@
import java.util.Set;
import java.util.Vector;
+import jp.go.aist.rtm.Constants;
import jp.go.aist.rtm.RTC.InPortConsumerFactory;
import jp.go.aist.rtm.RTC.OutPortProviderFactory;
import jp.go.aist.rtm.RTC.PublisherBaseFactory;
@@ -492,9 +493,24 @@
int index =
NVUtil.find_index(nvholder,"dataport.serializer.cdr.endian");
if(index<0){
+ String endian_str = new String();
+ if(Constants.SUPPORTED_CDR_ENDIAN.length==0){
+ endian_str = "";
+ }
+ else {
+ int ic;
+ for(ic=0;ic<Constants.SUPPORTED_CDR_ENDIAN.length-1;++ic){
+ endian_str = endian_str + Constants.SUPPORTED_CDR_ENDIAN[ic] + ", ";
+ }
+ endian_str = endian_str + Constants.SUPPORTED_CDR_ENDIAN[ic];
+ }
+
+// CORBA_SeqUtil.push_back(nvholder,
+// NVUtil.newNVString("dataport.serializer.cdr.endian",
+// "little,big"));
CORBA_SeqUtil.push_back(nvholder,
NVUtil.newNVString("dataport.serializer.cdr.endian",
- "little,big"));
+ endian_str));
connector_profile.value.properties = nvholder.value;
}
}
@@ -586,6 +602,17 @@
endian_type = "";
for(int ic=0;ic<endian.length;++ic){
String str = endian[ic].trim();
+ for(int icc=0;icc<Constants.SUPPORTED_CDR_ENDIAN.length;++icc){
+ if(str.equals(Constants.SUPPORTED_CDR_ENDIAN[icc])){
+ if(endian_type.length()!=0){
+ endian_type = endian_type + ","+ str;
+ }
+ else{
+ endian_type = endian_type + str;
+ }
+ }
+ }
+/*
if(str.equals("big") || str.equals("little")){
if(endian_type.length()!=0){
endian_type = endian_type + ","+ str;
@@ -594,6 +621,7 @@
endian_type = endian_type + str;
}
}
+*/
}
int index = NVUtil.find_index(holder, "dataport.serializer.cdr.endian");
holder.value[index].value.insert_string(endian_type);
Copied: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/ManagerServantUtil.java (from rev 603, branches/work/SourceSharing/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/ManagerServantUtil.java)
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/ManagerServantUtil.java (rev 0)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/ManagerServantUtil.java 2011-12-21 08:23:23 UTC (rev 604)
@@ -0,0 +1,16 @@
+package jp.go.aist.rtm.RTC.util;
+
+import org.omg.PortableServer.Servant;
+import jp.go.aist.rtm.RTC.Manager;
+
+public class ManagerServantUtil {
+ public static void createManagerCORBAServant(Manager mgr,Servant servant) throws Exception {
+
+ mgr.getPOA().activate_object( servant );
+ com.sun.corba.se.impl.orb.ORBImpl orb
+ = (com.sun.corba.se.impl.orb.ORBImpl)mgr.getORB();
+ orb.register_initial_reference(
+ "manager", mgr.getPOA().servant_to_reference(servant) );
+ }
+}
+
openrtm-commit メーリングリストの案内