org.ow2.cmi.controller.common
Interface ClusterViewManager

All Superinterfaces:
CMIManagedObject
All Known Subinterfaces:
ClientClusterViewManager, ServerClusterViewManager

public interface ClusterViewManager
extends CMIManagedObject

Implementations of this interface define a manager of the cluster view.

Author:
The new CMI team
See Also:
the manager on client side, the manager on server side

Nested Class Summary
static class ClusterViewManager.State
          Define the states of a cluster view manager.
 
Method Summary
 void addObjectToWatch(java.lang.String objectName)
          Adds an object with the given name to a set of objects that need to have their state up-to-date.
 void destroy()
          Destroy this manager.
 java.util.Set<java.lang.String> getApplicationExceptionNames(java.lang.String objectName)
          Return classnames of the application exceptions.
 java.lang.String getClusterName(java.lang.String objectName)
          Returns the name of cluster for the object with the given name.
 java.util.Collection<CMIReference> getCMIReferences(java.lang.String objectName, java.lang.String protocolName)
          Returns a list of CMIReference for an object with the given name and protocol.
 IConfig getConfig()
           
 long getDateOfProperties(java.lang.String objectName)
          Returns the date of properties for an object with the given name.
 int getDelayToRefresh()
          Returns the time between each update of the cluster view by clients.
 org.ow2.util.event.api.IEventDispatcher getEventDispatcher()
           
 java.lang.String getInitialContextFactoryName(java.lang.String protocolName)
          Returns a name of class that implements the interface InitialContextFactory for the given name of protocol.
 java.lang.Class<?> getInterface(java.lang.String objectName)
          Returns the interface of an object bound with the given name.
 int getLoadFactor(ServerRef serverRef)
          Returns the load-factor for the server with the given address.
 java.util.Set<java.lang.String> getObjectNames()
           
 IPolicy<CMIReference> getPolicy(java.lang.String objectName)
          Returns an instance of policy for the object that have the given name.
 java.lang.Class<? extends IPolicy<?>> getPolicyClass(java.lang.String objectName)
          Returns the class that defines the policy for an object with the given name.
 java.lang.String getPolicyClassName(java.lang.String objectName)
          Returns the name of class of policy for the object with the given name.
 org.ow2.util.pool.api.Pool<CMIReferenceable<?>,CMIReference> getPool(java.lang.String objectName)
          Returns a pool of CMIReferenceable for an object with the given name.
 org.ow2.util.pool.api.IPoolConfiguration getPoolConfiguration(java.lang.String objectName)
          Returns the configuration of pool of CMIReferenceable for a object with the given name.
 java.util.Map<java.lang.String,java.lang.Object> getPropertiesForPolicy(java.lang.String objectName)
          Returns the properties of the policy for an object with the given name.
 java.lang.Object getPropertyForPolicy(java.lang.String objectName, java.lang.String propertyName)
          Returns a value property of the policy for an object with the given name.
 java.util.Set<java.lang.String> getProtocols()
           
 java.lang.Class<? extends javax.ejb.EJBObject> getRemoteClass(java.lang.String objectName)
          Returns the business interface of an object bound with the given name (for ejb2 only).
 SessionId getSessionId()
           
 ClusterViewManager.State getState()
           
 java.lang.Class<? extends IStrategy<?>> getStrategyClass(java.lang.String objectName)
          Returns the class that defines the strategy for an object with the given name.
 java.lang.String getStrategyClassName(java.lang.String objectName)
          Returns the name of class of strategy for the object with the given name.
 java.util.UUID getUUID()
           
 boolean hasState(java.lang.String objectName)
          Return true if the object with the given name is stateful.
 boolean isClustered(java.lang.String objectName)
          Returns true if the object with the specified name is clustered.
 boolean isPoolToEmpty(java.lang.String objectName)
          Returns true if the pool for object with the given name should be empty.
 boolean isProxyEnabled(java.lang.String objectName)
           
 boolean isReplicated(java.lang.String objectName)
          Return true if the object with the given name is replicated for high-availability.
 void setPool(java.lang.String objectName, org.ow2.util.pool.api.Pool<CMIReferenceable<?>,CMIReference> pool)
          Associates a name of object with a pool of CMIReferenceable.
 boolean start()
          Start the manager and return if it is available.
 void stop()
          Stop the manager.
 
Methods inherited from interface org.ow2.cmi.event.CMIManagedObject
getCMIManagedObjectId, getComponent
 

Method Detail

getProtocols

java.util.Set<java.lang.String> getProtocols()
Returns:
the protocols registered in the manager

getPolicyClassName

java.lang.String getPolicyClassName(java.lang.String objectName)
                                    throws ObjectNotFoundException
