org.apache.ws.resource
Class ResourceContext

java.lang.Object
  extended byorg.apache.ws.resource.ResourceContext
Direct Known Subclasses:
AbstractResourceContext

public abstract class ResourceContext
extends java.lang.Object

LOG-DONE ResourceContext wraps around a SOAPMessageContext and provides convenience functions for obtaining ResourceKey, ResourceHome, and resource objects associated with the given SOAP message (referenced in SOAPMessageContext).


Constructor Summary
protected ResourceContext()
          Creates a new ResourceContext object.
 
Method Summary
abstract  boolean containsProperty(java.lang.String name)
           
abstract  java.lang.Object getProperty(java.lang.String name)
           
abstract  java.util.Iterator getPropertyNames()
           
abstract  Resource getResource()
          Gets actual resource.
static ResourceContext getResourceContext(javax.xml.rpc.handler.soap.SOAPMessageContext soapMsgContext)
          Returns ResourceContext initialized with a specific SOAPMessageContext.
abstract  ResourceHome getResourceHome()
          Gets ResourceHome associated with the service.
abstract  ResourceKey getResourceKey()
          Gets ResourceKey instance using ResourceHome lookup.
abstract  ResourceKey getResourceKey(javax.xml.namespace.QName keyName, java.lang.Class keyClass)
          Gets ResourceKey of a given name and type.
abstract  javax.xml.soap.SOAPHeaderElement getResourceKeyHeader()
          Gets SOAPHeaderElement that contains the resource key for the service using ResourceHome lookup.
abstract  javax.xml.soap.SOAPHeaderElement getResourceKeyHeader(javax.xml.namespace.QName keyName)
          Gets SOAPHeaderElement of the specified name that contains the resource key.
abstract  java.lang.String getServiceName()
          Gets path of the service.
abstract  java.net.URL getServiceURL()
          Gets the full URL of the service
abstract  javax.xml.soap.SOAPMessage getSOAPMessage()
          DOCUMENT_ME
abstract  void removeProperty(java.lang.String name)
           
abstract  void setProperty(java.lang.String name, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceContext

protected ResourceContext()
Creates a new ResourceContext object.

Method Detail

setProperty

public abstract void setProperty(java.lang.String name,
                                 java.lang.Object value)
See Also:
MessageContext.setProperty(String, Object)

getProperty

public abstract java.lang.Object getProperty(java.lang.String name)
See Also:
MessageContext.getProperty(String)

getPropertyNames

public abstract java.util.Iterator getPropertyNames()
See Also:
MessageContext.getPropertyNames()

getResource

public abstract Resource getResource()
                              throws ResourceContextException,
                                     ResourceException
Gets actual resource.

Returns:
The actual resource object. Cannot be null.
Throws:
NoSuchResourceException - if resource was not specified in the request or it does not exist.
ResourceContextException - if error occurs during resource lookup.
ResourceException

getResourceHome

public abstract ResourceHome getResourceHome()
                                      throws ResourceContextException
Gets ResourceHome associated with the service.

Returns:
ResourceHome associated with the service. Cannot be null.
Throws:
NoResourceHomeException - if ResourceHome is not configured for the specified service.
ResourceContextException - if any other error.

getResourceKey

public abstract ResourceKey getResourceKey(javax.xml.namespace.QName keyName,
                                           java.lang.Class keyClass)
                                    throws ResourceContextException,
                                           ResoureKeyHeaderNotFoundFaultException
Gets ResourceKey of a given name and type.

Returns:
ResourceKey of the given type and name. Returns null if the key of the specified name was not found in the message.
Throws:
ResourceContextException - if error occurs during lookup.
ResoureKeyHeaderNotFoundFaultException

getResourceKeyHeader

public abstract javax.xml.soap.SOAPHeaderElement getResourceKeyHeader()
                                                               throws ResourceContextException
Gets SOAPHeaderElement that contains the resource key for the service using ResourceHome lookup.

Returns:
The SOAPHeaderElement that contains the resource key for the service. Returns null if one not found.
Throws:
ResourceContextException - if error occurs during lookup.
See Also:
getResourceHome()

getResourceKeyHeader

public abstract javax.xml.soap.SOAPHeaderElement getResourceKeyHeader(javax.xml.namespace.QName keyName)
                                                               throws ResourceContextException
Gets SOAPHeaderElement of the specified name that contains the resource key.

Returns:
The SOAPHeaderElement that contains the resource key of the given name. Returns null if one not found.
Throws:
ResourceContextException - if error occurs during lookup.

getSOAPMessage

public abstract javax.xml.soap.SOAPMessage getSOAPMessage()
DOCUMENT_ME

Returns:
DOCUMENT_ME

getResourceContext

public static ResourceContext getResourceContext(javax.xml.rpc.handler.soap.SOAPMessageContext soapMsgContext)
Returns ResourceContext initialized with a specific SOAPMessageContext.

Returns:
ResourceContext initialized with a specific SOAPMessageContext.

getResourceKey

public abstract ResourceKey getResourceKey()
                                    throws ResourceContextException
Gets ResourceKey instance using ResourceHome lookup.

Returns:
ResourceKey of name and type associated with the target service' ResourceHome. Returns null if key is not found in the message.
Throws:
ResourceContextException - if error occurs during lookup.
See Also:
getResourceHome()

getServiceName

public abstract java.lang.String getServiceName()
Gets path of the service.

Returns:
The path of the service.

getServiceURL

public abstract java.net.URL getServiceURL()
Gets the full URL of the service

Returns:
The URL of the service

containsProperty

public abstract boolean containsProperty(java.lang.String name)
See Also:
MessageContext.containsProperty(String)

removeProperty

public abstract void removeProperty(java.lang.String name)
See Also:
MessageContext.removeProperty(String)


Copyright © 2004-2005 Apache Software Foundation. All Rights Reserved.