Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.muse.core
Class SimpleResource

    java.lang.Object
      org.apache.muse.core.SimpleResource

All Implemented Interfaces:
  org.apache.muse.core.CapabilityContainer, Initialization, InitializationParameters, Resource, Shutdown

Direct Known Subclasses:
  SimpleWsResource

public class SimpleResource
extends java.lang.Object
implements Resource

SimpleResource is Muse's default implementation of the core resource type component. It provides all the code needed to collect capabilities and delegate request to them, as well as a central place for them to find and contact each other.

Author:
  Dan Jemiolo (danj)

Constructor Summary
`SimpleResource()`

Method Summary
`void` | `addCapability(Capability capability)` Registers the given capability instance with the resource.
`Capability` | `getCapability(java.lang.String capabilityURI)`
`protected java.util.Collection` | `getCapabilityActions()`
`protected Capability` | `getCapabilityForAction(java.lang.String action)`
`java.util.Collection` | `getCapabilityURIs()`
`java.lang.String` | `getContextPath()`
`EndpointReference` | `getEndpointReference()`
`Environment` | `getEnvironment()`
`java.lang.String` | `getInitializationParameter(java.lang.String name)`
`java.util.Map` | `getInitializationParameters()`
`java.util.logging.Logger` | `getLog()`
`ResourceManager` | `getResourceManager()`
`java.lang.String` | `getWsdlPath()`
`QName` | `getWsdlPortType()`
`boolean` | `hasBeenInitialized()`
`boolean` | `hasBeenShutdown()`
`boolean` | `hasCapability(java.lang.String capabilityURI)`
`void` | `initialize()`
`protected void` | `initializeCapabilities()` This method can be overridden to provide additional capability initialization logic that applies generally to all capabilities.
`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.
`void` | `setContextPath(java.lang.String contextPath)`
`void` | `setEndpointReference(EndpointReference epr)`
`void` | `setEnvironment(Environment environment)`
`void` | `setInitializationParameters(java.util.Map parameters)` Allows the resource's creator to provide it with arbitrary name-value pairs that may be used during initialization.
`void` | `setLog(java.util.logging.Logger log)`
`void` | `setResourceManager(ResourceManager manager)`
`void` | `setWsdlPath(java.lang.String wsdlPath)`
`void` | `setWsdlPortType(QName wsdlPortType)`
`void` | `shutdown()` This implementation double-checks to make sure the resource hasn't already been destroyed and then nulls-out all references to internal data structures (this will highlight bugs caused by stale references and prevent "undefined behavior").
`protected void` | `shutdownCapabilities()` This method can be overridden to provide additional capability shutdown logic that applies generally to all capabilities.
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### SimpleResource

    public SimpleResource()

Method Detail

### addCapability

    public void addCapability(Capability capability)

  Description copied from interface: `org.apache.muse.core.CapabilityContainer`
  Registers the given capability instance with the resource.

  Specified by:
    `addCapability` in interface `org.apache.muse.core.CapabilityContainer`
  Parameters:
    `capability` -

### getCapability

    public final Capability getCapability(java.lang.String capabilityURI)

  Specified by:
    `getCapability` in interface `org.apache.muse.core.CapabilityContainer`
  Parameters:
    `capabilityURI` -
  Returns:
    The Capability associated with the given URI, or null if no such capability exists.

### getCapabilityActions

    protected java.util.Collection getCapabilityActions()

  Returns:
    All of the WS-A Action URIs supported by this resource.

### getCapabilityForAction

    protected Capability getCapabilityForAction(java.lang.String action)

  Parameters:
    `action` - A WS-A Action URI.
  Returns:
    The Capability object with the method that maps to the given WS-A Action URI.

### getCapabilityURIs

    public final java.util.Collection getCapabilityURIs()

  Specified by:
    `getCapabilityURIs` in interface `org.apache.muse.core.CapabilityContainer`
  Returns:
    A collection with all of the capabilities' URIs.

### getContextPath

    public final java.lang.String getContextPath()

  Specified by:
    `getContextPath` in interface `Resource`
  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()

  Specified by:
    `getEndpointReference` in interface `Resource`
  Returns:
    The unique EPR of the resource instance.

### getEnvironment

    public final Environment getEnvironment()

  Specified by:
    `getEnvironment` in interface `Resource`
  Returns:
    The resource's access point for things such as the WS-Addressing context, file system resources, and more.

### getInitializationParameter

    public final java.lang.String getInitializationParameter(java.lang.String name)

  Specified by:
    `getInitializationParameter` in interface `InitializationParameters`
  Parameters:
    `name` -
  Returns:
    The value of the initialization parameter, or null if it does not exist.

### getInitializationParameters

    public final java.util.Map getInitializationParameters()

  Specified by:
    `getInitializationParameters` in interface `InitializationParameters`
  Returns:
    The set of name-value pairs provided at initialization time. The Map may be empty.

### getLog

    public final java.util.logging.Logger getLog()

  Specified by:
    `getLog` in interface `Resource`
  Returns:
    The JDK logger that writes to the Muse log file.

### getResourceManager

    public ResourceManager getResourceManager()

  Specified by:
    `getResourceManager` in interface `Resource`
  Returns:
    The ResourceManager that stores all of the resource type definitions and all current resource instances.

### getWsdlPath

    public final java.lang.String getWsdlPath()

  Specified by:
    `getWsdlPath` in interface `Resource`
  Returns:
    The relative path of the WSDL file with the resource's portType.

### getWsdlPortType

    public final QName getWsdlPortType()

  Specified by:
    `getWsdlPortType` in interface `Resource`
  Returns:
    The WSDL portType that defines the resource.

### hasBeenInitialized

    public final boolean hasBeenInitialized()

  Specified by:
    `hasBeenInitialized` in interface `Initialization`
  Returns:
    True, if the initialize() method has been called and run to completion successfully.

### hasBeenShutdown

    public final boolean hasBeenShutdown()

  Specified by:
    `hasBeenShutdown` in interface `Shutdown`
  Returns:
    True, if the shutdown() method has been called and run to completion successfully. If true, no other methods should be called on this Resource object.

### hasCapability

    public final boolean hasCapability(java.lang.String capabilityURI)

  Specified by:
    `hasCapability` in interface `org.apache.muse.core.CapabilityContainer`
  Parameters:
    `capabilityURI` -
  Returns:
    True, if getCapability(String) returns a non-null value.

### initialize

    public void initialize()
                    throws SoapFault

  Specified by:
    `initialize` in interface `Initialization`
  Throws:
    `SoapFault`

### initializeCapabilities

    protected void initializeCapabilities()
                                   throws SoapFault

  This method can be overridden to provide additional capability initialization logic that applies generally to all capabilities. Capability-specific initialization logic should be provided by overriding Capability.initialize().

  Throws:
    `SoapFault`

### invoke

    public org.w3c.dom.Element invoke(org.w3c.dom.Element soapBody)

  Description copied from interface: `Resource`
  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.

  Specified by:
    `invoke` in interface `Resource`
  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 final void setContextPath(java.lang.String contextPath)

  Specified by:
    `setContextPath` in interface `Resource`

### setEndpointReference

    public final void setEndpointReference(EndpointReference epr)

  Specified by:
    `setEndpointReference` in interface `Resource`

### setEnvironment

    public final void setEnvironment(Environment environment)

  Specified by:
    `setEnvironment` in interface `Resource`

### setInitializationParameters

    public final void setInitializationParameters(java.util.Map parameters)

  Description copied from interface: `InitializationParameters`
  Allows the resource's creator to provide it with arbitrary name-value pairs that may be used during initialization. The way that these values are used and/or stored is an implementation detail, and there is no requirement that this feature be used - it is a generic way to specify deployment/initialization parameters. This method should be called before the resource is initialized.

  Specified by:
    `setInitializationParameters` in interface `InitializationParameters`
  Parameters:
    `parameters` - A simple set of name-value pairs - Map[String, String] - that contains initialization parameters for the resource.

### setLog

    public final void setLog(java.util.logging.Logger log)

  Specified by:
    `setLog` in interface `Resource`

### setResourceManager

    public void setResourceManager(ResourceManager manager)

  Specified by:
    `setResourceManager` in interface `Resource`

### setWsdlPath

    public final void setWsdlPath(java.lang.String wsdlPath)

  Specified by:
    `setWsdlPath` in interface `Resource`

### setWsdlPortType

    public final void setWsdlPortType(QName wsdlPortType)

  Specified by:
    `setWsdlPortType` in interface `Resource`

### shutdown

    public void shutdown()
                  throws SoapFault

  This implementation double-checks to make sure the resource hasn't already been destroyed and then nulls-out all references to internal data structures (this will highlight bugs caused by stale references and prevent "undefined behavior").

  Specified by:
    `shutdown` in interface `Shutdown`
  Throws:
    `SoapFault`

### shutdownCapabilities

    protected void shutdownCapabilities()
                                 throws SoapFault

  This method can be overridden to provide additional capability shutdown logic that applies generally to all capabilities. Capability-specific shutdown logic should be provided by overriding Capability.shutdown().

  Throws:
    `SoapFault`

### toString

    public java.lang.String toString()

  Returns:
    The resource's EPR, in string form.

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD