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