[openrtm-commit:02006] r827 - trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC
openrtm @ openrtm.org
openrtm @ openrtm.org
2016年 10月 4日 (火) 21:25:49 JST
Author: win-ei
Date: 2016-10-04 21:25:48 +0900 (Tue, 04 Oct 2016)
New Revision: 827
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java
Log:
Fiexd bugs. refs #3389
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java 2016-10-04 07:28:31 UTC (rev 826)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java 2016-10-04 12:25:48 UTC (rev 827)
@@ -51,17 +51,14 @@
* {@.en Constructor}
*/
public ManagerServant() {
-System.out.println("d00 ");
rtcout = new Logbuf("ManagerServant");
m_mgr = jp.go.aist.rtm.RTC.Manager.instance();
Properties config = m_mgr.getConfig();
-System.out.println("d20 "+"manager.is_master:"+config.getProperty("manager.is_master"));
if (StringUtil.toBool(config.getProperty("manager.is_master"),
"YES", "NO", true)) {
// this is master manager
-System.out.println("d30 "+"This manager is master.");
rtcout.println(Logbuf.TRACE, "This manager is master.");
try{
@@ -95,7 +92,6 @@
return;
}
else { // manager is slave
-System.out.println("d80 "+"This manager is slave.");
rtcout.println(Logbuf.TRACE, "This manager is slave.");
try {
RTM.Manager owner;
@@ -158,7 +154,6 @@
* {@.en RTM.Manager object.}
*/
public RTM.Manager _this() {
-System.out.println("_this()");
if (this.m_objref == null) {
try {
this.m_objref = ManagerHelper.narrow(POAUtil.getRef(this));
@@ -178,12 +173,10 @@
*/
public boolean createINSManager() {
-System.out.println("createINSManager()");
rtcout.println(Logbuf.DEBUG, "createINSManager()");
try{
//
-System.out.println("gets object.");
rtcout.println(Logbuf.DEBUG, "gets object.");
org.omg.CORBA.Object obj
= m_mgr.getORB().resolve_initial_references("manager");
@@ -205,7 +198,6 @@
catch(Exception ex){
rtcout.println(Logbuf.WARN,
"Manager CORBA servant creation failed."+ex);
-System.out.println("Manager CORBA servant creation failed.");
return false;
}
@@ -324,7 +316,6 @@
*
*/
public RTM.ModuleProfile[] get_loadable_modules() {
-System.out.println("600 ");
rtcout.println(Logbuf.TRACE, "get_loadable_modules()");
// copy local module profiles
Vector<Properties> prof = m_mgr.getLoadableModules();
@@ -347,7 +338,6 @@
for (int i=0, len=m_slaves.length; i < len; ++i) {
try {
if (m_slaves[i] != null) {
-System.out.println("630 ");
RTM.ModuleProfile[] sprof;
sprof = m_slaves[i].get_loadable_modules();
@@ -363,7 +353,6 @@
catch(Exception ex) {
rtcout.println(Logbuf.INFO,
"slave ("+i+") has disappeared.");
-System.out.println("660 " + "slave ("+i+") has disappeared.");
m_slaves[i] = (RTM.Manager)null;
}
RTM.ManagerListHolder holder
@@ -414,7 +403,6 @@
*
*/
public RTM.ModuleProfile[] get_loaded_modules() {
-System.out.println("700");
rtcout.println(Logbuf.TRACE, "get_loaded_modules()");
// copy local module profiles
@@ -441,7 +429,6 @@
for (int i=0, len= m_slaves.length; i < len; ++i) {
try {
if (m_slaves[i]!=null) {
-System.out.println("730 ");
RTM.ModuleProfile[] sprof;
sprof = m_slaves[i].get_loaded_modules();
RTM.ModuleProfileListHolder holder
@@ -453,7 +440,6 @@
catch(Exception ex) {
rtcout.println(Logbuf.INFO,
"slave ("+i+") has disappeared.");
-System.out.println("760 " + "slave ("+i+") has disappeared.");
m_slaves[i] = (RTM.Manager)null;
}
RTM.ManagerListHolder holder
@@ -502,7 +488,6 @@
* {@.en An RT-Component factory profile list.}
*/
public RTM.ModuleProfile[] get_factory_profiles() {
-System.out.println("800 ");
rtcout.println(Logbuf.TRACE, "get_factory_profiles()");
Vector<Properties> prof = m_mgr.getFactoryProfiles();
@@ -525,7 +510,6 @@
for (int i=0, len=m_slaves.length; i < len; ++i) {
try {
if (m_slaves[i]!=null) {
-System.out.println("830 ");
RTM.ModuleProfile[] sprof;
sprof = m_slaves[i].get_factory_profiles();
RTM.ModuleProfileListHolder holder1
@@ -540,7 +524,6 @@
catch(Exception ex) {
rtcout.println(Logbuf.INFO,
"slave ("+i+") has disappeared.");
-System.out.println("860 " + "slave ("+i+") has disappeared.");
m_slaves[i] = (RTM.Manager)null;
}
RTM.ManagerListHolder holder
@@ -663,7 +646,6 @@
*
*/
public RTC.RTObject[] get_components() {
-System.out.println("900 ");
rtcout.println(Logbuf.TRACE, "get_component()");
Vector<RTObject_impl> rtcs = m_mgr.getComponents();
@@ -679,7 +661,6 @@
for (int i=0, len=m_slaves.length; i < len; ++i) {
try {
if (m_slaves[i]!=null) {
-System.out.println("920 ");
RTC.RTObject[] srtcs;
srtcs = m_slaves[i].get_components();
RTC.RTCListHolder holder
@@ -691,7 +672,6 @@
catch(Exception ex) {
rtcout.println(Logbuf.INFO,
"slave ("+i+") has disappeared.");
-System.out.println("960 " + "slave ("+i+") has disappeared.");
m_slaves[i] = (RTM.Manager)null;
}
RTM.ManagerListHolder holder
@@ -719,7 +699,6 @@
*
*/
public RTC.ComponentProfile[] get_component_profiles() {
-System.out.println("a00 ");
rtcout.println(Logbuf.TRACE, "get_component_profiles()");
ComponentProfileListHolder cprofs = new ComponentProfileListHolder();
@@ -737,7 +716,6 @@
try {
if (m_slaves[i]!=null) {
-System.out.println("a20 ");
RTC.ComponentProfile[] sprof;
sprof = m_slaves[i].get_component_profiles();
@@ -750,7 +728,6 @@
catch(Exception ex) {
rtcout.println(Logbuf.INFO,
"slave ("+i+") has disappeared.");
-System.out.println("a60 " + "slave ("+i+") has disappeared.");
m_slaves[i] = (RTM.Manager)null;
}
RTM.ManagerListHolder holder
@@ -899,7 +876,6 @@
*
*/
public ReturnCode_t add_master_manager(RTM.Manager mgr) {
-System.out.println("c00 ");
synchronized(m_masterMutex) {
long index;
rtcout.println(Logbuf.TRACE,
@@ -978,12 +954,9 @@
*
*/
public RTM.Manager[] get_slave_managers() {
-System.out.println("510 ");
synchronized(m_masterMutex) {
rtcout.println(Logbuf.TRACE,
"get_slave_managers(), "+m_slaves.length+" slaves");
-System.out.println("520 "+ "get_slave_managers(), "+m_slaves.length+" slaves");
-System.out.println("522 "+ Arrays.toString(m_slaves));
RTM.ManagerListHolder holder = new RTM.ManagerListHolder(m_slaves);
return holder.value;
@@ -1006,7 +979,6 @@
* {@.en ReturnCode_t}
*/
public ReturnCode_t add_slave_manager(RTM.Manager mgr) {
-System.out.println("b00 ");
synchronized(m_masterMutex) {
rtcout.println(Logbuf.TRACE,
"add_slave_manager(), "+m_slaves.length+" slaves");
@@ -1044,27 +1016,20 @@
* {@.en ReturnCode_t}
*/
public ReturnCode_t remove_slave_manager(RTM.Manager mgr) {
-System.out.println("300 ");
if(mgr == null){
-System.out.println("302 "+"mgr is null");
}
synchronized(m_masterMutex) {
-System.out.println("310 "+"remove_slave_manager(), "+m_slaves.length+" slaves");
rtcout.println(Logbuf.TRACE,
"remove_slave_manager(), "+m_slaves.length+" slaves");
long index;
RTM.ManagerListHolder holder = new RTM.ManagerListHolder(m_slaves);
-System.out.println("320 ");
index = CORBA_SeqUtil.find(holder, new is_equiv(mgr));
-System.out.println("330 "+"index:"+index);
if (index < 0) {// not found in my list
-System.out.println("340 ");
rtcout.println(Logbuf.ERROR, "Not found.");
return ReturnCode_t.BAD_PARAMETER;
}
-System.out.println("350 ");
CORBA_SeqUtil.erase(holder, (int)index);
m_slaves = holder.value;
rtcout.println(Logbuf.TRACE,
@@ -1173,17 +1138,13 @@
* {@.en Manager reference}
*/
public RTM.Manager getObjRef() {
-System.out.println("getObjRef()");
-System.out.println("getObjRef()"+" m_objref:"+m_objref);
if (m_objref == null) {
try {
-System.out.println("getObjRef()"+" this:"+this);
m_objref = ManagerHelper.narrow(POAUtil.getRef(this));
} catch (Exception e) {
throw new IllegalStateException(e);
}
}
-System.out.println("getObjRef()"+"m_objref:"+m_objref);
return (RTM.Manager)m_objref;
}
@@ -1227,20 +1188,15 @@
*
*/
public RTObject[] get_components_by_name(String name){
-System.out.println("200 "+"name:"+name);
rtcout.println(Logbuf.TRACE, "get_components_by_name()");
Vector<RTObject_impl> rtcs = m_mgr.getComponents();
-System.out.println("210 ");
ArrayList<RTObject> crtcs = new ArrayList<RTObject>();
-System.out.println("220 ");
- name.trim();
+ name = name.trim();
String[] rtc_name = name.split("/");
-System.out.println("230 "+"rtc_name:"+Arrays.toString(rtc_name));
Iterator<RTObject_impl> iterator = rtcs.iterator();
while (iterator.hasNext()) {
RTObject_impl rtc = iterator.next();
if(rtc_name.length == 1){
-System.out.println("240 "+"rtc.getInstanceName():"+rtc.getInstanceName());
if(rtc.getInstanceName().equals(rtc_name[0])){
crtcs.add(rtc.getObjRef());
}
@@ -1677,15 +1633,10 @@
private class is_equiv implements equalFunctor {
private RTM.Manager m_mgr;
public is_equiv(RTM.Manager mgr) {
-System.out.println("410 ");
if(mgr == null){
-System.out.println("420 "+"mgr is null");
}
-System.out.println("430 ");
m_mgr = (RTM.Manager)mgr;
-System.out.println("440 ");
m_mgr = (RTM.Manager)mgr._duplicate();
-System.out.println("450 ");
}
/*
public boolean operator(RTM.Manager mgr) {
@@ -1693,13 +1644,9 @@
}
*/
public boolean equalof(final java.lang.Object object) {
-System.out.println("460 ");
if(object == null){
-System.out.println("463 "+"object is null");
}
-System.out.println("465 ");
boolean ret = m_mgr._is_equivalent((RTM.Manager)object);
-System.out.println("470 ");
return ret;
}
}
More information about the openrtm-commit
mailing list