ist.palcom.assembly.manager
Class ResourceManager3
java.lang.Object
ist.palcom.services.AbstractService
ist.palcom.assembly.manager.ResourceManager3
- All Implemented Interfaces:
- IResourceManager, Service, IHgraphNode
public class ResourceManager3
- extends AbstractService
- implements IResourceManager
A class responsible for providing Assemblies with resources
This is the multi-threaded version, with one thread monitoring
each request.
Currently, only connections are supported: An assembly sends requests
for connections, and the ResourceManager responds with an ConnectionInfo,
if the connection is possible (i.e., the required services have been
discovered)
If established resources go down, dependent assemblies are informed
For alternative resources, if a better alternative appears, dependent assemblies
are informed that a change is possible
| Fields inherited from interface ist.palcom.hgraph.IHgraphNode |
CHILD_NAME_CLASH, CIRCULARITY_CLASH, COMMAND_OR_NODE_MISSING, ERROR, HANDLER_MISSING, INVOKATOR_MISSING, LISTENER_MISSING, NODE_NOT_CHILD, PATH_MISSING, SIBLING_ALREADY_EXISTS, SIBLING_NONEXISTENT, SIBLING_REFERENCE_ALREADY_EXISTS, SIBLING_REFERENCE_NONEXISTENT, STATUS_OK, VALUE_ALREADY_EXISTS, VALUE_NOT_PRESENT |
| Methods inherited from class ist.palcom.services.AbstractService |
addNodeChild, addServiceProxyListener, addSubservice, connectionCreated, connectTo, disconnectFrom, getChildIterator, getConnectionForURN, getConnections, getFuncFunc, getNodeName, getNodeParent, getNumberOfSubservices, getPath, getRemoteServiceProxy, getSelfTester, getSelfTestService, getServiceInfo, getServiceProxy, getSiblingFunc, getSubservice, getValueFunc, hasChildNamed, isAncestorOf, remoteServiceProxyIterator, removeNodeChild, removeServiceProxyListener, sendToAll, setName, setNodeName, setNodeParent, setServiceProxy, setURN, toXML, toXMLFull, toXMLFullRecursively, toXMLRecursively, updatePath, waitUntilNumberOfConnectionsIs |
URN_SUFFIX
public static final String URN_SUFFIX
- See Also:
- Constant Field Values
SERVICE_NAME
public static final String SERVICE_NAME
- See Also:
- Constant Field Values
ResourceManager3
public ResourceManager3(DeviceContext context,
String urnLeaf,
String serviceName)
throws IOException
- Throws:
IOException
ResourceManager3
public ResourceManager3(DeviceContext context,
URN urn)
throws IOException
- This constructor makes it possible to start the ResourceManager from the ServiceManager
- Throws:
IOException
start
public void start()
throws IOException
- Description copied from class:
AbstractService
- Start the service. The URN must be set before calling this method
(through a constructor, or through a call to the setURN method).
If the service is started already, nothing happens.
The DiscoveryManager will be updated with info about the service.
- Specified by:
start in interface IResourceManager- Overrides:
start in class AbstractService
- Throws:
IOException
stop
public void stop()
throws IOException
- Specified by:
stop in interface IResourceManager- Overrides:
stop in class AbstractService
- Throws:
IOException
tryLoadingSoftwareComponent
protected void tryLoadingSoftwareComponent(Assembly assembly,
PRDAssembly ai,
URN urn)
- tryLoadingSoftwareComponent
Connect to the SoftwareComponentManager on a device with a missing service
and attempt to load the service with the specified URN.
processResourceRequest
protected void processResourceRequest(ResourceRequestEvent rre)
servicesAreSingle
public boolean servicesAreSingle(ServiceExp prov,
ServiceExp cust)
- Check if a pair of serviceExp:s refer to single (i.e., not alternative) declarations
- Specified by:
servicesAreSingle in interface IResourceManager
serviceExpRefersToSingle
public boolean serviceExpRefersToSingle(ServiceExp se)
- Specified by:
serviceExpRefersToSingle in interface IResourceManager
putEvent
public void putEvent(ResourceRequestEvent event)
- Specified by:
putEvent in interface IResourceManager