org.codehaus.wadi.core.contextualiser
Interface Invocation

All Known Implementing Classes:
BasicInvocation, WebInvocation

public interface Invocation

An Invocation provides a tier agnostic encapsulation of a stateful, remote invocation of server-side logic. In the web tier this may take the form of an HttpServletRequest, HttpServletResponse and FilterChain. In the EJB world this will map onto the underlying container's proprietary Invocation type. etc... A Stateful Invocation is one that is associated with Server-side state - a Session. This Session is identified by a unique key, given to the client, which it will present along with each invocation that needs to be processed in the context of this state/Session. Some Invocation types may know how to relocate themselves from one Peer in a Cluster to another. In the e.g. web-tier, this might be achieved by e.g. redirection or proxying. In the e.g. EJB tier this might be implemented using similar strategies implemented on top of the EJB RMI's transport protocol. etc.

Version:
$Revision: 2412 $

Method Summary
 long getExclusiveSessionLockWaitTime()
           
 Session getSession()
           
 java.lang.String getSessionKey()
          Return the key carried by the Invocation associating it with server-side state - a Session
 void invoke()
          Actually make the encapsulated Invocation.
 void invoke(InvocationContext context)
           
 boolean isErrorIfSessionNotAcquired()
           
 boolean isProxiedInvocation()
           
 boolean isRelocatable()
          Does this Invocation know how to 'relocate' itself to another EndPoint ?
 InvocationContext newContext(Session context)
           
 void relocate(org.codehaus.wadi.group.EndPoint endPoint)
          Ask this Invocation to relocate itself to a given EndPoint
 void sendError(int code, java.lang.String message)
          Send an error back to the client from which the Invocation originated
 void setErrorIfSessionNotAcquired(boolean errorIfSessionNotAcquired)
           
 void setInvocationProxy(InvocationProxy proxy)
           
 void setSession(Session session)
          Attach the relevant Session to this Invocation for its lifetime
 

Method Detail

getSessionKey

java.lang.String getSessionKey()
Return the key carried by the Invocation associating it with server-side state - a Session

Returns:
the key

getSession

Session getSession()

setSession

void setSession(Session session)
Attach the relevant Session to this Invocation for its lifetime

Parameters:
session - The Session

sendError

void sendError(int code,
               java.lang.String message)
               throws InvocationException
Send an error back to the client from which the Invocation originated

Parameters:
code - an error code
message - an error message
Throws:
InvocationException

isRelocatable

boolean isRelocatable()
Does this Invocation know how to 'relocate' itself to another EndPoint ?

Returns:
whether the Invocation is capable of relocating itself.

relocate

void relocate(org.codehaus.wadi.group.EndPoint endPoint)
              throws InvocationException
Ask this Invocation to relocate itself to a given EndPoint

Parameters:
endPoint - the EndPoint
Throws:
InvocationException

invoke

void invoke()
            throws InvocationException
Actually make the encapsulated Invocation. Called when required environment has been prepared - i.e. Session has been locked into memory and attached to the Invocation via setSession().

Throws:
InvocationException

invoke

void invoke(InvocationContext context)
            throws InvocationException
Throws:
InvocationException

isProxiedInvocation

boolean isProxiedInvocation()

setInvocationProxy

void setInvocationProxy(InvocationProxy proxy)

setErrorIfSessionNotAcquired

void setErrorIfSessionNotAcquired(boolean errorIfSessionNotAcquired)

isErrorIfSessionNotAcquired

boolean isErrorIfSessionNotAcquired()

getExclusiveSessionLockWaitTime

long getExclusiveSessionLockWaitTime()

newContext

InvocationContext newContext(Session context)


Copyright © 2010. All Rights Reserved.