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 AbstractCapability

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

All Implemented Interfaces:
  Capability, Initialization, InitializationParameters, Shutdown

Direct Known Subclasses:
  AbstractAdvertisement, AbstractWsResourceCapability, SimpleMetadataExchange, SimpleNotificationConsumer

public abstract class AbstractCapability
extends java.lang.Object
implements Capability

AbstractCapability provides a foundation for user-defined capabilities by allowing users to focus on their operations and capability-specific logic without having to worry about maintaining Muse components and other plumbing work.
The implementations of the initialization and shutdown routines are mostly no-ops. Nevertheless, if these methods are overridden by concrete capability classes, the implementations should be sure to call the parent class version (via 'super') before executing their own logic; for example, a new version of the initialize() method should always start with a call to super.initialize(). As the class hierarchy grows, this ensures that startup and shutdown tasks are always performed in the proper order.

Author:
  Dan Jemiolo (danj)

Constructor Summary
`AbstractCapability()`

Method Summary
`java.util.Collection` | `getActions()`
`java.lang.String` | `getCapabilityURI()`
`Environment` | `getEnvironment()`
`java.lang.String` | `getInitializationParameter(java.lang.String name)`
`java.util.Map` | `getInitializationParameters()`
`java.util.logging.Logger` | `getLog()`
`MessageHandler` | `getMessageHandler(java.lang.String action)`
`Persistence` | `getPersistence()`
`Resource` | `getResource()`
`boolean` | `hasBeenInitialized()`
`boolean` | `hasBeenShutdown()`
`void` | `initialize()`
`void` | `initializeCompleted()` This method is called by the containing Resource after all other capabilities have been initialized via initialize().
`void` | `prepareShutdown()` This method is called prior to shutdown() and allows the capability to do any shutdown tasks that require the presence of certain other capabilities.
`void` | `setCapabilityURI(java.lang.String capabilityURI)`
`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)`
`protected void` | `setMessageHandler(MessageHandler handler)`
`void` | `setMessageHandlers(java.util.Collection handlers)`
`void` | `setPersistence(Persistence persistence)`
`void` | `setResource(Resource resource)`
`void` | `shutdown()`

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

Constructor Detail

### AbstractCapability

    public AbstractCapability()

Method Detail

### getActions

    public java.util.Collection getActions()

  Specified by:
    `getActions` in interface `Capability`
  Returns:
    All of the WS-A Action URIs for which the capability has a MessageHandler.
  See Also:
    `Capability.getMessageHandler(String)`

### getCapabilityURI

    public java.lang.String getCapabilityURI()

  Specified by:
    `getCapabilityURI` in interface `Capability`
  Returns:
    The unique URI (within the resource type) that defines this capability.

### getEnvironment

    public Environment getEnvironment()

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

### getInitializationParameter

    public 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 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 java.util.logging.Logger getLog()

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

### getMessageHandler

    public MessageHandler getMessageHandler(java.lang.String action)

  Specified by:
    `getMessageHandler` in interface `Capability`
  Parameters:
    `action` -
  Returns:
    This method is called as part of the containing Resource's method invocation process; it allows the capability to specify the handler that will parse the request/response for the method.
  See Also:
    `Capability.getActions()`

### getPersistence

    public Persistence getPersistence()

  Specified by:
    `getPersistence` in interface `Capability`
  Returns:
    The persistence mechanism for this capability, or null if none was defined.

### getResource

    public Resource getResource()

  Specified by:
    `getResource` in interface `Capability`
  Returns:
    The resource that contains this capability instance.

### hasBeenInitialized

    public boolean hasBeenInitialized()

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

### hasBeenShutdown

    public 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.

### initialize

    public void initialize()
                    throws SoapFault

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

### initializeCompleted

    public void initializeCompleted()
                             throws SoapFault

  Description copied from interface: `Capability`
  This method is called by the containing Resource after all other capabilities have been initialized via initialize(). It allows the Capability to do initialization work that requires the presence of certain other capabilities. This "post-initialization" state is necessary because capability definition and creation is non-deterministic, and users cannot make any assumptions about the order of those tasks.

  Specified by:
    `initializeCompleted` in interface `Capability`
  Throws:
    `SoapFault`

### prepareShutdown

    public void prepareShutdown()
                         throws SoapFault

  Description copied from interface: `Capability`
  This method is called prior to shutdown() and allows the capability to do any shutdown tasks that require the presence of certain other capabilities. Once shutdown() is called, the capability cannot be certain that the other capabilities it depends on have not already been shutdown as well, so this "pre-shutdown" state gives it this opportunity.

  Specified by:
    `prepareShutdown` in interface `Capability`
  Throws:
    `SoapFault`

### setCapabilityURI

    public void setCapabilityURI(java.lang.String capabilityURI)

  Specified by:
    `setCapabilityURI` in interface `Capability`

### setEnvironment

    public void setEnvironment(Environment environment)

  Specified by:
    `setEnvironment` in interface `Capability`

### setInitializationParameters

    public 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 void setLog(java.util.logging.Logger log)

  Specified by:
    `setLog` in interface `Capability`

### setMessageHandler

    protected void setMessageHandler(MessageHandler handler)

### setMessageHandlers

    public void setMessageHandlers(java.util.Collection handlers)

  Specified by:
    `setMessageHandlers` in interface `Capability`

### setPersistence

    public void setPersistence(Persistence persistence)

  Specified by:
    `setPersistence` in interface `Capability`

### setResource

    public void setResource(Resource resource)

  Specified by:
    `setResource` in interface `Capability`

### shutdown

    public void shutdown()
                  throws SoapFault

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

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