private void logout() {
try {
SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
if (clientIdentity != null) {
logger.info("Logging out");
securityService.logout(clientIdentity);
ClientSecurity.setIdentity(null);
}
} catch (LoginException e) {
throw new OpenEJBRuntimeException("User could not be logged out.", e);
}