@Override public boolean equals(final Object obj) { if(obj == null || !(obj instanceof CMIReferenceable)) { return false; } return cmiRef.equals(((CMIReferenceable<?>) obj).getReference()); }
/** * Construct a new handler of {@link CMIProxy}. * @param objectName the object name * @param interfaceName the name of the interface implemented by the handled proxy * @param cmiProxy the cmi proxy */ public CMIProxyHandleImpl(final String objectName, final String interfaceName, final CMIProxy cmiProxy) { this.objectName = objectName; this.cmiProxy = cmiProxy; this.interfaceName = interfaceName; serializedProxy = CMIProxySerializer.serialize(cmiProxy); }
@Override public String toString(){ return getProviderURL(); }
/** * @param cmiReference * a reference on a instance * @return a path in the distributed tree for a instance */ private String getCMIReferencePath(final CMIReference cmiReference) { return getProtocolPath(getObjectPath(cmiReference.getObjectName()), cmiReference.getServerRef().getProtocol()) + "/" + cmiReference.getServerRef().getInetAddress().getHostAddress() + "_" + cmiReference.getServerRef().getPort(); }
public boolean removeCMIReference(final CMIReference cmiReference) { Set<CMIReference> cmiReferences = refs.get(cmiReference.getServerRef().getProtocol()); if(cmiReferences == null) { return false; } return cmiReferences.remove(cmiReference); }
public boolean removeCMIReference(final CMIReference cmiReference) throws ObjectNotFoundException { synchronized (clusteredObjectsViews) { ClusteredObjectView clusteredObjectView = clusteredObjectsViews.get(cmiReference.getObjectName()); if(clusteredObjectView == null) { throw new ObjectNotFoundException( "Cannot get CMI references", cmiReference.getObjectName()); } return clusteredObjectView.removeCMIReference(cmiReference); } }
public T getTarget() { return cmiReferenceable.getReferencedObject(); }
/** * @param message * @param providerUrl */ public ServerNotFoundException(final String message, final String providerUrl) { super(message); try { serverRef = new ServerRef(providerUrl); } catch (MalformedURLException e) { serverRef = null; } catch (UnknownHostException e) { serverRef = null; } }
@Override public boolean equals(final Object obj) { return super.equals(obj); }
@Override protected CMIProxyHandle getHandle(final CMIProxy cmiProxy) { if(cmiProxyHandle == null) { cmiProxyHandle = new CMIProxyHandleImpl(objectName, itf.getName(), cmiProxy); } return cmiProxyHandle; }
@Override public int hashCode() { return super.hashCode(); }
@Override public boolean equals(final Object obj) { return super.equals(obj); }
@Override public int hashCode() { return cmiRef.hashCode(); }
@Override public int hashCode() { return super.hashCode(); }
public void addCMIReference(final CMIReference cmiReference) { Set<CMIReference> cmiReferences = refs.get(cmiReference.getServerRef().getProtocol()); if(cmiReferences == null) { cmiReferences = new HashSet<CMIReference>(); refs.put(cmiReference.getServerRef().getProtocol(), cmiReferences); } cmiReferences.add(cmiReference); }
@Override public String toString() { return serverRef.getProviderURL() + "/" + objectName; }
/** * Checks if the given object with the given clue is matching. * @param cmiReferenceable given object against which the check should be done. * @param cmiReference the object used as clue to check the matching. * @return true if it is matching, else false. */ public boolean isMatching(final CMIReferenceable<?> cmiReferenceable, final CMIReference cmiReference) { LOGGER.debug("{0} == {1} ?", cmiReferenceable.getReference(), cmiReference); return cmiReferenceable.getReference().equals(cmiReference); }
@Override public boolean equals(final Object obj) { if(obj == null || !(obj instanceof CMIReference)) { return false; } CMIReference cmiReference = (CMIReference) obj; return objectName.equals(cmiReference.objectName) && serverRef.equals(cmiReference.serverRef); }
@Override protected CMIProxyHandle getHandle(final CMIProxy cmiProxy) { if(cmiProxyHandle == null) { cmiProxyHandle = new CMIProxyHandleImpl(objectName, itf.getName(), cmiProxy); } return cmiProxyHandle; }
public boolean isMatching(final CMIReferenceable<?> object, final CMIReference clue) { LOGGER.debug("{0} == {1} ?", object.getReference(), clue); return object.getReference().equals(clue); }