org.apache.muse.ws.resource.impl
Class SimpleWsResource
java.lang.Object
org.apache.muse.core.SimpleResource
org.apache.muse.ws.resource.impl.SimpleWsResource
- All Implemented Interfaces:
- Initialization, InitializationParameters, Resource, Shutdown, WsResource
public class SimpleWsResource
- extends SimpleResource
- implements WsResource
SimpleResource is Muse's default implementation of a WS-RF-compliant
resource (WsResource). It parses the resource's
WSDL to find the WSRP document schema and then creates the WSRP
state model using Muse's default
WSRP implementation.
The WSRP implementation class can be modified by overriding the
createPropertyCollection() method in this class.
- Author:
- Dan Jemiolo (danj)
Methods inherited from class org.apache.muse.core.SimpleResource |
addCapability, getCapability, getCapabilityActions, getCapabilityForAction, getCapabilityURIs, getContextPath, getEndpointReference, getEnvironment, getInitializationParameter, getInitializationParameters, getLog, getResourceManager, getWsdlPath, getWsdlPortType, hasBeenInitialized, hasBeenShutdown, hasCapability, initializeCapabilities, invoke, setContextPath, setEndpointReference, setEnvironment, setInitializationParameters, setLog, setResourceManager, setWsdlPath, setWsdlPortType, shutdown, shutdownCapabilities, toString |
Methods inherited from interface org.apache.muse.core.Resource |
getContextPath, getEndpointReference, getEnvironment, getLog, getResourceManager, getWsdlPath, getWsdlPortType, invoke, setContextPath, setEndpointReference, setEnvironment, setLog, setResourceManager, setWsdlPath, setWsdlPortType |
SimpleWsResource
public SimpleWsResource()
createMetadataDescriptor
protected MetadataDescriptor createMetadataDescriptor(Document wsdl)
- Parameters:
wsdl
- The DOM document holding the resource's WSDL.
- Returns:
- The metadata descriptor referenced in the resource's WSDL, or
an 'open' descriptor (no restrictions) if none is found.
createPropertiesSchema
protected ResourcePropertiesSchema createPropertiesSchema(Document wsdl)
- Parameters:
wsdl
- The DOM document holding the resource's WSDL.
- Returns:
- The WSRP document schema from the WSDL's types section,
or an 'open' schema (no restrictions) if none is found.
createPropertyCollection
protected ResourcePropertyCollection createPropertyCollection()
- This method returns the concrete WSRP state model - this is not
the implementation of the WSRP capabilities (which map SOAP
requests to WSRP operations), but it does implement the actual
WSRP operations and does the delegation of read/write requests
to the capabilities defining the properties. It is available no
matter how many of the WSRP capabilites are exposed to remote
clients.
You can replace the default implementation by overriding
this method to instantiate a different concrete class. You would
then specify the name of your new sub-class using the
java-resource-class element in muse.xml.
- Returns:
- An instance of SimpleResourcePropertyCollection.
getPropertyCollection
public final ResourcePropertyCollection getPropertyCollection()
- Specified by:
getPropertyCollection
in interface WsResource
- Returns:
- The internal WSRP state model - despite the fact that this has
all of the WSRP operations available, none of them is exposed
to remote clients until one or more of the WSRP capabilities
is used in the resource's definition.
- See Also:
GetCapability
,
QueryCapability
,
SetCapability
initialize
public void initialize()
throws SoapFault
-
The SimpleWsResource implementation takes the following steps:
- Create WSRP state model - createPropertyCollection()
- Create WSRP document schema and apply it to the collection.
- Create WSRP metadata and apply it to the collection.
- Call super.initialize() to initialize capabilities. The
WSRP collection is now available to the capabilities during
their startup cycle.
- Apply metadata by creating components needed to enforce it.
- Validate WSRP document according to schema and metadata.
- Specified by:
initialize
in interface Initialization
- Overrides:
initialize
in class SimpleResource
- Throws:
SoapFault
addCapability
public void addCapability(Capability capability)
- Registers the given capability instance with the resource.
- Parameters:
capability
-
getCapability
public Capability getCapability(String capabilityURI)
- Parameters:
capabilityURI
-
- Returns:
- The Capability associated with the given URI, or null if
no such capability exists.
getCapabilityURIs
public Collection getCapabilityURIs()
- Returns:
- The URIs of all of the capabilities added to the resource.
hasCapability
public boolean hasCapability(String capabilityURI)
- Parameters:
capabilityURI
-
- Returns:
- True, if getCapability(String) returns a non-null value.
Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.