net.xoetrope.optional.service
Class ServiceContext

java.lang.Object
  extended by net.xoetrope.optional.service.ServiceContext

public class ServiceContext
extends java.lang.Object

Context object to be passed through routes as a way to pass and return parameters. Errors are also stored and should be checked by each ServiceProxy in the services route.

Copyright (c) Xoetrope Ltd., 2001-2006, see license.txt for details


Constructor Summary
ServiceContext()
          Creates a new instance of ServiceContext
 
Method Summary
 void addError(java.lang.String error)
          Adds an error to the errors Vector in the ServiceProxyArgs instance
 ServiceProxyArgs getArgs()
          Retrieve the ServiceProxyArgs for this instance
 java.util.Vector getErrors()
          Retrieve the errors Vector
 java.util.Hashtable getPassArgs()
          Retrieve the pass arguments Hashtable
 java.util.Hashtable getReturnArgs()
          Retrieve the return arguments Hashtable
 java.lang.Object getReturnValue()
          Get the value of the default return argument....ServiceProxy.RETURN_VALUE There is no guarantee that this will contain a valid value and the implementation depends on the service chain.
 boolean hasErrors()
          If the errors hashtable has any entries then an error has been generated.
 boolean hasReturnValue()
          Is the return value available and non null
 void setReturnValue(java.lang.Object value)
          Set the value of the default return argument...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceContext

public ServiceContext()
Creates a new instance of ServiceContext

Method Detail

getArgs

public ServiceProxyArgs getArgs()
Retrieve the ServiceProxyArgs for this instance

Returns:
The ServiceProxyArgs

getPassArgs

public java.util.Hashtable getPassArgs()
Retrieve the pass arguments Hashtable

Returns:
The Hashtable of pass arguments

getReturnArgs

public java.util.Hashtable getReturnArgs()
Retrieve the return arguments Hashtable

Returns:
The Hashtable of return arguments

getReturnValue

public java.lang.Object getReturnValue()
Get the value of the default return argument....ServiceProxy.RETURN_VALUE There is no guarantee that this will contain a valid value and the implementation depends on the service chain.

Returns:
the default return value

setReturnValue

public void setReturnValue(java.lang.Object value)
Set the value of the default return argument... ServiceProxy.RETURN_VALUE There is no guarantee that this will contain a valid value and the implementation depends on the service chain.


hasReturnValue

public boolean hasReturnValue()
Is the return value available and non null

Returns:
true if a useful return value is available

getErrors

public java.util.Vector getErrors()
Retrieve the errors Vector

Returns:
the error hashtable

hasErrors

public boolean hasErrors()
If the errors hashtable has any entries then an error has been generated.

Returns:
boolean indicating whether or not errors have been generated.

addError

public void addError(java.lang.String error)
Adds an error to the errors Vector in the ServiceProxyArgs instance

Parameters:
error - The error to be added