uk.ac.soton.itinnovation.grid.comms.client
Class BaseRemoteResource<T extends StorableInStateRepository>

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.comms.client.BaseRemoteResource<T>
All Implemented Interfaces:
Comparable<StorableInStateRepository>, StorableInStateRepository
Direct Known Subclasses:
BaseRemoteConversation, BaseRemoteService

public class BaseRemoteResource<T extends StorableInStateRepository>
extends Object
implements StorableInStateRepository

Non-SOAP methods common to StorableInStateRepository objects. This base class provides the implementation of the core operations supported by proxies to remote resources.

See Also:
RemoteResourceProxy, AdditionalMethods

Field Summary
protected  org.apache.axis.message.addressing.EndpointReferenceType EPR
           
protected static org.apache.log4j.Logger log
           
protected  T proxy
          The proxy object created by RemoteResourceProxy and stored in the repository.
protected  StateRepository repository
          The StateRepository that this resource is stored in.
protected  String serviceName
           
protected  String soapBinding
           
protected static Transport transport
          Used to send SOAP messages.
 
Constructor Summary
BaseRemoteResource()
           
 
Method Summary
protected  void assertNotFinished()
           
 int compareTo(StorableInStateRepository other)
           
protected  RemoteBoundMethod createMethod(Method method)
          Used by getMethod(Method).
 boolean equals(Object other)
           
protected  String getContextID()
          Value to put in the context header, or null if none.
 String getDescription()
          Returns a textual description of the object.
 URL getEndpoint()
          Get the endpoint address of the service.
 org.apache.axis.message.addressing.EndpointReferenceType getEndpointRef()
          Return an EndpointReferenceType for this conversation.
 Class<T> getInterface()
          Returns the type of this object.
 RemoteBoundMethod getMethod(Method javaMethod)
          Get a method bound to an operation on this service.
 URL getParentURL()
          Returns the URL of this object's parent.
 StateRepository getRepository()
          Get the StateRepository holding this object.
protected  String getServiceName()
          Returns the name of the service.
 URL getURL()
          Returns the globally unique identifier.
protected  Parser getWSDL()
           
 boolean hasMethod(String name)
          Test if the method is in the WSDL
protected  void initHelper()
          Perform any post-initialisation setup.
protected  Object invoke(String methodName, Object... args)
          Convenience wrapper around invokeService.
 Object invokeService(Method method, SOAPHeaderElement[] headers, Object[] args)
          Invokes the given method for this resource with the default Transport.
 Object invokeService(RemoteBoundMethod boundMethod, SOAPHeaderElement[] headers, Object[] args)
          Invokes the given method for this resource with the default Transport.
 void setDescription(String description)
          Change the textual description, as returned by getDescription.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log

EPR

protected org.apache.axis.message.addressing.EndpointReferenceType EPR

repository

protected StateRepository repository
The StateRepository that this resource is stored in.


transport

protected static final Transport transport
Used to send SOAP messages.


proxy

protected T extends StorableInStateRepository proxy
The proxy object created by RemoteResourceProxy and stored in the repository.


serviceName

protected String serviceName

soapBinding

protected String soapBinding
Constructor Detail

BaseRemoteResource

public BaseRemoteResource()
Method Detail

getWSDL

protected Parser getWSDL()

getMethod

public RemoteBoundMethod getMethod(Method javaMethod)
Get a method bound to an operation on this service. This is a caching version of createMethod(). Normally you will call invoke(java.lang.String, java.lang.Object...) instead of using this method directly.

Parameters:
javaMethod - the Java method corresponding to the SOAP operation
Returns:
a method bound to the named operation at this service

hasMethod

public boolean hasMethod(String name)
Test if the method is in the WSDL

Parameters:
name - the name of the SOAP operation
Returns:
true if there is a method 'name' in the WSDL at this service
See Also:
getMethod(Method)

createMethod

protected RemoteBoundMethod createMethod(Method method)
Used by getMethod(Method). May override in subclasses.

Parameters:
method - the Java method corresponding to the SOAP
Returns:
a method bound to the named operation at this service
See Also:
getMethod(Method)

initHelper

protected void initHelper()
Perform any post-initialisation setup. Can be overridden by subclasses. Called at the end of initProxyInternal(T, java.lang.Class, uk.ac.soton.ecs.iam.grid.comms.client.StateRepository, org.apache.axis.message.addressing.EndpointReferenceType).


getRepository

public StateRepository getRepository()
Description copied from interface: StorableInStateRepository
Get the StateRepository holding this object.

Specified by:
getRepository in interface StorableInStateRepository

getEndpoint

public URL getEndpoint()
Get the endpoint address of the service.


getURL

public URL getURL()
Description copied from interface: StorableInStateRepository
Returns the globally unique identifier. No two distinct objects may have the same URL, even if they have different types.

Specified by:
getURL in interface StorableInStateRepository

getParentURL

public URL getParentURL()
Description copied from interface: StorableInStateRepository
Returns the URL of this object's parent. Returns null if this is a top-level (service) object.

Specified by:
getParentURL in interface StorableInStateRepository

getDescription

public String getDescription()
Description copied from interface: StorableInStateRepository
Returns a textual description of the object. This can be presented to the user when choosing from a list, for example.

Specified by:
getDescription in interface StorableInStateRepository

setDescription

public void setDescription(String description)
Description copied from interface: StorableInStateRepository
Change the textual description, as returned by getDescription.

Specified by:
setDescription in interface StorableInStateRepository

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

assertNotFinished

protected void assertNotFinished()

getInterface

public Class<T> getInterface()
Description copied from interface: StorableInStateRepository
Returns the type of this object. When loading the object, a StateRepository locates a class implementing the interface and uses that for the object.

Specified by:
getInterface in interface StorableInStateRepository

invoke

protected Object invoke(String methodName,
                        Object... args)
                 throws RemoteException
Convenience wrapper around invokeService.

Throws:
RemoteException

invokeService

public Object invokeService(Method method,
                            SOAPHeaderElement[] headers,
                            Object[] args)
                     throws RemoteException
Invokes the given method for this resource with the default Transport.

Parameters:
method - the method on the interface, with a WebMethod annotation
headers - any additional SOAP headers to include in the message
args - arguments for the invocation
Returns:
the result from the service
Throws:
RemoteException

invokeService

public Object invokeService(RemoteBoundMethod boundMethod,
                            SOAPHeaderElement[] headers,
                            Object[] args)
                     throws RemoteException
Invokes the given method for this resource with the default Transport.

Parameters:
boundMethod - the method on the service
headers - any additional SOAP headers to include in the message
args - arguments for the invocation
Returns:
the result from the service
Throws:
RemoteException

getContextID

protected String getContextID()
Value to put in the context header, or null if none.


getEndpointRef

public org.apache.axis.message.addressing.EndpointReferenceType getEndpointRef()
Description copied from interface: StorableInStateRepository
Return an EndpointReferenceType for this conversation. This contains both the endpoint address of the service, and the resource itself.

Specified by:
getEndpointRef in interface StorableInStateRepository

compareTo

public int compareTo(StorableInStateRepository other)
Specified by:
compareTo in interface Comparable<StorableInStateRepository>

getServiceName

protected String getServiceName()
Returns the name of the service. Used by toString().



Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.