Asterisk-Java

org.asteriskjava.fastagi
Class ScriptEngineMappingStrategy.ScriptEngineAgiScript

java.lang.Object
  extended by org.asteriskjava.fastagi.ScriptEngineMappingStrategy.ScriptEngineAgiScript
All Implemented Interfaces:
AgiScript, NamedAgiScript
Enclosing class:
ScriptEngineMappingStrategy

protected class ScriptEngineMappingStrategy.ScriptEngineAgiScript
extends java.lang.Object
implements NamedAgiScript


Constructor Summary
ScriptEngineMappingStrategy.ScriptEngineAgiScript(java.io.File file, javax.script.ScriptEngine scriptEngine)
          Creates a new ScriptEngineAgiScript.
 
Method Summary
 java.lang.String getName()
          Returns the name of the script.
 void service(AgiRequest request, AgiChannel channel)
          The service method is called by the AsteriskServer whenever this AgiScript should handle an incoming AgiRequest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptEngineMappingStrategy.ScriptEngineAgiScript

public ScriptEngineMappingStrategy.ScriptEngineAgiScript(java.io.File file,
                                                         javax.script.ScriptEngine scriptEngine)
Creates a new ScriptEngineAgiScript.

Parameters:
file - the file that contains the script to execute.
scriptEngine - the ScriptEngine to use for executing the script.
Method Detail

getName

public java.lang.String getName()
Description copied from interface: NamedAgiScript
Returns the name of the script.

Specified by:
getName in interface NamedAgiScript
Returns:
the name of the script

service

public void service(AgiRequest request,
                    AgiChannel channel)
             throws AgiException
Description copied from interface: AgiScript
The service method is called by the AsteriskServer whenever this AgiScript should handle an incoming AgiRequest.

Specified by:
service in interface AgiScript
Parameters:
request - the initial data received from Asterisk when requesting this script.
channel - a handle to communicate with Asterisk such as sending commands to the channel sending the request.
Throws:
AgiException - any exception thrown by your script will be logged.

Asterisk-Java

Copyright © 2004-2009 Stefan Reuter. All Rights Reserved.