Asterisk-Java

org.asteriskjava.fastagi.internal
Class AgiConnectionHandler

java.lang.Object
  extended by org.asteriskjava.fastagi.internal.AgiConnectionHandler
All Implemented Interfaces:
java.lang.Runnable

public class AgiConnectionHandler
extends java.lang.Object
implements java.lang.Runnable

An AgiConnectionHandler is created and run by the AgiServer whenever a new socket connection from an Asterisk Server is received.

It reads the request using an AgiReader and runs the AgiScript configured to handle this type of request. Finally it closes the socket connection.

Version:
$Id: AgiConnectionHandler.java 492 2006-07-16 09:36:01Z srt $
Author:
srt

Constructor Summary
AgiConnectionHandler(SocketConnectionFacade socket, MappingStrategy mappingStrategy)
          Creates a new AGIConnectionHandler to handle the given socket connection.
 
Method Summary
protected  org.asteriskjava.fastagi.internal.AgiReader createReader()
           
protected  org.asteriskjava.fastagi.internal.AgiWriter createWriter()
           
static AgiChannel getChannel()
          Returns the AgiChannel associated with the current thread.
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgiConnectionHandler

public AgiConnectionHandler(SocketConnectionFacade socket,
                            MappingStrategy mappingStrategy)
Creates a new AGIConnectionHandler to handle the given socket connection.

Parameters:
socket - the socket connection to handle.
mappingStrategy - the strategy to use to determine which script to run.
Method Detail

createReader

protected org.asteriskjava.fastagi.internal.AgiReader createReader()

createWriter

protected org.asteriskjava.fastagi.internal.AgiWriter createWriter()

run

public void run()
Specified by:
run in interface java.lang.Runnable

getChannel

public static AgiChannel getChannel()
Returns the AgiChannel associated with the current thread.

Returns:
the AgiChannel associated with the current thread or null if none is associated.

Asterisk-Java

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