use of org.apache.jackrabbit.oak.spi.security.authentication.callback.WhiteboardCallback in project jackrabbit-oak by apache.
the class CallbackHandlerImplTest method handleWhiteboardCallback.
@Test
public void handleWhiteboardCallback() throws Exception {
WhiteboardCallback cb = new WhiteboardCallback();
callbackHandler.handle(new Callback[] { cb });
assertSame(whiteboard, cb.getWhiteboard());
}
use of org.apache.jackrabbit.oak.spi.security.authentication.callback.WhiteboardCallback in project jackrabbit-oak by apache.
the class AbstractLoginModule method getWhiteboard.
/**
* Tries to obtain the {@code Whiteboard} object from the callback
* handler using a new WhiteboardCallback and keeps the value as
* private field. If the callback handler isn't able to handle the
* WhiteboardCallback this method returns {@code null}.
*
* @return The {@code Whiteboard} associated with this
* {@code LoginModule} or {@code null}.
*/
@CheckForNull
protected Whiteboard getWhiteboard() {
if (whiteboard == null && callbackHandler != null) {
WhiteboardCallback cb = new WhiteboardCallback();
try {
callbackHandler.handle(new Callback[] { cb });
whiteboard = cb.getWhiteboard();
} catch (Exception e) {
log.debug("Unable to retrieve the Whiteboard via callback", e);
}
}
return whiteboard;
}
Aggregations