private <A extends AbstractAuthenticationAction<R>, R extends AbstractAuthenticationResult> void sendResponse( UserId userId, ChapSession chapSession, ChapResponse chapResponse, AuthenticationActionFactory<A, R> actionFactory, final DispatchServiceCallback<AuthenticationResponse> callback) { ChapSessionId chapSessionId = chapSession.getId(); A action = actionFactory.createAction(chapSessionId, userId, chapResponse); dispatchServiceManager.execute( action, new DispatchServiceCallback<R>() { @Override public void handleSuccess(R loginResult) { callback.onSuccess(loginResult.getResponse()); } }); }