org.globus.wsrf.impl
Class ResourceContextImpl

java.lang.Object
  extended byorg.globus.wsrf.ResourceContext
      extended byorg.globus.wsrf.impl.ResourceContextImpl

public class ResourceContextImpl
extends ResourceContext


Field Summary
private  javax.xml.rpc.handler.soap.SOAPMessageContext context
           
private  ResourceHome home
           
private  java.lang.String homeLocation
           
private static org.globus.util.I18n i18n
           
private static org.apache.commons.logging.Log logger
           
private  javax.xml.soap.SOAPMessage message
           
private  java.lang.String service
           
private  java.net.URL serviceURL
           
 
Constructor Summary
ResourceContextImpl()
           
ResourceContextImpl(javax.xml.rpc.handler.soap.SOAPMessageContext ctx)
           
ResourceContextImpl(javax.xml.rpc.handler.soap.SOAPMessageContext ctx, javax.xml.soap.SOAPMessage msg)
           
 
Method Summary
 boolean containsProperty(java.lang.String name)
           
 java.lang.Object getProperty(java.lang.String name)
           
 java.util.Iterator getPropertyNames()
           
 Resource getResource()
          Gets actual resource.
 ResourceHome getResourceHome()
          Gets ResourceHome associated with the service.
 java.lang.String getResourceHomeLocation()
           
 ResourceKey getResourceKey()
          Gets ResourceKey instance using ResourceHome lookup.
 ResourceKey getResourceKey(javax.xml.namespace.QName keyName, java.lang.Class keyClass)
          Gets ResourceKey of a given name and type.
 javax.xml.soap.SOAPHeaderElement getResourceKeyHeader()
          Gets SOAPHeaderElement that contains the resource key for the service using ResourceHome lookup.
 javax.xml.soap.SOAPHeaderElement getResourceKeyHeader(javax.xml.namespace.QName keyName)
          Gets SOAPHeaderElement of the specified name that contains the resource key.
static javax.xml.soap.SOAPHeaderElement getResourceKeyHeader(javax.xml.soap.SOAPMessage msg, javax.xml.namespace.QName keyName, java.lang.String actorURI)
           
 java.lang.String getService()
          Returns target service associated with this context.
static java.lang.String getService(javax.xml.rpc.handler.soap.SOAPMessageContext ctx)
           
 java.net.URL getServiceURL()
          Gets the full URL of the service
static java.net.URL getServiceURL(javax.xml.rpc.handler.soap.SOAPMessageContext ctx)
           
 void removeProperty(java.lang.String name)
           
 void setProperty(java.lang.String name, java.lang.Object value)
           
 void setService(java.lang.String service)
          Sets the target service of this context.
 
Methods inherited from class org.globus.wsrf.ResourceContext
getResourceContext, getResourceContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static org.apache.commons.logging.Log logger

i18n

private static org.globus.util.I18n i18n

context

private javax.xml.rpc.handler.soap.SOAPMessageContext context

message

private javax.xml.soap.SOAPMessage message

home

private ResourceHome home

homeLocation

private java.lang.String homeLocation

service

private java.lang.String service

serviceURL

private java.net.URL serviceURL
Constructor Detail

ResourceContextImpl

public ResourceContextImpl()

ResourceContextImpl

public ResourceContextImpl(javax.xml.rpc.handler.soap.SOAPMessageContext ctx)

ResourceContextImpl

public ResourceContextImpl(javax.xml.rpc.handler.soap.SOAPMessageContext ctx,
                           javax.xml.soap.SOAPMessage msg)
Method Detail

getResourceKey

public ResourceKey getResourceKey()
                           throws ResourceContextException
Description copied from class: ResourceContext
Gets ResourceKey instance using ResourceHome lookup.

Specified by:
getResourceKey in class ResourceContext
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:
ResourceContext.getResourceHome()

getResourceKey

public ResourceKey getResourceKey(javax.xml.namespace.QName keyName,
                                  java.lang.Class keyClass)
                           throws ResourceContextException
Description copied from class: ResourceContext
Gets ResourceKey of a given name and type.

Specified by:
getResourceKey in class ResourceContext
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.

getResourceHome

public ResourceHome getResourceHome()
                             throws NoResourceHomeException,
                                    ResourceContextException
Description copied from class: ResourceContext
Gets ResourceHome associated with the service.

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

getResourceHomeLocation

public java.lang.String getResourceHomeLocation()

getResourceKeyHeader

public javax.xml.soap.SOAPHeaderElement getResourceKeyHeader()
                                                      throws ResourceContextException
Description copied from class: ResourceContext
Gets SOAPHeaderElement that contains the resource key for the service using ResourceHome lookup.

Specified by:
getResourceKeyHeader in class ResourceContext
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:
ResourceContext.getResourceHome()

getResourceKeyHeader

public javax.xml.soap.SOAPHeaderElement getResourceKeyHeader(javax.xml.namespace.QName keyName)
                                                      throws ResourceContextException
Description copied from class: ResourceContext
Gets SOAPHeaderElement of the specified name that contains the resource key.

Specified by:
getResourceKeyHeader in class ResourceContext
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.

getResource

public Resource getResource()
                     throws ResourceContextException,
                            ResourceException
Description copied from class: ResourceContext
Gets actual resource.

Specified by:
getResource in class ResourceContext
Returns:
The actual resource object. Cannot be null.
Throws:
ResourceContextException - if error occurs during resource lookup.
ResourceException

setService

public void setService(java.lang.String service)
Sets the target service of this context.

Parameters:
service - service name.

getService

public java.lang.String getService()
Returns target service associated with this context.

Specified by:
getService in class ResourceContext
Returns:
the target service that was set with setService(). If set to null or not set at all, by default it returns the target service associated with the underlying SOAP message context.

getServiceURL

public java.net.URL getServiceURL()
Description copied from class: ResourceContext
Gets the full URL of the service

Specified by:
getServiceURL in class ResourceContext
Returns:
The URL of the service

containsProperty

public boolean containsProperty(java.lang.String name)
Specified by:
containsProperty in class ResourceContext
See Also:
MessageContext.containsProperty(String)

getProperty

public java.lang.Object getProperty(java.lang.String name)
Specified by:
getProperty in class ResourceContext
See Also:
MessageContext.getProperty(String)

removeProperty

public void removeProperty(java.lang.String name)
Specified by:
removeProperty in class ResourceContext
See Also:
MessageContext.removeProperty(String)

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Specified by:
setProperty in class ResourceContext
See Also:
MessageContext.setProperty(String, Object)

getPropertyNames

public java.util.Iterator getPropertyNames()
Specified by:
getPropertyNames in class ResourceContext
See Also:
MessageContext.getPropertyNames()

getResourceKeyHeader

public static javax.xml.soap.SOAPHeaderElement getResourceKeyHeader(javax.xml.soap.SOAPMessage msg,
                                                                    javax.xml.namespace.QName keyName,
                                                                    java.lang.String actorURI)
                                                             throws javax.xml.soap.SOAPException
Throws:
javax.xml.soap.SOAPException

getService

public static java.lang.String getService(javax.xml.rpc.handler.soap.SOAPMessageContext ctx)

getServiceURL

public static java.net.URL getServiceURL(javax.xml.rpc.handler.soap.SOAPMessageContext ctx)