|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceManager
ResourceManager defines the interface for creating and storing resources
that can be targeted by other resources (internal and external to a
Muse-derived application). The resources' endpoint references (EPRs) are
used to differentiate between resources in concrete implementations. This
is the implied resource pattern required by WS-Addressing.
Note that ResourceManager does not initiate any lifecycle events - the
addResource() method does not create a resource, and the removeResource()
method does not destroy a resource. Other components can use the
createResource() method to instantiate a resource and addResource() to make
it visible to remote clients.
Shutdown.shutdown()
Method Summary | |
---|---|
void |
addListener(ResourceManagerListener listener)
|
void |
addResource(EndpointReference epr,
Resource resource)
Add a resource to the manager, associated with the given EPR. |
void |
addResourceDefinitions(Collection definitions)
|
Resource |
createResource(String contextPath)
Finds the resource type definition associated with the given context path (defined in muse.xml), instantiates an instance of the resource class, and sets the basic values (EPR, initialization parameters, etc.) and Muse components (Environment, log file, etc.) that it needs to operate. |
Environment |
getEnvironment()
|
int |
getNumberOfResources()
|
Resource |
getResource(EndpointReference epr)
|
String |
getResourceContextPath(Class capabilityClass)
This method allows you to find a resource type's endpoint URI given the Java interface or concrete class of one of its capabilities. |
Collection |
getResourceContextPaths()
|
Collection |
getResourceContextPaths(Class capabilityClass)
This method is just like getResourceContextPath(Class) except that it returns multiple endpoints that use the capability. |
Iterator |
getResourceEPRs()
|
Iterator |
getResourceEPRs(String contextPath)
This method allows you to search for the EPRs for all instances of a given resource type (where each resource type has a unique context path). |
boolean |
isUsingPersistence(String contextPath)
|
void |
removeListener(ResourceManagerListener listener)
Stops the given listener from receiving notifications about the addition and removal of resource instances. |
void |
removeResource(EndpointReference epr)
Removes the EPR-resource pair from the manager. |
void |
removeResourceDefinitions(Collection definitions)
Removes each ResourceDefinition in the given Collection. |
void |
setEnvironment(Environment env)
|
Methods inherited from interface org.apache.muse.core.Initialization |
---|
hasBeenInitialized, initialize |
Methods inherited from interface org.apache.muse.core.Shutdown |
---|
hasBeenShutdown, shutdown |
Method Detail |
---|
void addListener(ResourceManagerListener listener)
listener
- A listener that will be fired whenever a resource is added
or removed from the resource.void addResource(EndpointReference epr, Resource resource) throws SoapFault
epr
- The unique EPR identifying the resource instance.resource
-
SoapFault
- getResource(EndpointReference)
void addResourceDefinitions(Collection definitions)
definitions
- The ResourceDefinition objects that will be used to generate new
resource instances.Resource createResource(String contextPath) throws SoapFault
contextPath
- The context path for the resource type that is to be instantiated.
This value is specified with the context-path element in
muse.xml.
SoapFault
Environment getEnvironment()
int getNumberOfResources()
Resource getResource(EndpointReference epr)
epr
- The unique EPR that is associated with the desired resource.
String getResourceContextPath(Class capabilityClass)
capabilityClass
- An interface or concrete class for one of the capabilities in
the application's resource types. This value may be defined in
resource-type/capability/java-capability-class in muse.xml.
Collection getResourceContextPaths()
Collection getResourceContextPaths(Class capabilityClass)
Iterator getResourceEPRs()
Iterator getResourceEPRs(String contextPath)
contextPath
-
boolean isUsingPersistence(String contextPath)
contextPath
-
void removeListener(ResourceManagerListener listener)
listener
- void removeResource(EndpointReference epr) throws SoapFault
epr
- The unique EPR that maps to the resource being removed.
SoapFault
- void removeResourceDefinitions(Collection definitions)
definitions
- void setEnvironment(Environment env)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |