public boolean invoke(Environment env,
InvokeContext context) throws Exception {
String contId = continuationId;
if (continuationIdResolver != null) {
contId = continuationIdResolver.resolve(context.getMapStack());
}
InterpreterSelector selector
= (InterpreterSelector)manager.lookup(Interpreter.ROLE);
// FIXME: How to detect the language associated with the
// continuation object? Use the default language for now, but it
// should be fixed ASAP.
String language = selector.getDefaultLanguage();
// Obtain the Interpreter instance for this language
Interpreter interpreter = (Interpreter)selector.select(language);
try {
interpreter.handleContinuation(contId, env, context);
}
finally {
selector.release((Component)interpreter);
}
return true;
}
|