public class DelegatedHandler extends Object
Executable
. The entry points must be global functions,
closures, or whatever other technique the language engine uses to for entry
points.
A conversation
service is sent as the first argument to all
entry points. Additionally, document
and
application
services are available as global services. See
ConversationService
, DocumentService
and
ApplicationService
.
Before using this class, make sure to configure a valid document source in
the application's Context
as
com.threecrickets.prudence.DelegatedHandler.documentSource
. This
document source is exposed to the executable as document.source
.
For a more sophisticated resource delegate, see DelegatedResource
.
Instances are thread-safe.
Summary of settings configured via the application's Context
:
com.threecrickets.prudence.DelegatedHandler.applicationServiceName
: Defaults to "application".com.threecrickets.prudence.DelegatedHandler.commonLibraryDocumentSource:
DocumentSource
.com.threecrickets.prudence.DelegatedHandler.debug:
Boolean
, defaults to false.com.threecrickets.prudence.DelegatedHandler.defaultLanguageTag:
String
, defaults to "javascript".com.threecrickets.prudence.DelegatedHandler.defaultName:
String
, defaults to "default".com.threecrickets.prudence.DelegatedHandler.documentServiceName
:
Defaults to "document".com.threecrickets.prudence.DelegatedHandler.errorWriter:
Writer
, defaults to standard error.com.threecrickets.prudence.DelegatedHandler.entryPointValidityCache:
ConcurrentMap
, defaults to a new ConcurrentHashMap
.com.threecrickets.prudence.DelegatedHandler.fileUploadDirectory:
File
, defaults to "uploads" under the application root.com.threecrickets.prudence.DelegatedHandler.fileUploadSizeThreshold:
Integer
, defaults to zero.com.threecrickets.prudence.DelegatedHandler.executionController:
ExecutionController
com.threecrickets.prudence.DelegatedHandler.libraryDocumentSource:
DocumentSource
.com.threecrickets.prudence.DelegatedHandler.languageManager:
LanguageManager
, defaults to a new instance.com.threecrickets.prudence.DelegatedHandler.parserManager:
ParserManager
, defaults to a new instance.com.threecrickets.prudence.DelegatedHandler.prepare:
Boolean
, defaults to true.com.threecrickets.prudence.DelegatedHandler.writer:
Writer
, defaults to standard output.Constructor and Description |
---|
DelegatedHandler(String documentName,
Context context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
com.threecrickets.prudence.internal.attributes.DelegatedHandlerAttributes |
getAttributes()
The attributes as configured in the
Application context. |
String |
getDocumentName() |
Object |
handle(String entryPointName,
Object... arguments)
Enters the executable.
|
Object |
handleWithConversation(String entryPointName,
Object... arguments)
Enters the executable with a conversation service as the first argument.
|
public com.threecrickets.prudence.internal.attributes.DelegatedHandlerAttributes getAttributes()
Application
context.public String getDocumentName()
public Object handle(String entryPointName, Object... arguments)
entryPointName
- Name of entry pointarguments
- Extra arguments to add to entry pointResourceException
- In case of a handling errorExecutable.enter(Object, String, Object...)
public Object handleWithConversation(String entryPointName, Object... arguments)
entryPointName
- Name of entry pointarguments
- Extra arguments to add to entry pointResourceException
- In case of a handling errorExecutable.enter(Object, String, Object...)
Copyright © 2009-2016 Three Crickets LLC.