|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthelma.framework.core.RequestEvaluator
public final class RequestEvaluator
This class does the work for incoming requests. It holds a transactor thread and an EcmaScript evaluator to get the work done. Incoming threads are blocked until the request has been serviced by the evaluator, or the timeout specified by the application has passed. In the latter case, the evaluator thread is killed and an error message is returned.
Field Summary | |
---|---|
Application |
app
|
static java.lang.Object[] |
EMPTY_ARGS
|
protected ScriptingEngine |
scriptingEngine
|
protected int |
skinDepth
|
Constructor Summary | |
---|---|
RequestEvaluator(Application app)
Create a new RequestEvaluator for this application. |
Method Summary | |
---|---|
ResponseTrans |
attachHttpRequest(RequestTrans req)
This checks if the Evaluator is already executing an equal request. |
java.lang.String |
getAction(java.lang.Object obj,
java.lang.String action,
RequestTrans req)
Check if an action with a given name is defined for a scripted object. |
RequestTrans |
getRequest()
Get the request object for the current request. |
ResponseTrans |
getResponse()
Get the response object for the current request. |
ScriptingEngine |
getScriptingEngine()
Returns this evaluator's scripting engine |
Session |
getSession()
Return the current session |
java.lang.Thread |
getThread()
Get the current transactor thread |
protected void |
initScriptingEngine()
|
java.lang.Object |
invokeDirectFunction(java.lang.Object obj,
java.lang.Object function,
java.lang.Object[] args)
Invoke a function internally and directly, using the thread we're running on. |
java.lang.Object |
invokeExternal(java.lang.String functionName,
java.lang.Object[] args)
Invoke a function for an external request. |
ResponseTrans |
invokeHttp(RequestTrans req,
Session session)
Invoke an action function for a HTTP request. |
java.lang.Object |
invokeInternal(java.lang.Object object,
java.lang.Object function,
java.lang.Object[] args)
Invoke a function internally. |
java.lang.Object |
invokeInternal(java.lang.Object object,
java.lang.Object function,
java.lang.Object[] args,
long timeout)
Invoke a function internally. |
java.lang.Object |
invokeXmlRpc(java.lang.String functionName,
java.lang.Object[] args)
Invoke a function for an XML-RPC request. |
void |
run()
|
protected void |
shutdown()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Object[] EMPTY_ARGS
public final Application app
protected ScriptingEngine scriptingEngine
protected int skinDepth
Constructor Detail |
---|
public RequestEvaluator(Application app)
app
- the applicationMethod Detail |
---|
protected void initScriptingEngine()
protected void shutdown()
public void run()
run
in interface java.lang.Runnable
public ResponseTrans invokeHttp(RequestTrans req, Session session) throws java.lang.Exception
req
- the incoming HTTP requestsession
- the client's session
java.lang.Exception
- any exception thrown by the invocationpublic ResponseTrans attachHttpRequest(RequestTrans req) throws java.lang.Exception
java.lang.Exception
public java.lang.Object invokeXmlRpc(java.lang.String functionName, java.lang.Object[] args) throws java.lang.Exception
functionName
- the name of the function to invokeargs
- the arguments
java.lang.Exception
- any exception thrown by the invocationpublic java.lang.Object invokeExternal(java.lang.String functionName, java.lang.Object[] args) throws java.lang.Exception
functionName
- the name of the function to invokeargs
- the arguments
java.lang.Exception
- any exception thrown by the invocationpublic java.lang.Object invokeDirectFunction(java.lang.Object obj, java.lang.Object function, java.lang.Object[] args) throws java.lang.Exception
obj
- the object to invoke the function onfunction
- the function or name of the function to invokeargs
- the arguments
java.lang.Exception
- any exception thrown by the invocationpublic java.lang.Object invokeInternal(java.lang.Object object, java.lang.Object function, java.lang.Object[] args) throws java.lang.Exception
object
- the object to invoke the function onfunction
- the function or name of the function to invokeargs
- the arguments
java.lang.Exception
- any exception thrown by the invocationpublic java.lang.Object invokeInternal(java.lang.Object object, java.lang.Object function, java.lang.Object[] args, long timeout) throws java.lang.Exception
object
- the object to invoke the function onfunction
- the function or name of the function to invokeargs
- the argumentstimeout
- the time in milliseconds to wait for the function to return, or
-1 to wait indefinitely
java.lang.Exception
- any exception thrown by the invocationpublic java.lang.String getAction(java.lang.Object obj, java.lang.String action, RequestTrans req)
public ScriptingEngine getScriptingEngine()
public RequestTrans getRequest()
public ResponseTrans getResponse()
public java.lang.Thread getThread()
public Session getSession()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |