|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.remoting.callback.ServerInvokerCallbackHandler
public class ServerInvokerCallbackHandler
Responsible for all callbacks in remoting at invoker level (on the server side). This is created within the ServerInvoker and passed to the server handler as a proxy for the client's callback handler.
Will determin internally if is using pull or push mechanism for delivering callbacks. If is push, will create a Client to call back on the callback server.
Field Summary | |
---|---|
static java.lang.String |
CALLBACK_ERROR_HANDLER_KEY
The map key to use when looking up any callback error handler that should be used. |
static java.lang.String |
CALLBACK_ID
This key used to identify a Callback to be acknowledged. |
static java.lang.String |
CALLBACK_LISTENER
The key used for storing a CallbackListener in the return metadata map of a Callback. |
static java.lang.String |
CALLBACK_MEM_CEILING
The map key to use when looking up the percentage of free memory available before tiggering persistence. |
static java.lang.String |
CALLBACK_STORE_KEY
The map key to use when looking up any callback store that should be used. |
static java.lang.String |
CALLBACK_TIMEOUT
This key is used to identify the timeout used by a callback client |
static java.lang.String |
REMOTING_ACKNOWLEDGES_PUSH_CALLBACKS
|
static java.lang.String |
SERVER_INVOKER
The key used to pass to the callback client a reference to ServerInvoker |
static java.lang.String |
SERVER_INVOKER_CALLBACK_HANDLER
The key used to pass to the callback client a reference this ServerInvokerCallbackHandler |
Constructor Summary | |
---|---|
ServerInvokerCallbackHandler(InvocationRequest invocation,
InvokerLocator serverLocator,
ServerInvoker owner)
|
Method Summary | |
---|---|
void |
acknowledgeCallbacks(InternalInvocation invocation)
Calls listeners to acknowledge callbacks |
void |
connect()
|
void |
destroy()
This method is required to be called upon removing a callback listener so can clean up resources used by the handler. |
Client |
getCallbackClient()
|
java.util.List |
getCallbacks(java.util.Map metadata)
|
java.lang.String |
getCallbackSessionId()
|
java.lang.String |
getClientSessionId()
|
java.lang.String |
getId()
Returns an id that can be used to identify this particular callback handler, which should be representative of the client invoker it will make callbacks to. |
static java.lang.String |
getId(InvocationRequest invocation)
Returns an id that can be used to identify this particular callback handler, which should be representative of the client invoker it will make callbacks to. |
java.lang.Double |
getMemPercentCeiling()
|
java.lang.String |
getSubsystem()
|
void |
handleCallback(Callback callback)
Will take the callback message and send back to client. |
void |
handleCallback(Callback callback,
boolean asynch,
boolean serverSide)
For push callbacks: |
void |
handleCallbackOneway(Callback callback)
For push callbacks, will send the callback to the server invoker on the client side, hand off processing to a separate thread, and return. |
void |
handleCallbackOneway(Callback callback,
boolean serverSide)
For push callbacks: |
void |
handleConnectionException(java.lang.Throwable throwable,
Client client)
Called when a target server or client found to be dead. |
boolean |
isPullCallbackHandler()
|
boolean |
isShouldPersist()
|
void |
setMemPercentCeiling(java.lang.Double ceiling)
|
void |
setShouldPersist(boolean shouldPersist)
|
void |
shutdown()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CALLBACK_STORE_KEY
public static final java.lang.String CALLBACK_ERROR_HANDLER_KEY
public static final java.lang.String CALLBACK_MEM_CEILING
public static final java.lang.String CALLBACK_LISTENER
public static final java.lang.String REMOTING_ACKNOWLEDGES_PUSH_CALLBACKS
public static final java.lang.String CALLBACK_ID
public static final java.lang.String CALLBACK_TIMEOUT
public static final java.lang.String SERVER_INVOKER
public static final java.lang.String SERVER_INVOKER_CALLBACK_HANDLER
Constructor Detail |
---|
public ServerInvokerCallbackHandler(InvocationRequest invocation, InvokerLocator serverLocator, ServerInvoker owner) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public void connect() throws java.lang.Exception
java.lang.Exception
public java.lang.String getCallbackSessionId()
public java.lang.String getClientSessionId()
public java.lang.String getSubsystem()
public void setMemPercentCeiling(java.lang.Double ceiling)
public java.lang.Double getMemPercentCeiling()
public Client getCallbackClient()
public static java.lang.String getId(InvocationRequest invocation)
public java.lang.String getId()
public java.util.List getCallbacks(java.util.Map metadata)
public boolean isPullCallbackHandler()
public void handleCallback(Callback callback) throws HandleCallbackException
handleCallback
in interface InvokerCallbackHandler
callback
-
HandleCallbackException
public void handleCallbackOneway(Callback callback) throws HandleCallbackException
For pull callbacks, behaves the same as handleCallback(Callback callback).
handleCallbackOneway
in interface AsynchInvokerCallbackHandler
callback
-
HandleCallbackException
public void handleCallbackOneway(Callback callback, boolean serverSide) throws HandleCallbackException
if serverSide == false, will send the callback to the server invoker on the client side, hand off processing to a separate thread, and return.
if serverside == true, will hand off to a separate thread the sending of the callback and will then return.
For pull callbacks, behaves the same as handleCallback(Callback callback).
handleCallbackOneway
in interface AsynchInvokerCallbackHandler
callback
- serverSide
-
HandleCallbackException
public void handleCallback(Callback callback, boolean asynch, boolean serverSide) throws HandleCallbackException
if asynch == false, behaves the same as handleCallback(Callback callback).
if asynch == true:
if serverSide == false, will send the callback to the server invoker on the client side, hand off processing to a separate thread, and return.
if serverside == true, will hand off to a separate thread the sending of the callback and will then return.
For pull callbacks, behaves the same as handleCallback(Callback callback).
handleCallback
in interface AsynchInvokerCallbackHandler
HandleCallbackException
public void acknowledgeCallbacks(InternalInvocation invocation) throws java.lang.Exception
invocation
- carries identities of Callbacks to acknowledge and,
optionally, responses
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
public void destroy()
public void shutdown()
public void handleConnectionException(java.lang.Throwable throwable, Client client)
ConnectionListener
handleConnectionException
in interface ConnectionListener
throwable
- - original exception thrown when trying to connect to target server. If is
listener on server for client failure, the exception will be a
ClientDisconnectedException if the client disconnected normally, or null if the lease
expired.client
- - the client from which this call was made.public boolean isShouldPersist()
public void setShouldPersist(boolean shouldPersist)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |