org.iids.aos.hostmanager.negotiationmodule.resourcehandlers
Class ResourceHandlerManager

java.lang.Object
  extended by org.iids.aos.hostmanager.negotiationmodule.resourcehandlers.ResourceHandlerManager

public class ResourceHandlerManager
extends java.lang.Object


Constructor Summary
ResourceHandlerManager()
           
 
Method Summary
 void addResourceHandler(java.lang.String serviceName, BasicResourceHandler handler)
          Register a resource handler at this host.
 BasicResourceHandler deregisterHandler(java.lang.String handlerID)
          Deregister a resource handler.
 void deregisterHandlers(AgentScapeID id)
          Remove all resource handlers that were implemented by the specified AgentScapeID.
 BasicResourceHandler getResourceHandler(AgentScapeID providerID, java.lang.String serviceName)
          Get a resource handler on specific host.
 BasicResourceHandler getResourceHandler(java.lang.String handlerID)
          Returns a resource handler that was registered in the manager.
 java.util.List<BasicResourceHandler> getResourceHandlers()
          Obtain a list of all registered resource handlers.
 java.util.Vector<BasicResourceHandler> getResourceHandlers(java.lang.String serviceName)
          Obtain all resource handlers that are registered for a given service name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceHandlerManager

public ResourceHandlerManager()
Method Detail

addResourceHandler

public void addResourceHandler(java.lang.String serviceName,
                               BasicResourceHandler handler)
                        throws HandlerManagementException
Register a resource handler at this host. If the handler is runnable (that is, an instance of AbstractResourceHandler) then the resource handler is automatically started in its own thread. Otherwise the handler is assumed to run on its own. Examples of handles running on their own are agents implementing a service (through AgentProxy)

Parameters:
serviceName - The name of the service to register. Not used?
handler - The handler to register. This can also be a proxied class, in which case the agent on the remote side of the proxy implements the functionality of the resource handler.
Throws:
HandlerManagementException

getResourceHandler

public BasicResourceHandler getResourceHandler(java.lang.String handlerID)
                                        throws HandlerManagementException
Returns a resource handler that was registered in the manager.

Parameters:
handlerID - The ID that was used to register the handler.
Returns:
The resource handler that was registered with the corresponding handler id.
Throws:
HandlerManagementException - If the handler cannot be found.

getResourceHandlers

public java.util.List<BasicResourceHandler> getResourceHandlers()
Obtain a list of all registered resource handlers.


getResourceHandlers

public java.util.Vector<BasicResourceHandler> getResourceHandlers(java.lang.String serviceName)
Obtain all resource handlers that are registered for a given service name. Multiple handlers can be registered for a certain service name.

Parameters:
serviceName - The name of the services to look for.
Returns:
The list of registered resource handlers.

getResourceHandler

public BasicResourceHandler getResourceHandler(AgentScapeID providerID,
                                               java.lang.String serviceName)
                                        throws HandlerManagementException
Get a resource handler on specific host. This assumes there can be only one version of the service name for each AgentScape host/provider?

Throws:
HandlerManagementException

deregisterHandlers

public void deregisterHandlers(AgentScapeID id)
Remove all resource handlers that were implemented by the specified AgentScapeID. After this function is called, no more lease requests will be made for the specified AgentScapeID.


deregisterHandler

public BasicResourceHandler deregisterHandler(java.lang.String handlerID)
Deregister a resource handler.

Parameters:
handlerID - ID of the handler to deregister.
Returns:
The deregistered resource handler.


Copyright © 2003, 2004 IIDS Group. All Rights Reserved.