public abstract class EJBReceiver extends Attachable
| Constructor and Description |
|---|
EJBReceiver(String nodeName) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
associate(EJBReceiverContext context)
Handle the association of this EJB receiver with the EJB client context.
|
protected void |
beforeCompletion(EJBReceiverContext context,
TransactionID transactionID)
The before-completion hook.
|
protected boolean |
cancelInvocation(EJBClientInvocationContext clientInvocationContext,
EJBReceiverInvocationContext receiverContext)
Attempt to cancel an invocation.
|
protected boolean |
deregisterModule(String appName,
String moduleName,
String distinctName)
Deregister a module from this receiver.
|
protected abstract void |
disassociate(EJBReceiverContext context)
Remove an association of this EJB receiver with the EJB client context.
|
protected abstract boolean |
exists(String appName,
String moduleName,
String distinctName,
String beanName)
Verify the existence of a remote EJB.
|
protected String |
getNodeName()
Returns the node name corresponding to this receiver.
|
protected abstract <T> StatefulEJBLocator<T> |
openSession(EJBReceiverContext context,
Class<T> viewType,
String appName,
String moduleName,
String distinctName,
String beanName)
Creates a session for a stateful session bean represented by the passed app name, module name, distinct name
and bean name combination.
|
protected abstract void |
processInvocation(EJBClientInvocationContext clientInvocationContext,
EJBReceiverInvocationContext receiverContext)
Process the invocation.
|
protected boolean |
registerModule(String appName,
String moduleName,
String distinctName)
Register a new module to this receiver.
|
protected void |
sendCommit(EJBReceiverContext context,
TransactionID transactionID,
boolean onePhase)
Send a transaction-commit message for the given transaction ID.
|
protected void |
sendForget(EJBReceiverContext context,
TransactionID transactionID)
Send a transaction-forget message for the given transaction ID.
|
protected int |
sendPrepare(EJBReceiverContext context,
TransactionID transactionID)
Send a transaction-prepare message for the given transaction ID.
|
protected Xid[] |
sendRecover(EJBReceiverContext receiverContext,
String txParentNodeName,
int recoveryFlags)
Send a transaction recover message with the
recoveryFlags. |
protected void |
sendRollback(EJBReceiverContext context,
TransactionID transactionID)
Send a transaction-rollback message for the given transaction ID.
|
getAttachment, getAttachments, putAttachment, putAttachmentIfAbsent, removeAttachment, removeAttachment, replaceAttachment, replaceAttachmentpublic EJBReceiver(String nodeName)
protected final boolean registerModule(String appName, String moduleName, String distinctName)
appName - the app namemoduleName - the module namedistinctName - the distinct nametrue if this is a previously-unknown registrationprotected final boolean deregisterModule(String appName, String moduleName, String distinctName)
appName - the app namemoduleName - the module namedistinctName - the distinct nametrue if the registration was presentprotected abstract void associate(EJBReceiverContext context)
context - the receiver contextprotected abstract void disassociate(EJBReceiverContext context)
context - the receiver contextprotected abstract void processInvocation(EJBClientInvocationContext clientInvocationContext, EJBReceiverInvocationContext receiverContext) throws Exception
clientInvocationContext - the interceptor clientInvocationContextreceiverContext - The EJB receiver invocation contextException - if the operation throws an exceptionprotected boolean cancelInvocation(EJBClientInvocationContext clientInvocationContext, EJBReceiverInvocationContext receiverContext)
false if
it cannot be discovered.clientInvocationContext - the original clientInvocationContextreceiverContext - the EJB receiver invocation contexttrue if the operation was definitely cancelled immediately, false otherwiseprotected abstract <T> StatefulEJBLocator<T> openSession(EJBReceiverContext context, Class<T> viewType, String appName, String moduleName, String distinctName, String beanName) throws IllegalArgumentException
StatefulEJBLocator representing the newly created session.T - context - The receiver contextviewType - View classappName - The application namemoduleName - The module namedistinctName - The distinct namebeanName - The name of the beanIllegalArgumentException - If the session creation request is made for a bean which is not a stateful
session bean.protected abstract boolean exists(String appName, String moduleName, String distinctName, String beanName)
appName - The application namemoduleName - The module namedistinctName - The distinct namebeanName - The bean nameprotected int sendPrepare(EJBReceiverContext context, TransactionID transactionID) throws XAException
context - the receiver contexttransactionID - the transaction IDXA_RDONLY
or XA_OKXAException - to roll back the transactionprotected void sendCommit(EJBReceiverContext context, TransactionID transactionID, boolean onePhase) throws XAException
context - the receiver contexttransactionID - the transaction IDonePhase - true to perform a one-phase commitXAException - if the transaction commit failedprotected void sendRollback(EJBReceiverContext context, TransactionID transactionID) throws XAException
context - the receiver contexttransactionID - the transaction IDXAException - if the transaction rollback failedprotected void sendForget(EJBReceiverContext context, TransactionID transactionID) throws XAException
context - the receiver contexttransactionID - the transaction IDXAException - if the forget message failedprotected Xid[] sendRecover(EJBReceiverContext receiverContext, String txParentNodeName, int recoveryFlags) throws XAException
recoveryFlags. The receiver is expected to
returns zero or more Xids of the transaction branches that are currently in a prepared or heuristically completed state.
See XAResource.recover(int) for more details.receiverContext - The EJB receiver contextrecoveryFlags - @see XAResource.recover(int)Xids of the transaction branches that are currently in a prepared or heuristically completed state.XAException - If an error occurs during the operationprotected final String getNodeName()
protected void beforeCompletion(EJBReceiverContext context, TransactionID transactionID)
context - the receiver contexttransactionID - the transaction IDCopyright © 2018 JBoss by Red Hat. All rights reserved.