org.apache.muse.core
Interface Resource
- All Superinterfaces:
- org.apache.muse.core.CapabilityContainer, Initialization, InitializationParameters, Shutdown
- All Known Subinterfaces:
- WsResource
- All Known Implementing Classes:
- SimpleResource, SimpleWsResource
- public interface Resource
- extends Initialization, InitializationParameters, Shutdown, org.apache.muse.core.CapabilityContainer
Resource is an aggregate of Capability objects, providing a common
host for them to share information and sub-components. The
CapabilityContainer interface, while
small, is the most important part of the Resource interface, for it
describes Resource's primary role in the Muse framework.
This interface also acts as the final stop in the request delegation process,
taking method invocation requests from the
ResourceRouter
and passing them along to the appropriate Capability based on its
knowledge of each Capability's supported operations. This allows the
Capability classes to do their work in a way that is independent of
SOAP request-handling and other plumbing.
From a remote client perspective, Resource is the atomic unit of
definition, since WSDL 1.1 does not allow resource interfaces to
be broken down into distinct sub-interfaces (capabilities). However,
from a server-side programming model perspective, Resource is not the
most granular level of resource definition - users should focus on creating
capabilities and use Resource as a means of
communicating between those capabilities.
- Author:
- Dan Jemiolo (danj)
- See Also:
CapabilityContainer
,
Capability
,
Capability.getResource()
getContextPath
public java.lang.String getContextPath()
- Returns:
- The unique part of the SOAP endpoint URL that defines this
resource's type. Every resource type should have a unique
SOAP endpoint. This value should map to a context-path
value in muse.
getEndpointReference
public EndpointReference getEndpointReference()
- Returns:
- The unique EPR of the resource instance.
getEnvironment
public Environment getEnvironment()
- Returns:
- The resource's access point for things such as the
WS-Addressing context, file system resources, and more.
getLog
public java.util.logging.Logger getLog()
- Returns:
- The JDK logger that writes to the Muse log file.
getResourceManager
public ResourceManager getResourceManager()
- Returns:
- The ResourceManager that stores all of the resource type
definitions and all current resource instances.
getWsdlPath
public java.lang.String getWsdlPath()
- Returns:
- The relative path of the WSDL file with the resource's portType.
getWsdlPortType
public QName getWsdlPortType()
- Returns:
- The WSDL portType that defines the resource.
invoke
public org.w3c.dom.Element invoke(org.w3c.dom.Element soapBody)
- This is a generic method invocation mechanism that can be used to
delegate request handling to a capability or some other component.
It is intended to be used by code that is handling external requests,
and it may not allow the invocation of all methods defined by the type.
Internal clients should make 'normal' Java method calls with the actual
method parameters; the getCapability(String) method provides access
to the Capability objects that make up the resource type, all of which
will have 'normal' Java methods for their operations.
- Parameters:
soapBody
- The parameters for the method, still in their SOAP Body form.
- Returns:
- The return value of the method, in SOAP Body form. If the
operation resulted in a fault, the response XML should be
the fault XML.
setContextPath
public void setContextPath(java.lang.String contextPath)
setEndpointReference
public void setEndpointReference(EndpointReference epr)
setEnvironment
public void setEnvironment(Environment environment)
setLog
public void setLog(java.util.logging.Logger log)
setResourceManager
public void setResourceManager(ResourceManager manager)
setWsdlPath
public void setWsdlPath(java.lang.String wsdlPath)
setWsdlPortType
public void setWsdlPortType(QName wsdlPortType)
addCapability
public void addCapability(Capability capability)
- Registers the given capability instance with the resource.
- Parameters:
capability
-
getCapability
public Capability getCapability(java.lang.String capabilityURI)
- Parameters:
capabilityURI
-
- Returns:
- The Capability associated with the given URI, or null if
no such capability exists.
getCapabilityURIs
public java.util.Collection getCapabilityURIs()
- Returns:
- The URIs of all of the capabilities added to the resource.
hasCapability
public boolean hasCapability(java.lang.String capabilityURI)
- Parameters:
capabilityURI
-
- Returns:
- True, if getCapability(String) returns a non-null value.