Returns the name of class of policy for the object with the given name.

Parameters:
objectName - a name of object
Returns:
the name of class of policy for the object with the given name
Throws:
ObjectNotFoundException - if none object has the given name

getPolicyClass

java.lang.Class<? extends IPolicy<?>> getPolicyClass(java.lang.String objectName)
                                                     throws ObjectNotFoundException,
                                                            ClusterViewManagerException
Returns the class that defines the policy for an object with the given name.

Parameters:
objectName - a name of object
Returns:
the class that defines the policy for an object with the given name
Throws:
ObjectNotFoundException - if none object has the given name
ClusterViewManagerException

getStrategyClassName

java.lang.String getStrategyClassName(java.lang.String objectName)
                                      throws ObjectNotFoundException
Returns the name of class of strategy for the object with the given name.

Parameters:
objectName - a name of object
Returns:
the name of class of strategy for the object with the given name
Throws:
ObjectNotFoundException - if none object has the given name

getStrategyClass

java.lang.Class<? extends IStrategy<?>> getStrategyClass(java.lang.String objectName)
                                                         throws ObjectNotFoundException,
                                                                ClusterViewManagerException
Returns the class that defines the strategy for an object with the given name.

Parameters:
objectName - a name of object
Returns:
the class that defines the strategy for an object with the given name
Throws:
ObjectNotFoundException - if none object has the given name
ClusterViewManagerException

getDateOfProperties

long getDateOfProperties(java.lang.String objectName)
                         throws ObjectNotFoundException
Returns the date of properties for an object with the given name.

Parameters:
objectName - a name of object
Returns:
the date of properties for an object with the given name
Throws:
ObjectNotFoundException - if none object has the given name

getPropertyForPolicy

java.lang.Object getPropertyForPolicy(java.lang.String objectName,
                                      java.lang.String propertyName)
                                      throws ObjectNotFoundException
Returns a value property of the policy for an object with the given name.

Parameters:
objectName - a name of object
propertyName - a name of property
Returns:
a value property of the policy for an object with the given name
Throws:
ObjectNotFoundException - if none object has the given name

getPropertiesForPolicy

java.util.Map<java.lang.String,java.lang.Object> getPropertiesForPolicy(java.lang.String objectName)
                                                                        throws ObjectNotFoundException
Returns the properties of the policy for an object with the given name.

Parameters:
objectName - a name of object
Returns:
the properties of the policy for an object with the given name
Throws:
ObjectNotFoundException - if none object has the given name

getCMIReferences

java.util.Collection<CMIReference> getCMIReferences(java.lang.String objectName,
                                                    java.lang.String protocolName)
                                                    throws ObjectNotFoundException
Returns a list of CMIReference for an object with the given name and protocol.

Parameters:
objectName - a name of object
protocolName - a name of protocol
Returns:
a list of CMIReference for an object with the given name and protocol
Throws:
ObjectNotFoundException - if none object has the given name for the given protocol

getInterface

java.lang.Class<?> getInterface(java.lang.String objectName)
                                throws ObjectNotFoundException
Returns the interface of an object bound with the given name.

Parameters:
objectName - a name of object
Returns:
the interface of an object bound with the given name
Throws:
ObjectNotFoundException - if none object has the given name

getRemoteClass

java.lang.Class<? extends javax.ejb.EJBObject> getRemoteClass(java.lang.String objectName)
                                                              throws ObjectNotFoundException
Returns the business interface of an object bound with the given name (for ejb2 only).

Parameters:
objectName - a name of object
Returns:
the business interface of an object bound with the given name
Throws:
ObjectNotFoundException - if none object has the given name

hasState

boolean hasState(java.lang.String objectName)
                 throws ObjectNotFoundException
Return true if the object with the given name is stateful.

Parameters:
objectName - a name of object
Returns:
true if the object with the given name is stateful
Throws:
ObjectNotFoundException - if none object has the given name

isReplicated

boolean isReplicated(java.lang.String objectName)
                     throws ObjectNotFoundException
Return true if the object with the given name is replicated for high-availability.

Parameters:
objectName - a name of object
Returns:
true if the object with the given name is replicated for high-availability
Throws:
ObjectNotFoundException - if none object has the given name

getApplicationExceptionNames

java.util.Set<java.lang.String> getApplicationExceptionNames(java.lang.String objectName)
                                                             throws ObjectNotFoundException
Return classnames of the application exceptions.

Parameters:
objectName - a name of object
Returns:
classnames of the application exceptions
Throws:
ObjectNotFoundException - if none object has the given name

getInitialContextFactoryName

java.lang.String getInitialContextFactoryName(java.lang.String protocolName)
                                              throws ProtocolNotFoundException
