public List<CMIReference> getCMIReferences(final String objectName) throws ObjectNotFoundException { synchronized (clusteredObjectsViews) { ClusteredObjectView clusteredObjectView = clusteredObjectsViews.get(objectName); if(clusteredObjectView == null) { throw new ObjectNotFoundException( "Cannot get CMI references", objectName); } return clusteredObjectView.getCMIReferences(); } }
/** * @param objectName a name of object * @return true if the object with the given name is replicated * @throws IllegalArgumentException if none object has the given name */ public boolean isReplicated(final String objectName) throws IllegalArgumentException { try { return clusterViewManager.isReplicated(objectName); } catch (ObjectNotFoundException e) { LOGGER.error("Object not found: {0}", objectName, e); throw new IllegalArgumentException("Object not found: " + objectName + "\n" + e.getMessage()); } }
public DistributedObjectInfo getObjectInfo(final String objectName) throws ObjectNotFoundException { synchronized (clusteredObjectsViews) { ClusteredObjectView clusteredObjectView = clusteredObjectsViews.get(objectName); if(clusteredObjectView == null) { throw new ObjectNotFoundException( "Cannot get object infos", objectName); } return clusteredObjectView.getObjectInfo(); } }
/** * Returns the name of class of policy for the object with the given name. * @param objectName name of the object * @return the name of class of policy for the object with the given name * @throws IllegalArgumentException if none object has the given name */ public String getPolicyClassName(final String objectName) throws IllegalArgumentException { try { return clusterViewManager.getPolicyClassName(objectName); } catch (ObjectNotFoundException e) { LOGGER.error("Object not found: {0}", objectName, e); throw new IllegalArgumentException("Object not found: " + objectName + "\n" + e.getMessage()); } }
public Set<CMIReference> getCMIReferences(final String objectName, final String protocolName) throws ObjectNotFoundException { synchronized (clusteredObjectsViews) { ClusteredObjectView clusteredObjectView = clusteredObjectsViews.get(objectName); if(clusteredObjectView == null) { throw new ObjectNotFoundException( "Cannot get CMI references", objectName); } return clusteredObjectView.getCMIReferences(protocolName); } }
/** * Returns true if the pool for object with the given name should be empty. * @param objectName a name of object * @return true if the pool for object with the given name should be empty * @throws IllegalArgumentException if no object is bound with the given name */ public boolean isPoolToEmpty(final String objectName) throws IllegalArgumentException { try { return clusterViewManager.isPoolToEmpty(objectName); } catch (ObjectNotFoundException e) { LOGGER.error("Object not found: {0}", objectName, e); throw new IllegalArgumentException("Object not found: " + objectName + "\n" + e.getMessage()); } }
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); } }
/** * Returns the name of cluster for the object with the given name. * @param objectName a name of object * @return the name of cluster for a object with the given name * @throws IllegalArgumentException if none object has the given name */ public String getClusterName(final String objectName) throws IllegalArgumentException { try { return clusterViewManager.getClusterName(objectName); } catch (ObjectNotFoundException e) { LOGGER.error("Object not found: {0}", objectName, e); throw new IllegalArgumentException("Object not found: " + objectName + "\n" + e.getMessage()); } }
/** * Returns the name of cluster for the object with the given name. * @param objectName a name of object * @return the name of cluster for a object with the given name * @throws ObjectNotFoundException if none object has the given name */ public String getClusterName(final String objectName) throws ObjectNotFoundException { try { return clientClusterViewCache.getClusteredObject(objectName).getClusterName(); } catch (NullPointerException e) { LOGGER.error("Object is unknown: {0}", objectName); throw new ObjectNotFoundException("Object is unknown: " + objectName); } }
/** * Returns the name of class of strategy for the object with the given name. * @param objectName name of the object * @return the name of class of strategy for the object with the given name * @throws IllegalArgumentException if none object has the given name */ public String getStrategyClassName(final String objectName) throws IllegalArgumentException { try { return clusterViewManager.getStrategyClassName(objectName); } catch (ObjectNotFoundException e) { LOGGER.error("Object not found: {0}", objectName, e); throw new IllegalArgumentException( "Object not found: " + objectName + "\n" + e.getMessage()); } }
public boolean isProxyEnabled(final String objectName) throws ObjectNotFoundException { try { return clientClusterViewCache.getClusteredObject(objectName).isProxyEnabled(); } catch (NullPointerException e) { LOGGER.error("Object is unknown: {0}", objectName); throw new ObjectNotFoundException("Object is unknown: " + objectName); } }
/** * Returns the max waiters of pool of CMIReferenceable for a object with the given name. * @param objectName a name of object * @return the maximal waiters of pool of CMIReferenceable for a object with the given name * @throws IllegalArgumentException if none object has the given name */ public Integer getMaxPoolWaiters(final String objectName) throws IllegalArgumentException { try { return clusterViewManager.getPoolConfiguration(objectName).getMaxWaiters(); } catch (ObjectNotFoundException e) { LOGGER.error("Object not found: {0}", objectName, e); throw new IllegalArgumentException("Object not found: " + objectName + "\n" + e.getMessage()); } }
/** * Return classnames of the application exceptions. * @param objectName a name of object * @return classnames of the application exceptions * @throws ObjectNotFoundException if none object has the given name */ public Set<String> getApplicationExceptionNames(final String objectName) throws ObjectNotFoundException{ try { return clientClusterViewCache.getClusteredObject(objectName).getApplicationExceptionNames(); } catch (NullPointerException e) { LOGGER.error("Object is unknown: {0}", objectName); throw new ObjectNotFoundException("Object is unknown: " + objectName); } }
/** * Returns the maximal size of pool of CMIReferenceable for a object with the given name. * @param objectName a name of object * @return the maximal size of pool of CMIReferenceable for a object with the given name * @throws IllegalArgumentException if none object has the given name */ public Integer getMaxPoolSize(final String objectName) throws IllegalArgumentException { try { return clusterViewManager.getPoolConfiguration(objectName).getMax(); } catch (ObjectNotFoundException e) { LOGGER.error("Object not found: {0}", objectName, e); throw new IllegalArgumentException("Object not found: " + objectName + "\n" + e.getMessage()); } }
/** * Returns the interface of an object bound with the given name. * @param objectName a name of object * @return the interface of an object bound with the given name * @throws ObjectNotFoundException if none object has the given name */ public Class<? extends EJBObject> getRemoteClass(final String objectName) throws ObjectNotFoundException { try { return clientClusterViewCache.getClusteredObject(objectName).getBusinessClass(); } catch (NullPointerException e) { LOGGER.error("Object is unknown: {0}", objectName); throw new ObjectNotFoundException("Object is unknown: " + objectName); } }
/** * Returns the pool timeout of CMIReferenceable for a object with the given name. * @param objectName a name of object * @return the timeout of pool of CMIReferenceable for a object with the given name * @throws IllegalArgumentException if none object has the given name */ public Long getPoolTimeout(final String objectName) throws IllegalArgumentException { try { return clusterViewManager.getPoolConfiguration(objectName).getTimeout(); } catch (ObjectNotFoundException e) { LOGGER.error("Object not found: {0}", objectName, e); throw new IllegalArgumentException("Object not found: " + objectName + "\n" + e.getMessage()); } }
/** * Return true if the object with the given name is stateful. * @param objectName a name of object * @return true if the object with the given name is stateful * @throws ObjectNotFoundException if none object has the given name */ public boolean hasState(final String objectName) throws ObjectNotFoundException { try { return clientClusterViewCache.getClusteredObject(objectName).isStateful(); } catch (NullPointerException e) { LOGGER.error("Object is unknown: {0}", objectName); throw new ObjectNotFoundException("Object is unknown: " + objectName); } }
/** * Returns a name of interface of this object. * @param objectName a name of object * @return a name of interface of this object * @throws IllegalArgumentException if no object is bound with the given name * @throws UnsupportedOperationException if the used manager is at client-side */ public String getItfName(final String objectName) throws IllegalArgumentException, UnsupportedOperationException { if(!(clusterViewManager instanceof ServerClusterViewManager)) { LOGGER.error("Clients cannot call this method"); throw new UnsupportedOperationException("Clients cannot call this method"); } try { return ((ServerClusterViewManager) clusterViewManager).getItfName(objectName); } catch (ObjectNotFoundException e) { LOGGER.error("Object not found: {0}", objectName, e); throw new IllegalArgumentException("Object not found: " + objectName + "\n " + e.getMessage()); } }
/** * Returns the interface of an object bound with the given name. * @param objectName a name of object * @return the interface of an object bound with the given name * @throws ObjectNotFoundException if none object has the given name */ public Class<?> getInterface(final String objectName) throws ObjectNotFoundException { try { return clientClusterViewCache.getClusteredObject(objectName).getItfClass(); } catch (NullPointerException e) { LOGGER.error("Object is unknown: {0}", objectName); throw new ObjectNotFoundException("Object is unknown: " + objectName); } }
/** * Returns the business interface name of an object bound with the given name (for ejb2 only). * If the object is not an ejb2, null is returned. * @param objectName a name of object * @return the business interface name of an object bound with the given name * @throws IllegalArgumentException if none object has the given name * @throws UnsupportedOperationException if the used manager is at client-side */ public String getBusinessName(final String objectName) throws IllegalArgumentException, UnsupportedOperationException { if(!(clusterViewManager instanceof ServerClusterViewManager)) { LOGGER.error("Clients cannot call this method"); throw new UnsupportedOperationException("Clients cannot call this method"); } try { return ((ServerClusterViewManager) clusterViewManager).getBusinessName(objectName); } catch (ObjectNotFoundException e) { LOGGER.error("Object not found: {0}", objectName, e); throw new IllegalArgumentException("Object not found: " + objectName + "\n" + e.getMessage()); } }