objectName = ((CMIReference) loadBalanceable).getObjectName(); Set<String> applicationExceptionNames = clusterViewManager.getApplicationExceptionNames(objectName); if(applicationExceptionNames.contains(cause.getClass().getName())) {
/** * Binds a dummy registry to enable the load-balancing of JNDI accesses to unclustered objects. * @param serverRef a reference on the local registry */ private void bindDummyRegistry(final ServerRef serverRef) { String bindName = CMIConfig.getBindNameForDummyRegistry(); // Create an instance of CMIReference for this object CMIReference cmiReference = new CMIReference(serverRef, bindName); addObjectInstance(clusteredObjectInfoForDummyRegistry, cmiReference); }
@SuppressWarnings("unchecked") private Object readResolve() throws ObjectStreamException { CMIReference ref = getReference(); if(ref.getServerRef().getProtocol().equals("iiop")) { T remote; try { remote = (T) Utility.string_to_remote(ior); } catch (NamingException e) { throw new InvalidObjectException("Cannot get the stub from the ior " + ior); } return new RemoteCMIReferenceableWrapper<T>(ref, remote); } else { return this; } }
ServerRef serverRef = cmiReference.getServerRef(); String protocol = serverRef.getProtocol(); String bindName = cmiReference.getObjectName(); Class<?> interfaceClass; try {
/** * 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); }
String objectName = cmiReference.getObjectName();
public void unbind(final String name) throws NamingException { LOGGER.debug("unbind {0}", name); if(serverModeEnabled) { LOGGER.debug("Server mode enabled"); // Verify that replication is activated if(replicationEnabled) { // Tests if the object is clustered boolean isClustered = clusterViewManager.isClustered(name); if(isClustered) { LOGGER.debug("{0} is clustered", name); ((ServerClusterViewManager) clusterViewManager).removeCMIReference( new CMIReference(localRegistry, name)); } } localContext.unbind(name); } else { LOGGER.warn("Cannot unbind because server mode is not activated."); } }
private Object writeReplace() throws ObjectStreamException { CMIReference ref = getReference(); if(ref.getServerRef().getProtocol().equals("iiop")) { String ior; try { ior = Utility.remote_to_string(getReferencedObject()); } catch (NamingException e) { throw new InvalidObjectException("Cannot get the ior from the stub " + getReferencedObject()); } return new RemoteCMIReferenceableWrapper<T>(ref, ior); } else { return this; } }
CMIReference cmiReference = new CMIReference(localRegistry, name);
/** * Returns the list of Provider URL. * @param protocolName a name of protocol * @return providers of the cluster view for the protocol with the given name * @throws ServerClusterViewManagerException if none provider exists for the protocol with the given name */ public final List<String> getProviderURLs(final String protocolName) throws ServerClusterViewManagerException { String providerName = CMIConfig.getBindNameForProvider(); ArrayList<String> providerURLs = new ArrayList<String>(); try { for(CMIReference cmiReference : getCMIReferences(providerName, protocolName)) { providerURLs.add(cmiReference.getServerRef().getProviderURL()); } } catch (ObjectNotFoundException e) { LOGGER.error("Cannot get CMIReferences for the provider whith name {0}", providerName, e); throw new ServerClusterViewManagerException( "Cannot get CMIReferences for the provider whith name " + providerName, e); } return providerURLs; }