Returns a name of class that implements the interface InitialContextFactory for the given name of protocol.

Parameters:
protocolName - a name of protocol
Returns:
a name of class that implements the interface InitialContextFactory for the given name of protocol
Throws:
ProtocolNotFoundException - if none protocol has a such name

getPolicy

IPolicy<CMIReference> getPolicy(java.lang.String objectName)
                                throws ObjectNotFoundException
Returns an instance of policy for the object that have the given name.

Parameters:
objectName - a name of object
Returns:
an instance of policy for the object that have the given name
Throws:
ObjectNotFoundException - if none object has the given name

isClustered

boolean isClustered(java.lang.String objectName)
Returns true if the object with the specified name is clustered.

Parameters:
objectName - a name of object
Returns:
true if the object with the specified name is clustered

getPoolConfiguration

org.ow2.util.pool.api.IPoolConfiguration getPoolConfiguration(java.lang.String objectName)
                                                              throws ObjectNotFoundException
Returns the configuration of pool of CMIReferenceable for a object with the given name.

Parameters:
objectName - a name of object
Returns:
the configuration of pool of CMIReferenceable for a object with the given name
Throws:
ObjectNotFoundException - if none object has the given name

isPoolToEmpty

boolean isPoolToEmpty(java.lang.String objectName)
                      throws ObjectNotFoundException
Returns true if the pool for object with the given name should be empty.

Parameters:
objectName - a name of object
Returns:
true if the pool for object with the given name should be empty
Throws:
ObjectNotFoundException - if no object is bound with the given name

getPool

org.ow2.util.pool.api.Pool<CMIReferenceable<?>,CMIReference> getPool(java.lang.String objectName)
                                                                     throws ObjectNotFoundException
Returns a pool of CMIReferenceable for an object with the given name.

Parameters:
objectName - a name of object
Returns:
a pool of CMIReferenceable for an object with the given name
Throws:
ObjectNotFoundException - if none object has the given name

setPool

void setPool(java.lang.String objectName,
             org.ow2.util.pool.api.Pool<CMIReferenceable<?>,CMIReference> pool)
             throws ObjectNotFoundException
Associates a name of object with a pool of CMIReferenceable.

Parameters:
objectName - a name of object
pool - a pool of CMIReferenceable
Throws:
ObjectNotFoundException - if none object has the given name

getClusterName

java.lang.String getClusterName(java.lang.String objectName)
                                throws ObjectNotFoundException
Returns the name of cluster for the object with the given name.

Parameters:
objectName - a name of object
Returns:
the name of cluster for a object with the given name
Throws:
ObjectNotFoundException - if none object has the given name

addObjectToWatch

void addObjectToWatch(java.lang.String objectName)
                      throws ObjectNotFoundException,
                             ClusterViewManagerException
Adds an object with the given name to a set of objects that need to have their state up-to-date.

Parameters:
objectName - a name of object
Throws:
ObjectNotFoundException - if none object has the given name
ClusterViewManagerException

getDelayToRefresh

int getDelayToRefresh()
Returns the time between each update of the cluster view by clients.

Returns:
the time between each update of the cluster view by clients

getLoadFactor

int getLoadFactor(ServerRef serverRef)
                  throws ServerNotFoundException
Returns the load-factor for the server with the given address.

Parameters:
serverRef - a reference on a server
Returns:
the load-factor for the server with the given address
Throws:
ServerNotFoundException - if none server has the given address

getUUID

java.util.UUID getUUID()
Returns:
the UUID for this manager

getSessionId

SessionId getSessionId()
Returns:
a new identifier of session

getObjectNames

java.util.Set<java.lang.String> getObjectNames()
Returns:
the set of clustered object names

getConfig

IConfig getConfig()
Returns:
the configuration used by this manager

start

boolean start()
              throws ClusterViewManagerException
Start the manager and return if it is available.

Returns:
true if the manager is available
Throws:
ClusterViewManagerException

stop

void stop()
Stop the manager.


getState

ClusterViewManager.State getState()
Returns:
the state of this manager

isProxyEnabled

boolean isProxyEnabled(java.lang.String objectName)
                       throws ObjectNotFoundException
Parameters:
objectName - a name of object
Returns:
true if a CMI proxy should be used to make invocations on the given objects
Throws:
ObjectNotFoundException - if none object has the given name

destroy

void destroy()
Destroy this manager. A destroyed manager cannot be any more started.


getEventDispatcher

org.ow2.util.event.api.IEventDispatcher getEventDispatcher()
Returns:
the event dispatcher used by this manager


Copyright © 2009 OW2 Consortium. All Rights Reserved.