Package org.jboss.ejb.client
Class EJBReceiver
- java.lang.Object
-
- org.jboss.ejb.client.Attachable
-
- org.jboss.ejb.client.EJBReceiver
-
public abstract class EJBReceiver extends Attachable
A receiver for Enterprise Beans invocations. Receivers can be associated with one or more client contexts. This interface is implemented by providers for Enterprise Beans invocation services.- Author:
- David M. Lloyd
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EJBReceiver()
Construct a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean
cancelInvocation(EJBReceiverInvocationContext receiverContext, boolean cancelIfRunning)
Attempt to cancel an invocation.protected SessionID
createSession(EJBReceiverSessionCreationContext receiverContext)
Creates a session for a stateful session bean represented by the passed app name, module name, distinct name and bean name combination.protected StatefulEJBLocator<?>
createSession$$bridge(EJBReceiverSessionCreationContext receiverContext)
Deprecated.Compatibility bridge, remove at Final.protected InetSocketAddress
getSourceAddress(InetSocketAddress destination)
Query the expected or actual source IP address configured for the given target URI.protected boolean
isConnected(URI uri)
Determine if the given target URI is "connected".protected abstract void
processInvocation(EJBReceiverInvocationContext receiverContext)
Process the invocation.-
Methods inherited from class org.jboss.ejb.client.Attachable
getAttachment, getAttachments, putAttachment, putAttachmentIfAbsent, removeAttachment, removeAttachment, replaceAttachment, replaceAttachment
-
-
-
-
Method Detail
-
processInvocation
protected abstract void processInvocation(EJBReceiverInvocationContext receiverContext) throws Exception
Process the invocation. Implementations of this method should always execute the operation asynchronously. The operation result should be passed in to the receiver invocation context. To ensure ideal GC behavior, the receiver should discard any reference to the invocation context(s) once the result producer has been set.- Parameters:
receiverContext
- The Enterprise Beans receiver invocation context- Throws:
Exception
- if the operation throws an exception
-
cancelInvocation
protected boolean cancelInvocation(EJBReceiverInvocationContext receiverContext, boolean cancelIfRunning)
Attempt to cancel an invocation. Implementations should make a reasonable effort to determine whether the operation was actually cancelled; however it is permissible to fall back to returningfalse
if it cannot be discovered.- Parameters:
receiverContext
- the Enterprise Beans receiver invocation contextcancelIfRunning
-true
to request that the cancellation proceed even if the method is running- Returns:
true
if the operation was definitely cancelled immediately,false
otherwise
-
createSession
protected SessionID createSession(EJBReceiverSessionCreationContext receiverContext) throws Exception
Creates a session for a stateful session bean represented by the passed app name, module name, distinct name and bean name combination. Returns aStatefulEJBLocator
representing the newly created session. The returned locator should have the same view type as the requested locator.- Parameters:
receiverContext
- the Enterprise Beans receiver session creation context- Returns:
- the session ID for the newly opened session
- Throws:
IllegalArgumentException
- if the session creation request is made for a bean which is not a stateful session beanException
-
createSession$$bridge
protected StatefulEJBLocator<?> createSession$$bridge(EJBReceiverSessionCreationContext receiverContext) throws Exception
Deprecated.Compatibility bridge, remove at Final.- Throws:
Exception
-
getSourceAddress
protected InetSocketAddress getSourceAddress(InetSocketAddress destination)
Query the expected or actual source IP address configured for the given target URI.- Parameters:
destination
- the supported URI of the peer (notnull
)- Returns:
- the socket address, or
null
if none is known
-
isConnected
protected boolean isConnected(URI uri)
Determine if the given target URI is "connected". Connectionless or connect-per-request protocols can inherit the default, which always returnstrue
.- Parameters:
uri
- the supported URI of the peer (notnull
)- Returns:
true
if the peer is readily available,false
otherwise
-
-