org.jboss.invocation
Class Invocation

java.lang.Object
  extended by org.jboss.invocation.Invocation
Direct Known Subclasses:
LocalEJBInvocation, MarshalledInvocation

public class Invocation
extends Object

The Invocation object is the generic object flowing through our interceptors.

The heart of it is the payload map that can contain anything we then put readers on them. The first reader is this Invocation object that can interpret the data in it.

Essentially we can carry ANYTHING from the client to the server, we keep a series of of predefined variables and method calls to get at the pointers. But really it is just a repository of objects.

Version:
$Revision: 81030 $
Author:
Marc Fleury, Christoph G. Jung, Anil.Saldhana@redhat.com

Field Summary
 Object[] args
           
 Map as_is_payload
          as_is classes that will not be marshalled by the invocation (java.* and javax.* or anything in system classpath is OK)
 InvocationContext invocationContext
           
 InvocationType invocationType
           
static String[] INVOKE_SIGNATURE
          The signature of the invoke() method
 Method method
           
 Object objectName
           
 Map payload
          Payload will be marshalled for type hiding at the RMI layers.
 Map transient_payload
          Contextual information to the invocation that is not part of the payload.
 
Constructor Summary
Invocation()
          No-args constructor exposed for externalization only.
Invocation(Object id, Method m, Object[] args, Transaction tx, Principal identity, Object credential)
           
 
Method Summary
 Object[] getArguments()
           
 Map getAsIsPayload()
           
 Object getAsIsValue(Object key)
           
 Object getCredential()
           
 Object getEnterpriseContext()
           
 Object getId()
           
 InvocationContext getInvocationContext()
           
 Method getMethod()
          get on method Return the invocation method.
 Object getObjectName()
           
 Map getPayload()
           
 Object getPayloadValue(Object key)
           
 Principal getPrincipal()
           
 SecurityContext getSecurityContext()
           
 Transaction getTransaction()
          get the transaction.
 Map getTransientPayload()
           
 Object getTransientValue(Object key)
           
 InvocationType getType()
           
 Object getValue(Object key)
          Get a value from the stores.
 boolean isInterVM()
           
 boolean isLocal()
          Helper method to determine whether an invocation is local
 Boolean isSecure()
          Determine whether the invocation arrived on a secure channel
 Object performCall(Object instance, Method m, Object[] arguments)
          This method will be called by the container(ContainerInterceptor) to issue the ultimate method call represented by this invocation.
 void setArguments(Object[] arguments)
          A list of arguments for the method.
 void setCredential(Object credential)
          Change the security credentials of this invocation.
 void setEnterpriseContext(Object ctx)
           
 void setId(Object id)
          Return the invocation target ID.
 void setInterVM(Boolean boolValue)
           
 void setInvocationContext(InvocationContext ctx)
           
 void setMethod(Method method)
          set on method Return the invocation method.
 void setObjectName(Object objectName)
          container for server side association.
 void setPrincipal(Principal principal)
          Change the security identity of this invocation.
 void setSecure(Boolean secure)
          Set whether the invocation is secure or not
 void setSecurityContext(SecurityContext sc)
           
 void setTransaction(Transaction tx)
          set the transaction.
 void setType(InvocationType type)
          An arbitrary type.
 void setValue(Object key, Object value)
          The generic store of variables.
 void setValue(Object key, Object value, PayloadKey type)
          Advanced store Here you can pass a TYPE that indicates where to put the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVOKE_SIGNATURE

public static final String[] INVOKE_SIGNATURE
The signature of the invoke() method


transient_payload

public Map transient_payload
Contextual information to the invocation that is not part of the payload.


as_is_payload

public Map as_is_payload
as_is classes that will not be marshalled by the invocation (java.* and javax.* or anything in system classpath is OK)


payload

public Map payload
Payload will be marshalled for type hiding at the RMI layers.


invocationContext

public InvocationContext invocationContext

args

public Object[] args

objectName

public Object objectName

method

public Method method

invocationType

public InvocationType invocationType
Constructor Detail

Invocation

public Invocation()
No-args constructor exposed for externalization only.


Invocation

public Invocation(Object id,
                  Method m,
                  Object[] args,
                  Transaction tx,
                  Principal identity,
                  Object credential)
Method Detail

setValue

public void setValue(Object key,
                     Object value)
The generic store of variables.

The generic getter and setter is really all that one needs to talk to this object. We introduce typed getters and setters for convenience and code readability in the codeba


setValue

public void setValue(Object key,
                     Object value,
                     PayloadKey type)
Advanced store Here you can pass a TYPE that indicates where to put the value. TRANSIENT: the value is put in a map that WON'T be passed AS_IS: no need to marshall the value when passed (use for all JDK java types) PAYLOAD: we need to marshall the value as its type is application specific


getValue

public Object getValue(Object key)
Get a value from the stores.


getPayloadValue

public Object getPayloadValue(Object key)

getTransientValue

public Object getTransientValue(Object key)

getAsIsValue

public Object getAsIsValue(Object key)

setTransaction

public void setTransaction(Transaction tx)
set the transaction.


getTransaction

public Transaction getTransaction()
get the transaction.


setPrincipal

public void setPrincipal(Principal principal)
Change the security identity of this invocation.


getPrincipal

public Principal getPrincipal()

setCredential

public void setCredential(Object credential)
Change the security credentials of this invocation.


getCredential

public Object getCredential()

setObjectName

public void setObjectName(Object objectName)
container for server side association.


getObjectName

public Object getObjectName()

setType

public void setType(InvocationType type)
An arbitrary type.


getType

public InvocationType getType()

setId

public void setId(Object id)
Return the invocation target ID. Can be used to identify a cached object


getId

public Object getId()

setMethod

public void setMethod(Method method)
set on method Return the invocation method.


getMethod

public Method getMethod()
get on method Return the invocation method.


setArguments

public void setArguments(Object[] arguments)
A list of arguments for the method.


getArguments

public Object[] getArguments()

getInvocationContext

public InvocationContext getInvocationContext()

setInvocationContext

public void setInvocationContext(InvocationContext ctx)

setEnterpriseContext

public void setEnterpriseContext(Object ctx)

getEnterpriseContext

public Object getEnterpriseContext()

getSecurityContext

public SecurityContext getSecurityContext()

setSecurityContext

public void setSecurityContext(SecurityContext sc)

isInterVM

public boolean isInterVM()

setInterVM

public void setInterVM(Boolean boolValue)

setSecure

public void setSecure(Boolean secure)
Set whether the invocation is secure or not

Parameters:
secure - boolean value

getTransientPayload

public Map getTransientPayload()

getAsIsPayload

public Map getAsIsPayload()

getPayload

public Map getPayload()

performCall

public Object performCall(Object instance,
                          Method m,
                          Object[] arguments)
                   throws IllegalArgumentException,
                          IllegalAccessException,
                          InvocationTargetException,
                          Exception
This method will be called by the container(ContainerInterceptor) to issue the ultimate method call represented by this invocation. It is overwritten, e.g., by the WS4EE invocation in order to realize JAXRPC pre- and postprocessing.

Throws:
IllegalArgumentException
IllegalAccessException
InvocationTargetException
Exception

isLocal

public boolean isLocal()
Helper method to determine whether an invocation is local

Returns:
true when local, false otherwise

isSecure

public Boolean isSecure()
Determine whether the invocation arrived on a secure channel

Returns:
true invocation is secure


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.