org.globus.wsrf
Class ResourceContext

java.lang.Object
  extended byorg.globus.wsrf.ResourceContext
Direct Known Subclasses:
ResourceContextImpl

public abstract class ResourceContext
extends java.lang.Object

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()
           
 
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()
          Returns ResourceContext associated with the current thread.
static ResourceContext getResourceContext(javax.xml.rpc.handler.soap.SOAPMessageContext ctx)
          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 getService()
          Gets path of the service.
abstract  java.net.URL getServiceURL()
          Gets the full URL of the service
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()
Method Detail

getResourceContext

public static ResourceContext getResourceContext()
                                          throws ResourceContextException
Returns ResourceContext associated with the current thread.

Returns:
ResourceContext associated with the current thread.
Throws:
ResourceContextException

getResourceContext

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

Returns:
ResourceContext initialized with a specific SOAPMessageContext.
Throws:
ResourceContextException

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()

getResourceKey

public abstract ResourceKey getResourceKey(javax.xml.namespace.QName keyName,
                                           java.lang.Class keyClass)
                                    throws ResourceContextException
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.

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.

getResourceHome

public abstract ResourceHome getResourceHome()
                                      throws ResourceContextException,
                                             NoResourceHomeException
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.

getService

public abstract java.lang.String getService()
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

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

containsProperty

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

getProperty

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

removeProperty

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

setProperty

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

getPropertyNames

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