SourceResolver resolver,
Map objectModel,
String source,
Parameters par)
throws ProcessingException {
SessionManager sessionManager = null;
try {
sessionManager = (SessionManager)this.manager.lookup(SessionManager.ROLE);
final String action = par.getParameter("action", "create");
if ( action.equals("create") == true ) {
sessionManager.createSession();
} else if ( action.equals("terminate") == true ) {
final String mode = par.getParameter("mode", "immediately");
if ( mode.equals("immediately") == true) {
sessionManager.terminateSession(true);
} else if ( mode.equals("if-unused") == true ) {
sessionManager.terminateSession(false);
} else {
throw new ProcessingException("Unknown mode " + mode + " for action " + action);
}
} else {
throw new ProcessingException("Unknown action: " + action);