Asterisk-Java

org.asteriskjava.manager.internal
Interface ManagerReader

All Superinterfaces:
java.lang.Runnable
All Known Implementing Classes:
ManagerReaderImpl

public interface ManagerReader
extends java.lang.Runnable

The ManagerReader reads events and responses from the asterisk server, parses them using EventBuilderImpl and ResponseBuilder and dispatches them to the associated ManagerConnection.

Do not use this interface in your code, it is intended to be used only by the DefaultManagerConnection.

Version:
$Id: ManagerReader.java 1155 2008-08-25 20:22:46Z srt $
Author:
srt
See Also:
EventBuilder, ResponseBuilder, DefaultManagerConnection

Field Summary
static java.lang.String COMMAND_RESULT_RESPONSE_KEY
           
 
Method Summary
 void die()
          Terminates this reader.
 void expectResponseClass(java.lang.String internalActionId, java.lang.Class<? extends ManagerResponse> responseClass)
           
 java.io.IOException getTerminationException()
          Returns the Exception that caused this reader to terminate if any.
 boolean isDead()
          Checks whether this reader is terminating or terminated.
 void registerEventClass(java.lang.Class<? extends ManagerEvent> event)
          Registers a new event type with the underlying EventBuilderImpl.
 void setSocket(SocketConnectionFacade socket)
          Sets the socket to use for reading from the asterisk server.
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

COMMAND_RESULT_RESPONSE_KEY

static final java.lang.String COMMAND_RESULT_RESPONSE_KEY
See Also:
Constant Field Values
Method Detail

setSocket

void setSocket(SocketConnectionFacade socket)
Sets the socket to use for reading from the asterisk server.

Parameters:
socket - the socket to use for reading from the asterisk server.

registerEventClass

void registerEventClass(java.lang.Class<? extends ManagerEvent> event)
Registers a new event type with the underlying EventBuilderImpl.

The eventClass must extend ManagerEvent.

Parameters:
event - class of the event to register.
See Also:
EventBuilder, ManagerEvent

expectResponseClass

void expectResponseClass(java.lang.String internalActionId,
                         java.lang.Class<? extends ManagerResponse> responseClass)

die

void die()
Terminates this reader.


isDead

boolean isDead()
Checks whether this reader is terminating or terminated.

Returns:
true if this reader is terminating or terminated, false otherwise.

getTerminationException

java.io.IOException getTerminationException()
Returns the Exception that caused this reader to terminate if any.

Returns:
the Exception that caused this reader to terminate if any or null if not.

Asterisk-Java

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