T
- The return typepublic class ApplicationTask<T> extends Object implements Callable<T>, Runnable
Runnable
wrapper for a Scripturian Executable
.
document
and application
services are available as
global variables. See DocumentService
and ApplicationService
.
Before using this class, make sure to configure a valid document source in
the application's Context
as
com.threecrickets.prudence.ApplicationTask.documentSource
. This
document source is exposed to the executable as document.source
.
Instances are not thread-safe.
Summary of settings configured via the application's Context
:
com.threecrickets.prudence.ApplicationTask.applicationServiceName
: Defaults to "application".com.threecrickets.prudence.ApplicationTask.debug:
Boolean
, defaults to false.com.threecrickets.prudence.ApplicationTask.defaultLanguageTag:
String
, defaults to "javascript".com.threecrickets.prudence.ApplicationTask.defaultName:
String
, defaults to "default".com.threecrickets.prudence.ApplicationTask.documentServiceName
:
The name of the global variable with which to access the document service.
Defaults to "document".com.threecrickets.prudence.ApplicationTask.documentSource:
DocumentSource
. Required.com.threecrickets.prudence.ApplicationTask.errorWriter:
Writer
, defaults to standard error.com.threecrickets.prudence.ApplicationTask.executionController:
ExecutionController
.com.threecrickets.prudence.ApplicationTask.libraryDocumentSources:
Iterable
of DocumentSource
of Executable
.com.threecrickets.prudence.ApplicationTask.languageManager:
LanguageManager
, defaults to a new instance.com.threecrickets.prudence.ApplicationTask.parserManager:
ParserManager
, defaults to a new instance.com.threecrickets.prudence.ApplicationTask.prepare:
Boolean
, defaults to true.com.threecrickets.prudence.ApplicationTask.trailingSlashRequired:
Boolean
, defaults to true.com.threecrickets.prudence.ApplicationTask.writer:
Writer
, defaults to standard output."Restlet" is a registered trademark of Restlet S.A.S..
Constructor and Description |
---|
ApplicationTask(Application application,
String code,
Object context)
Constructor.
|
ApplicationTask(Application application,
String documentName,
String entryPointName,
Object context)
Constructor.
|
ApplicationTask(String code,
Object context)
Constructor using current Restlet application.
|
ApplicationTask(String documentName,
String entryPointName,
Object context)
Constructor using current Restlet application.
|
Modifier and Type | Method and Description |
---|---|
T |
call() |
Application |
getApplication()
The Restlet application in which this task will execute.
|
com.threecrickets.prudence.internal.attributes.ApplicationTaskAttributes |
getAttributes()
The attributes as configured in the
Application context. |
Object |
getContext()
The context made available to the task.
|
String |
getDocumentName()
The document name to execute for this task.
|
String |
getEntryPointName()
The entry point name.
|
void |
run() |
public ApplicationTask(String documentName, String entryPointName, Object context)
documentName
- The document nameentryPointName
- The entry point name or nullcontext
- The context made available to the taskApplication.getCurrent()
public ApplicationTask(Application application, String documentName, String entryPointName, Object context)
application
- The Restlet application in which this task will executedocumentName
- The document nameentryPointName
- The entry point name or nullcontext
- The context made available to the taskpublic ApplicationTask(String code, Object context)
code
- The code to executecontext
- The context made available to the taskpublic ApplicationTask(Application application, String code, Object context)
application
- The Restlet application in which this task will executecode
- The code to executecontext
- The context made available to the taskpublic com.threecrickets.prudence.internal.attributes.ApplicationTaskAttributes getAttributes()
Application
context.public Application getApplication()
public String getDocumentName()
public String getEntryPointName()
public Object getContext()
Copyright © 2009-2016 Three Crickets LLC.