JBoss EJB client 1.0.3.Final

org.jboss.ejb.client
Class EJBClientInvocationContext

java.lang.Object
  extended by org.jboss.ejb.client.Attachable
      extended by org.jboss.ejb.client.EJBClientInvocationContext
Type Parameters:
A - the receiver attachment type

public final class EJBClientInvocationContext
extends Attachable

An interceptor context for EJB client interceptors.

Author:
David M. Lloyd

Method Summary
 void discardResult()
          Discard the result from this request.
protected  void finalize()
           
 EJBClientContext getClientContext()
          Get the EJB client context associated with this invocation.
 Map<String,Object> getContextData()
          Get the context data.
 Method getInvokedMethod()
          Get the invoked proxy method.
 Object getInvokedProxy()
          Get the invoked proxy object.
 EJBLocator<?> getLocator()
          Get the locator for the invocation target.
 Object[] getParameters()
          Get the invocation method parameters.
<T> T
getProxyAttachment(AttachmentKey<T> key)
          Get a value attached to the proxy.
protected  EJBReceiver getReceiver()
          Get the EJB receiver associated with this invocation.
 Object getResult()
          Get the invocation result from this request.
 Class<?> getViewClass()
          Get the invoked view class.
<T> T
removeProxyAttachment(AttachmentKey<T> key)
          Remove a value attached to the proxy.
 void sendRequest()
          Proceed with sending the request normally.
 
Methods inherited from class org.jboss.ejb.client.Attachable
getAttachment, putAttachment, putAttachmentIfAbsent, removeAttachment, removeAttachment, replaceAttachment, replaceAttachment
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getProxyAttachment

public <T> T getProxyAttachment(AttachmentKey<T> key)
Get a value attached to the proxy.

Type Parameters:
T - the value type
Parameters:
key - the attachment key
Returns:
the value, or null if there is none

removeProxyAttachment

public <T> T removeProxyAttachment(AttachmentKey<T> key)
Remove a value attached to the proxy.

Type Parameters:
T - the value type
Parameters:
key - the attachment key
Returns:
the value, or null if there is none

getClientContext

public EJBClientContext getClientContext()
Get the EJB client context associated with this invocation.

Returns:
the EJB client context

getContextData

public Map<String,Object> getContextData()
Get the context data. This same data will be made available verbatim to server-side interceptors via the InvocationContext.getContextData() method, and thus can be used to pass data from the client to the server (as long as all map values are Serializable).

Returns:
the context data

getLocator

public EJBLocator<?> getLocator()
Get the locator for the invocation target.

Returns:
the locator

sendRequest

public void sendRequest()
                 throws Exception
Proceed with sending the request normally.

Throws:
Exception - if the request was not successfully sent

getResult

public Object getResult()
                 throws Exception
Get the invocation result from this request. The result is not actually acquired unless all interceptors call this method. Should only be called from EJBClientInterceptor.handleInvocationResult(EJBClientInvocationContext).

Returns:
the invocation result
Throws:
Exception - if the invocation did not succeed

discardResult

public void discardResult()
                   throws IllegalStateException
Discard the result from this request. Should only be called from EJBClientInterceptor.handleInvocationResult(EJBClientInvocationContext).

Throws:
IllegalStateException - if there is no result to discard

getReceiver

protected EJBReceiver getReceiver()
Get the EJB receiver associated with this invocation.

Returns:
the EJB receiver

getInvokedProxy

public Object getInvokedProxy()
Get the invoked proxy object.

Returns:
the invoked proxy

getInvokedMethod

public Method getInvokedMethod()
Get the invoked proxy method.

Returns:
the invoked method

getParameters

public Object[] getParameters()
Get the invocation method parameters.

Returns:
the invocation method parameters

getViewClass

public Class<?> getViewClass()
Get the invoked view class.

Returns:
the invoked view class

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

JBoss EJB client 1.0.3.Final

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.