From: <ju...@us...> - 2007-03-14 17:49:21
|
Revision: 3982 http://svn.sourceforge.net/smartfrog/?rev=3982&view=rev Author: julgui Date: 2007-03-14 10:49:20 -0700 (Wed, 14 Mar 2007) Log Message: ----------- fixed problems when using sfAttributeKeyFor in PrimImpl.java and ComponentDescriptionImpl.java Modified Paths: -------------- trunk/core/smartfrog/src/org/smartfrog/sfcore/componentdescription/ComponentDescriptionImpl.java trunk/core/smartfrog/src/org/smartfrog/sfcore/prim/PrimImpl.java Modified: trunk/core/smartfrog/src/org/smartfrog/sfcore/componentdescription/ComponentDescriptionImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/sfcore/componentdescription/ComponentDescriptionImpl.java 2007-03-14 11:02:32 UTC (rev 3981) +++ trunk/core/smartfrog/src/org/smartfrog/sfcore/componentdescription/ComponentDescriptionImpl.java 2007-03-14 17:49:20 UTC (rev 3982) @@ -266,7 +266,13 @@ // perhaps this should be synchronized... but causes problems with sfCompleteName if it is public Object sfAttributeKeyFor(Object value) { - return sfContext.sfAttributeKeyFor(value); + if (value instanceof Remote) { + //When using stubs we need to compare equality + return sfContext.sfAttributeKeyForEqual(value); + } else { + // == for non remote objects. + return sfContext.sfAttributeKeyFor(value); + } } /** @@ -277,7 +283,13 @@ * @return true if context contains value, false otherwise */ public boolean sfContainsValue(Object value) { - return sfContext.contains(value); + if (value instanceof Remote) { + //When using stubs we need to compare equality + return sfContext.sfContainsValue(value); + } else { + // == for non remote objects. + return sfContext.sfContainsRefValue(value); + } } Modified: trunk/core/smartfrog/src/org/smartfrog/sfcore/prim/PrimImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/sfcore/prim/PrimImpl.java 2007-03-14 11:02:32 UTC (rev 3981) +++ trunk/core/smartfrog/src/org/smartfrog/sfcore/prim/PrimImpl.java 2007-03-14 17:49:20 UTC (rev 3982) @@ -23,6 +23,7 @@ import java.net.InetAddress; import java.rmi.NoSuchObjectException; import java.rmi.RemoteException; +import java.rmi.Remote; import java.rmi.server.RemoteStub; import java.util.Enumeration; import java.util.Iterator; @@ -484,7 +485,13 @@ // perhaps this should be synchronized... but causes problems with sfCompleteName if it is public Object sfAttributeKeyFor(Object value) { - return sfContext.sfAttributeKeyFor(value); + if (value instanceof Remote) { + //When using stubs we need to compare equality + return sfContext.sfAttributeKeyForEqual(value); + } else { + // == for non remote objects. + return sfContext.sfAttributeKeyFor(value); + } } /** @@ -497,7 +504,13 @@ * @throws RemoteException In case of Remote/nework error */ public boolean sfContainsValue(Object value) throws RemoteException{ - return sfContext.sfContainsRefValue(value); + if (value instanceof Remote) { + //When using stubs we need to compare equality + return sfContext.sfContainsValue(value); + } else { + // == for non remote objects. + return sfContext.sfContainsRefValue(value); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |