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.ws.resource.impl
Class AbstractWsResourceCapability

    java.lang.Object
      org.apache.muse.core.AbstractCapability
          org.apache.muse.ws.resource.impl.AbstractWsResourceCapability

All Implemented Interfaces:
  Capability, Initialization, InitializationParameters, Shutdown, WsResourceCapability, org.apache.muse.ws.resource.WsResourceCapabilityProperties

Direct Known Subclasses:
  AbstractManageabilityCapability, SimpleEntry, SimpleGetCapability, SimpleImmediateTermination, SimpleNotificationProducer, SimplePullPoint, SimplePullPointCreation, SimpleQueryCapability, SimpleScheduledTermination, SimpleServiceGroup, SimpleServiceGroupRegistration, SimpleSetCapability, SimpleSubscriptionManager

public abstract class AbstractWsResourceCapability
extends AbstractCapability
implements WsResourceCapability

AbstractWsResourceCapability is a foundation for user-defined capabilities for WSRF-based resources. It builds on the utilities of its parent class by providing the plumbing code needed to map WSRP requests to getter/setter methods in the concrete capability class. For example, it provides the logic needed to map a WSRP GetResourceProperty request for property myns:Widget to the getWidget() method in the concrete class (if getWidget() is not defined, a fault is thrown at initialization time).
This class allows users to implement their capabilities' properties using simple getter/setter logic (like a traditional Java bean) or more complicated APIs, but they do not have to worry about the XML and spec restrictions that are needed to implement WSRP operations. The combination of the getter/setter methods and the WSRP document schema gives this class everything it needs to transform Java beans into the foundation for WSRP.

Author:
  Dan Jemiolo (danj)

Constructor Summary
`AbstractWsResourceCapability()`

Method Summary
`protected void` | `createGettersAndSetters(QName propertyName)`
`void` | `deleteProperty(QName propertyQName)`
`protected java.lang.reflect.Method` | `getGetter(QName propertyQName)`
`org.w3c.dom.Element[]` | `getProperty(QName propertyQName)`
`protected org.w3c.dom.Element[]` | `getPropertyElements(QName name, java.lang.Object value)`
`QName[]` | `getPropertyNames()` Concrete capability classes that define properties MUST override this method and provide the names of the properties.
`protected java.lang.reflect.Method` | `getSetter(QName propertyQName)`
`WsResource` | `getWsResource()`
`void` | `initialize()` AbstractWsResourceCapability continues the initialization process by inspecting the concrete class to find all of the getters (and, if applicable, setters) for its resource properties.
`void` | `insertProperty(QName propertyQName, org.w3c.dom.Element[] values)`
`protected java.lang.Object` | `invokeMethod(java.lang.reflect.Method method, java.lang.Object[] params)`
`void` | `setResource(Resource resource)`
`void` | `updateProperty(QName propertyQName, org.w3c.dom.Element[] values)`

Methods inherited from class org.apache.muse.core.AbstractCapability
`getActions, getCapabilityURI, getEnvironment, getInitializationParameter, getInitializationParameters, getLog, getMessageHandler, getPersistence, getResource, hasBeenInitialized, hasBeenShutdown, initializeCompleted, prepareShutdown, setCapabilityURI, setEnvironment, setInitializationParameters, setLog, setMessageHandler, setMessageHandlers, setPersistence, shutdown`

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

Methods inherited from interface org.apache.muse.core.Capability
`getActions, getCapabilityURI, getEnvironment, getLog, getMessageHandler, getPersistence, getResource, initializeCompleted, prepareShutdown, setCapabilityURI, setEnvironment, setLog, setMessageHandlers, setPersistence`

Methods inherited from interface org.apache.muse.core.Initialization
`hasBeenInitialized`

Methods inherited from interface org.apache.muse.core.InitializationParameters
`getInitializationParameter, getInitializationParameters, setInitializationParameters`

Methods inherited from interface org.apache.muse.core.Shutdown
`hasBeenShutdown, shutdown`

Constructor Detail

### AbstractWsResourceCapability

    public AbstractWsResourceCapability()

Method Detail

### createGettersAndSetters

    protected void createGettersAndSetters(QName propertyName)

### deleteProperty

    public void deleteProperty(QName propertyQName)
                        throws BaseFault

  Specified by:
    `deleteProperty` in interface `org.apache.muse.ws.resource.WsResourceCapabilityProperties`
  Throws:
    `BaseFault`

### getGetter

    protected java.lang.reflect.Method getGetter(QName propertyQName)

### getProperty

    public org.w3c.dom.Element[] getProperty(QName propertyQName)
                                      throws BaseFault

  Specified by:
    `getProperty` in interface `org.apache.muse.ws.resource.WsResourceCapabilityProperties`
  Throws:
    `BaseFault`

### getPropertyElements

    protected org.w3c.dom.Element[] getPropertyElements(QName name,
                                                        java.lang.Object value)
                                                 throws BaseFault

  Parameters:
    `name` -
    `value` -
  Returns:
    The XML representation of the resource property value(s).
  Throws:
    `BaseFault`

### getPropertyNames

    public QName[] getPropertyNames()

  Description copied from interface: `org.apache.muse.ws.resource.WsResourceCapabilityProperties`
  Concrete capability classes that define properties MUST override this method and provide the names of the properties.

  Specified by:
    `getPropertyNames` in interface `org.apache.muse.ws.resource.WsResourceCapabilityProperties`
  Returns:
    The names of the resource properties defined by this capability.

### getSetter

    protected java.lang.reflect.Method getSetter(QName propertyQName)

### getWsResource

    public WsResource getWsResource()

  Specified by:
    `getWsResource` in interface `WsResourceCapability`
  Returns:
    The same as getResource(), cast to the WsResource type.

### initialize

    public void initialize()
                    throws SoapFault

  AbstractWsResourceCapability continues the initialization process by inspecting the concrete class to find all of the getters (and, if applicable, setters) for its resource properties. It then registers itself with the resource's WSRP collection so that read and write requests for its properties are delegated to it.

  Specified by:
    `initialize` in interface `Initialization`
  Overrides:
    `initialize` in class `AbstractCapability`
  Throws:
    `SoapFault`

### insertProperty

    public void insertProperty(QName propertyQName,
                               org.w3c.dom.Element[] values)
                        throws BaseFault

  Specified by:
    `insertProperty` in interface `org.apache.muse.ws.resource.WsResourceCapabilityProperties`
  Throws:
    `BaseFault`

### invokeMethod

    protected java.lang.Object invokeMethod(java.lang.reflect.Method method,
                                            java.lang.Object[] params)
                                     throws BaseFault

  Throws:
    `BaseFault`

### setResource

    public void setResource(Resource resource)

  Specified by:
    `setResource` in interface `Capability`
  Overrides:
    `setResource` in class `AbstractCapability`

### updateProperty

    public void updateProperty(QName propertyQName,
                               org.w3c.dom.Element[] values)
                        throws BaseFault

  Specified by:
    `updateProperty` in interface `org.apache.muse.ws.resource.WsResourceCapabilityProperties`
  Throws:
    `BaseFault`

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