[openrtm-commit:02038] r843 - in trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src: RTMExamples/SimpleIO jp/go/aist/rtm/RTC
openrtm @ openrtm.org
openrtm @ openrtm.org
2016年 10月 10日 (月) 15:18:01 JST
Author: win-ei
Date: 2016-10-10 15:18:01 +0900 (Mon, 10 Oct 2016)
New Revision: 843
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/SimpleIO/rtc.conf
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingManager.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingOnCorba.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingOnManager.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingServiceNumberingPolicy.java
Log:
Fixed bugs. refs #3397
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/SimpleIO/rtc.conf
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/SimpleIO/rtc.conf 2016-10-10 04:55:23 UTC (rev 842)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/SimpleIO/rtc.conf 2016-10-10 06:18:01 UTC (rev 843)
@@ -25,9 +25,9 @@
#manager.components.preconnect: ConsoleIn0.out^rtcname://localhost:2809/ConsoleOut0.in(dataflow_type=push&interface_type=corba_cdr)
#manager.components.preactivation:rtcname://localhost:2809/ConsoleOut0, ConsoleIn0
+#manager.components.naming_policy:node_unique
+#manager.components.naming_policy:ns_unique
-
-
example.ConsoleIn.config_file: ./RTMExamples/SimpleIO/component.conf
example.ConsoleOut.config_file: ./RTMExamples/SimpleIO/component.conf
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2016-10-10 04:55:23 UTC (rev 842)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2016-10-10 06:18:01 UTC (rev 843)
@@ -1557,7 +1557,8 @@
String policy_name
= m_config.getProperty("manager.components.naming_policy");
- if(!policy_name.isEmpty()){
+ //if(!policy_name.isEmpty()){
+ if(policy_name.isEmpty()){
policy_name = "process_unique";
}
final NumberingPolicyFactory<NumberingPolicy,String> np_factory
@@ -2222,6 +2223,18 @@
publishPorts(comp);
subscribePorts(comp);
+ try {
+ Object obj = m_pORB.resolve_initial_references("omniINSPOA");
+ POA poa = POAHelper.narrow(obj);
+ poa.the_POAManager().activate();
+ String id = comp.getCategory() + "/" + comp.getInstanceName();
+ byte[] oid = id.getBytes();
+ poa.activate_object_with_id(oid, comp);
+ }
+ catch(Exception ex){
+ rtcout.println(Logbuf.DEBUG,
+ "Exception caught."+ex.toString());
+ }
return true;
}
@@ -2258,6 +2271,18 @@
}
m_listeners.naming_.postUnbind(comp, names);
+ try {
+ Object obj = m_pORB.resolve_initial_references("omniINSPOA");
+ POA poa = POAHelper.narrow(obj);
+ poa.the_POAManager().activate();
+ String id = comp.getCategory() + "/" + comp.getInstanceName();
+ byte[] oid = id.getBytes();
+ poa.deactivate_object(oid);
+ }
+ catch(Exception ex){
+ rtcout.println(Logbuf.DEBUG,
+ "Exception caught."+ex.toString());
+ }
return true;
}
@@ -3045,6 +3070,7 @@
// Get the POAManager
m_pPOAManager = m_pPOA.the_POAManager();
//m_objManager = new CorbaObjectManager(m_pORB, m_pPOA);
+
} catch (Exception ex) {
rtcout.println(Logbuf.DEBUG,
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingManager.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingManager.java 2016-10-10 04:55:23 UTC (rev 842)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingManager.java 2016-10-10 06:18:01 UTC (rev 843)
@@ -30,7 +30,7 @@
public NamingManager(Manager manager) {
m_manager = manager;
- rtcout = new Logbuf("NamingManager");
+ rtcout = new Logbuf("manager.NamingManager");
}
/**
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingOnCorba.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingOnCorba.java 2016-10-10 04:55:23 UTC (rev 842)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingOnCorba.java 2016-10-10 06:18:01 UTC (rev 843)
@@ -59,7 +59,7 @@
e.printStackTrace();
}
- rtcout = new Logbuf("NamingOnCorba");
+ rtcout = new Logbuf("manager.NamingOnCorba");
}
@@ -270,22 +270,23 @@
* virtual RTCList string_to_component(string name) = 0;
*/
public RTObject[] string_to_component(String name){
+System.out.println("- 2016/10/10 0b400 - name="+name);
rtcout.println(Logbuf.PARANOID, "string_to_component("+name+")");
RTCListHolder rtc_list = new RTCListHolder();
String[] tmps = name.split("://");
if(tmps.length > 1){
- rtcout.println(Logbuf.PARANOID, "tmps[0]:"+tmps[0]);
+ rtcout.println(Logbuf.PARANOID, "tmps[0]="+tmps[0]);
if(tmps[0].equals("rtcname")){
String tag = tmps[0];
String url = tmps[1];
- rtcout.println(Logbuf.PARANOID, "tmps[1]:"+tmps[1]);
+ rtcout.println(Logbuf.PARANOID, "tmps[1]="+tmps[1]);
String[] elements = url.split("/");
if(elements.length > 1){
String host = elements[0];
- rtcout.println(Logbuf.PARANOID, "host:"+host);
+ rtcout.println(Logbuf.PARANOID, "host="+host);
String rtc_name = url.substring(host.length()+1);
- rtcout.println(Logbuf.PARANOID, "rtc_name:"+rtc_name);
+ rtcout.println(Logbuf.PARANOID, "rtc_name="+rtc_name);
try{
CorbaNaming cns;
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingOnManager.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingOnManager.java 2016-10-10 04:55:23 UTC (rev 842)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingOnManager.java 2016-10-10 06:18:01 UTC (rev 843)
@@ -278,42 +278,31 @@
*/
public RTObject[] string_to_component(String name){
rtcout.println(Logbuf.PARANOID, "string_to_component("+name+")");
-System.out.println("105 " + "name:"+name);
RTCListHolder rtc_list = new RTCListHolder();
String[] tmps = name.split("://");
-System.out.println("110 tmps.length:"+tmps.length);
if(tmps.length > 1){
rtcout.println(Logbuf.PARANOID, "tmps[0]:"+tmps[0]);
-System.out.println("120 "+"tmps[0]:"+tmps[0]);
if(tmps[0].equals("rtcloc")){
String tag = tmps[0];
String url = tmps[1];
rtcout.println(Logbuf.PARANOID, "tmps[1]:"+tmps[1]);
-System.out.println("130 "+"tmps[1]:"+tmps[1]);
String[] elements = url.split("/");
-System.out.println("140 "+"elements.length:"+elements.length);
if(elements.length > 1){
String host = elements[0];
rtcout.println(Logbuf.PARANOID, "host:"+host);
-System.out.println("150 "+"host:"+host);
String rtc_name = url.substring(host.length()+1);
rtcout.println(Logbuf.PARANOID, "rtc_name:"+rtc_name);
RTM.Manager mgr = getManager(host);
if(mgr!=null){
-System.out.println("160 ");
rtc_list.value =
mgr.get_components_by_name(rtc_name);
-System.out.println("170 ");
RTM.Manager[] slaves = mgr.get_slave_managers();
-System.out.println("180 "+ "slaves.length:"+slaves.length);
for(int ic=0;ic<slaves.length;++ic){
try{
-System.out.println("190 ");
if(slaves[ic] == null){
-System.out.println("192 "+"slaves[ic] is null");
}
//RTCListHolder rtobjects = new RTCListHolder();
if(slaves[ic] != null){
@@ -325,29 +314,23 @@
rtc_list.value, rtc_list.value.length,
rtobjects.length);
}
-System.out.println("1a0 ");
// rtc_list.extend(
// slaves[ic].get_components_by_name(rtc_name));
}
catch (Exception ex) {
-System.out.println("1c0 ");
rtcout.println(Logbuf.DEBUG, ex.toString());
if(slaves[ic] == null){
-System.out.println("1c2 "+"slaves[ic] is null");
}
mgr.remove_slave_manager(slaves[ic]);
-System.out.println("1d0 ");
}
}
}
-System.out.println("1E0 ");
return rtc_list.value;
}
}
}
-System.out.println("1F0 ");
return rtc_list.value;
}
/**
@@ -363,6 +346,7 @@
* virtual Manager_ptr getManager(string name);
*/
public RTM.Manager getManager(String name){
+ rtcout.println(Logbuf.DEBUG, "getManager("+name+")");
RTM.Manager mgr;
if(name.equals("*")){
ManagerServant mgr_sev = m_mgr.getManagerServant();
@@ -372,6 +356,8 @@
else{
RTM.Manager[] masters = mgr_sev.get_master_managers();
if(masters.length >0){
+ if(masters[0] == null) {
+ }
mgr = masters[0];
}
else{
@@ -388,9 +374,9 @@
mgrloc += "/" + manager_name;
Object mobj = m_orb.string_to_object(mgrloc);
+ rtcout.println(Logbuf.DEBUG, "mobj= "+mobj);
mgr = RTM.ManagerHelper.narrow(mobj);
-
- rtcout.println(Logbuf.DEBUG, "corbaloc: "+mgrloc);
+ rtcout.println(Logbuf.DEBUG, "mgr= "+mgr);
return mgr;
}
catch (Exception ex) {
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingServiceNumberingPolicy.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingServiceNumberingPolicy.java 2016-10-10 04:55:23 UTC (rev 842)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingServiceNumberingPolicy.java 2016-10-10 06:18:01 UTC (rev 843)
@@ -91,8 +91,7 @@
*
*/
protected boolean find(String name) {
- //String rtc_name = "rtcloc://*/*/";
- String rtc_name = "rtcname://*/*/";
+ String rtc_name = "rtcname://*/";
rtc_name = rtc_name + name;
RTObject[] rtcs = m_mgr.getNaming().string_to_component(rtc_name);
More information about the openrtm-commit
mailing list