Class CallbackHandlerWrapper
- java.lang.Object
-
- de.aristaflow.adept2.base.security.callbackhandler.CallbackHandlerWrapper
-
- All Implemented Interfaces:
AFCallbackHandler
public class CallbackHandlerWrapper extends Object implements AFCallbackHandler
A wrapper forCallbackHandler
treated asAFCallbackHandler
. This only works locally, that is the wrapped callback handler cannot be remote. However, this wrapper can be used remotely.- Author:
- Ulrich Kreher
-
-
Field Summary
Fields Modifier and Type Field Description protected CallbackHandler
handler
The handler to which all callback requests are forwarded.
-
Constructor Summary
Constructors Constructor Description CallbackHandlerWrapper(CallbackHandler handler)
Creates a newAFCallbackHandler
that wraps the designatedCallbackHandler
appropriately.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Callback[]
handle(Callback[] callbacks)
This method is similar toCallbackHandler.handle(Callback[])
but returns the provided callbacks back to the caller.
-
-
-
Field Detail
-
handler
protected final CallbackHandler handler
The handler to which all callback requests are forwarded.
-
-
Constructor Detail
-
CallbackHandlerWrapper
public CallbackHandlerWrapper(CallbackHandler handler)
Creates a newAFCallbackHandler
that wraps the designatedCallbackHandler
appropriately.- Parameters:
handler
- The handler to which all callback requests are forwarded.
-
-
Method Detail
-
handle
public Callback[] handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
Description copied from interface:AFCallbackHandler
This method is similar toCallbackHandler.handle(Callback[])
but returns the provided callbacks back to the caller. This allows for calling this method remotely. Note that all callbacks need to be serialisable.
When called remotely, the provided callbacks are copies of the server-side objects. When changing these objects, the changes are not reflected on server side. Therefore these objects (or rather copies of them) need to be returned.- Specified by:
handle
in interfaceAFCallbackHandler
- Parameters:
callbacks
- The callbacks to be handled by this callback handler.- Returns:
- All the callbacks that should be handled by this callback handler. Just return the complete array of callbacks. Do not skip any callbacks, for instance the ones that the callback handler did not handle!
- Throws:
IOException
- If an input or output error occurs, anIOException
will be thrown.UnsupportedCallbackException
- If the implementation of this method does not support one or more of the callbacks specified in thecallbacks
parameter, anUnsupportedCallbackException
will be thrown.
-
-