[openrtm-commit:02794] r1033 - in trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC: . port
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 9月 1日 (金) 17:42:38 JST
Author: t-katami
Date: 2017-09-01 17:42:38 +0900 (Fri, 01 Sep 2017)
New Revision: 1033
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ComponentObserverConsumer.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/LoggerConsumer.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/CorbaConsumer.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrConsumer.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMConsumer.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrConsumer.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortSHMConsumer.java
Log:
[compat,bugfix,->releng_1_2] Fiexd bugs. refs #3393
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ComponentObserverConsumer.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ComponentObserverConsumer.java 2017-08-31 05:33:37 UTC (rev 1032)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ComponentObserverConsumer.java 2017-09-01 08:42:38 UTC (rev 1033)
@@ -84,7 +84,7 @@
* {@.en Re-initialization}
*/
public boolean reinit(final _SDOPackage.ServiceProfile profile){
- if (!m_observer._ptr()._is_equivalent(profile.service)) {
+ if (!m_observer._ptr(true)._is_equivalent(profile.service)) {
CorbaConsumer<ComponentObserver> tmp = new CorbaConsumer<ComponentObserver>();
if (!tmp.setObject(profile.service)) {
return false;
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/LoggerConsumer.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/LoggerConsumer.java 2017-08-31 05:33:37 UTC (rev 1032)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/LoggerConsumer.java 2017-09-01 08:42:38 UTC (rev 1033)
@@ -51,7 +51,7 @@
* {@.en Re-initialization}
*/
public boolean reinit(final _SDOPackage.ServiceProfile profile){
- if (!m_observer._ptr()._is_equivalent(profile.service)) {
+ if (!m_observer._ptr(true)._is_equivalent(profile.service)) {
CorbaConsumer<Logger> tmp = new CorbaConsumer<Logger>();
if (!tmp.setObject(profile.service)) {
return false;
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/CorbaConsumer.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/CorbaConsumer.java 2017-08-31 05:33:37 UTC (rev 1032)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/CorbaConsumer.java 2017-09-01 08:42:38 UTC (rev 1033)
@@ -2,8 +2,12 @@
import jp.go.aist.rtm.RTC.Manager;
import jp.go.aist.rtm.RTC.util.TypeCast;
+import jp.go.aist.rtm.RTC.util.ORBUtil;
import org.omg.CORBA.Object;
+import org.omg.CORBA.ORB;
import org.omg.PortableServer.POA;
+import org.omg.PortableServer.POAHelper;
+import org.omg.PortableServer.Servant;
/**
* <p>CORBAを通信手段とするコンシューマの実装クラスです。</p>
@@ -69,9 +73,47 @@
*/
public OBJECT_TYPE _ptr() {
+ if(this.m_sev != null){
+ return this.m_sev;
+ }
+ if(this.m_var != null){
+
+ try{
+ ORB orb = ORBUtil.getOrb();
+ Object obj = orb.resolve_initial_references("RootPOA");
+ POA poa = POAHelper.narrow(obj);
+ if (poa == null) {
+ return this.m_var;
+ }
+ m_sev = (OBJECT_TYPE)(poa.reference_to_servant((Object)m_var));
+
+ if(m_sev != null){
+ return this.m_sev;
+ }
+ }
+ catch(Exception ex){
+ return this.m_var;
+ }
+ }
return this.m_var;
}
+
+ /**
+ * <p>設定されているCORBAオブジェクトを取得します。</p>
+ *
+ * @param
+ * @return CORBAオブジェクト
+ */
+ public OBJECT_TYPE _ptr(boolean ref) {
+
+ if(ref) {
+ return this.m_var;
+ }
+
+ return this._ptr();
+
+ }
/**
* <p>CORBAオブジェクトの設定をクリアします。<br />
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrConsumer.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrConsumer.java 2017-08-31 05:33:37 UTC (rev 1032)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrConsumer.java 2017-09-01 08:42:38 UTC (rev 1033)
@@ -114,10 +114,12 @@
output_stream.write_octet_array(ch,0,ch.length);
try {
- OpenRTM.PortStatus ret = _ptr().put(output_stream.getByteArray());
+ OpenRTM.PortStatus ret = ((OpenRTM.InPortCdrOperations)_ptr()).put(output_stream.getByteArray());
return convertReturn(ret);
}
catch (Exception e) {
+ String crlf = System.getProperty("line.separator");
+ rtcout.println(Logbuf.PARANOID, "Exception"+crlf+e.toString());
return ReturnCode.CONNECTION_LOST;
}
}
@@ -337,7 +339,7 @@
ORB orb = ORBUtil.getOrb();
org.omg.CORBA.Object var = orb.string_to_object(ior);
- if (!(_ptr()._is_equivalent(var))) {
+ if (!(_ptr(true)._is_equivalent(var))) {
rtcout.println(Logbuf.ERROR, "connector property inconsistency");
return false;
}
@@ -375,7 +377,7 @@
return false;
}
- if (!(_ptr()._is_equivalent(obj))) {
+ if (!(_ptr(true)._is_equivalent(obj))) {
rtcout.println(Logbuf.ERROR, "connector property inconsistency");
return false;
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMConsumer.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMConsumer.java 2017-08-31 05:33:37 UTC (rev 1032)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMConsumer.java 2017-09-01 08:42:38 UTC (rev 1033)
@@ -397,7 +397,7 @@
ORB orb = ORBUtil.getOrb();
org.omg.CORBA.Object var = orb.string_to_object(ior);
- if (!(_ptr()._is_equivalent(var))) {
+ if (!(_ptr(true)._is_equivalent(var))) {
rtcout.println(Logbuf.ERROR, "connector property inconsistency");
return false;
}
@@ -435,7 +435,7 @@
return false;
}
- if (!(_ptr()._is_equivalent(obj))) {
+ if (!(_ptr(true)._is_equivalent(obj))) {
rtcout.println(Logbuf.ERROR, "connector property inconsistency");
return false;
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrConsumer.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrConsumer.java 2017-08-31 05:33:37 UTC (rev 1032)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrConsumer.java 2017-09-01 08:42:38 UTC (rev 1033)
@@ -162,7 +162,7 @@
rtcout.println(Logbuf.TRACE, "OutPutCorbaCdrConsumer.get()");
OpenRTM.CdrDataHolder cdr_data = new OpenRTM.CdrDataHolder();
try {
- OpenRTM.PortStatus ret = _ptr().get(cdr_data);
+ OpenRTM.PortStatus ret = ((OpenRTM.OutPortCdrOperations)_ptr()).get(cdr_data);
if (ret == OpenRTM.PortStatus.PORT_OK) {
rtcout.println(Logbuf.DEBUG, "get() successful");
data.write_octet_array(cdr_data.value, 0,
@@ -312,7 +312,7 @@
"dataport.corba_cdr.outport_ior found.");
ORB orb = Manager.instance().getORB();
Object var = orb.string_to_object(ior);
- if (_ptr()._is_equivalent(var)) {
+ if (_ptr(true)._is_equivalent(var)) {
releaseObject();
rtcout.println(Logbuf.DEBUG,
"CorbaConsumer's reference was released.");
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortSHMConsumer.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortSHMConsumer.java 2017-08-31 05:33:37 UTC (rev 1032)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortSHMConsumer.java 2017-09-01 08:42:38 UTC (rev 1033)
@@ -360,7 +360,7 @@
"dataport.corba_cdr.outport_ior found.");
ORB orb = Manager.instance().getORB();
Object var = orb.string_to_object(ior);
- if (_ptr()._is_equivalent(var)) {
+ if (_ptr(true)._is_equivalent(var)) {
releaseObject();
rtcout.println(Logbuf.DEBUG,
"CorbaConsumer's reference was released.");
More information about the openrtm-commit
mailing list