@Override public boolean equals(Object o){ if (o == this) return true; if (!(o instanceof UIDSerializer)) return false; UIDSerializer that = (UIDSerializer) o; return uid.equals(that.uid); }
/** * Indicates whether some other object is equal to this one. * <p>Messages internally cary a UID which is created during instantiation. * This UID is used for comparing {@code o} with the instance.</p> * * @param o the reference object with which to compare. * * @return {@code true} if this object is the same as {@code o}; * {@code false} otherwise. * * @see UID */ public final boolean equals( final Object o ) { return o == this || ( o instanceof Message && ( ( Message ) o ).uid.equals( this.uid ) ); }
/** * Indicates whether some other object is equal to this one. * <p>Tasks internally cary a UID which is created during instantiation. * This UID is used for comparing {@code o} with the instance.</p> * * @param o the reference object with which to compare. * * @return {@code true} if this object is the same as {@code o}; * {@code false} otherwise. * * @see UID */ public final boolean equals( final Object o ) { return o == this || ( o instanceof Task && ( (Task) o ).uid.equals( this.uid ) ); }
/** * Indicates whether some other object is equal to this GUID. * * @param obj the object to compare with. * @return true if the two objects are equal, false otherwise. */ @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof GUID)) { return false; } final GUID guid = (GUID) obj; return ((this.host.equals(guid.host)) && (this.uid.equals((guid.uid)))); }
@Override public boolean equals(Object obj) { if (obj != null && obj.getClass() == getClass()) { AID id = (AID) obj; return (uid.equals(id.uid) && activator.equals(id.activator)); } return false; }
/** * Returns true if the object is an instance of this class with the same * UID and a trust equivalent activator. */ public boolean checkTrustEquivalence(Object obj) { if (!(obj instanceof ConstrainableAID)) { return false; } ConstrainableAID aid = (ConstrainableAID) obj; return (uid.equals(aid.uid) && ((TrustEquivalence) activator).checkTrustEquivalence( aid.activator)); }
UID id = (UID) ois.readObject(); if( id.equals(vmID) == true )
ObjectInputStream ois = new ObjectInputStream(bais); UID id = (UID) ois.readObject(); if( id.equals(vmID) == true )
/** * override readExternal to initialise localRef * We could actually receive anything from the server on lookup * @param in the object input * @param newFormat the new format boolean */ public void readExternal(ObjectInput in, boolean newFormat) throws IOException, ClassNotFoundException { raddr = new byte[in.readInt()]; in.read(raddr); ruid = UID.read(in); localRef = ((Arrays.equals(raddr, JInterceptorHelper.getInetAddress())) &&(ruid.equals(JInterceptorHelper.getSpaceID()))); // write initializers array in UTF String[] ia = new String [in.readInt()]; for (int i=0; i< ia.length; i++) { ia[i] = in.readUTF(); } this.initializers=ia; cis = JInterceptorStore.setRemoteInterceptors(raddr, ruid,ia); ref = LiveRef.read(in, newFormat); }
/** * override readExternal to initialize localRef We could actually receive * anything from the server on lookup * @param in the object input * @param newFormat the new format boolean */ public void readExternal(ObjectInput in, boolean newFormat) throws IOException, ClassNotFoundException { raddr = new byte[in.readInt()]; in.read(raddr); ruid = UID.read(in); localRef = ((Arrays.equals(raddr, JInterceptorHelper.getInetAddress())) && (ruid.equals(JInterceptorHelper .getSpaceID()))); // write initializers array in UTF String[] ia = new String[in.readInt()]; for (int i = 0; i < ia.length; i++) { ia[i] = in.readUTF(); } this.initializers = ia; cis = JInterceptorStore.getJInterceptorStore().setRemoteInterceptors(ia); localId = in.readInt(); ref = LiveRef.read(in, newFormat); }
/** * Get interceptor if exist * @param raddr The remote adress (later) * @param ruid The remote uid (later) * @param ia iterceptors initializers * @return JClientRequestInterceptors [] , the interceptors */ public synchronized static JClientRequestInterceptor [] setRemoteInterceptors(byte [] raddr,UID ruid,String [] ia) { if ((Arrays.equals(raddr, address)) &&(ruid.equals(uid))) { return rcis; } else { jrmpInfo.clear(); for (int i = 0; i < ia.length ; i ++) { JInitializer jinit = null; try { jinit = (JInitializer) Class.forName(ia[i]).newInstance(); jinit.pre_init(jrmpInfo); jinit.post_init(jrmpInfo); } catch (Exception e) { TraceCarol.error("can not load interceptors", e); } } ruid=uid; address=raddr; rcis = jrmpInfo.getClientRequestInterceptors(); return rcis; } } }