org.mobicents.protocols.mgcp.stack
Class JainMgcpStackImpl

java.lang.Object
  extended by java.lang.Thread
      extended by org.mobicents.protocols.mgcp.stack.JainMgcpStackImpl
All Implemented Interfaces:
jain.protocol.ip.mgcp.JainMgcpStack, jain.protocol.ip.mgcp.OAM_IF, Runnable

public class JainMgcpStackImpl
extends Thread
implements jain.protocol.ip.mgcp.JainMgcpStack, jain.protocol.ip.mgcp.OAM_IF

Author:
Oleg Kulikov, Pavel Mitrenko

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static String _EXECUTOR_QUEUE_SIZE
          Defines how many message can be stored in queue before new ones are discarded.
static String _EXECUTOR_TABLE_SIZE
          Defines how many executors will work on event delivery
static String _MESSAGE_READER_THREAD_PRIORITY
           
protected  MessageHandler messageHandler
           
protected  int port
           
 JainMgcpStackProviderImpl provider
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
JainMgcpStackImpl()
           
JainMgcpStackImpl(InetAddress localAddress, int port)
          Creates a new instance of JainMgcpStackImpl
 
Method Summary
 void close()
          Closes the stack and it's underlying resources.
 jain.protocol.ip.mgcp.JainMgcpProvider createProvider()
           
 void deleteProvider(jain.protocol.ip.mgcp.JainMgcpProvider provider)
           
 InetAddress getAddress()
           
 Map<Integer,TransactionHandler> getCompletedTransactions()
           
 Map<Integer,TransactionHandler> getLocalTransactions()
           
 int getPort()
           
 String getProtocolVersion()
           
 Map<Integer,Integer> getRemoteTxToLocalTxMap()
           
 UtilsFactory getUtilsFactory()
           
 boolean isRequest(String header)
           
 void printStats()
           
 void run()
           
protected  void send(byte[] data, SocketAddress address)
           
 void setPort(int port)
           
 void setProtocolVersion(String protocolVersion)
           
 void setTransactionRate(int rate)
           
 void setUtilsFactory(UtilsFactory utilsFactory)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_EXECUTOR_TABLE_SIZE

public static final String _EXECUTOR_TABLE_SIZE
Defines how many executors will work on event delivery

See Also:
Constant Field Values

_EXECUTOR_QUEUE_SIZE

public static final String _EXECUTOR_QUEUE_SIZE
Defines how many message can be stored in queue before new ones are discarded.

See Also:
Constant Field Values

_MESSAGE_READER_THREAD_PRIORITY

public static final String _MESSAGE_READER_THREAD_PRIORITY
See Also:
Constant Field Values

port

protected int port

provider

public JainMgcpStackProviderImpl provider

messageHandler

protected MessageHandler messageHandler
Constructor Detail

JainMgcpStackImpl

public JainMgcpStackImpl()

JainMgcpStackImpl

public JainMgcpStackImpl(InetAddress localAddress,
                         int port)
Creates a new instance of JainMgcpStackImpl

Method Detail

printStats

public void printStats()

close

public void close()
Closes the stack and it's underlying resources.


createProvider

public jain.protocol.ip.mgcp.JainMgcpProvider createProvider()
                                                      throws jain.protocol.ip.mgcp.CreateProviderException
Specified by:
createProvider in interface jain.protocol.ip.mgcp.JainMgcpStack
Throws:
jain.protocol.ip.mgcp.CreateProviderException

deleteProvider

public void deleteProvider(jain.protocol.ip.mgcp.JainMgcpProvider provider)
                    throws jain.protocol.ip.mgcp.DeleteProviderException
Specified by:
deleteProvider in interface jain.protocol.ip.mgcp.JainMgcpStack
Throws:
jain.protocol.ip.mgcp.DeleteProviderException

setPort

public void setPort(int port)
Specified by:
setPort in interface jain.protocol.ip.mgcp.OAM_IF

getPort

public int getPort()
Specified by:
getPort in interface jain.protocol.ip.mgcp.JainMgcpStack

getUtilsFactory

public UtilsFactory getUtilsFactory()

setUtilsFactory

public void setUtilsFactory(UtilsFactory utilsFactory)

getAddress

public InetAddress getAddress()

getProtocolVersion

public String getProtocolVersion()
Specified by:
getProtocolVersion in interface jain.protocol.ip.mgcp.JainMgcpStack

setProtocolVersion

public void setProtocolVersion(String protocolVersion)
Specified by:
setProtocolVersion in interface jain.protocol.ip.mgcp.JainMgcpStack

send

protected void send(byte[] data,
                    SocketAddress address)

isRequest

public boolean isRequest(String header)

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

getLocalTransactions

public Map<Integer,TransactionHandler> getLocalTransactions()

getRemoteTxToLocalTxMap

public Map<Integer,Integer> getRemoteTxToLocalTxMap()

getCompletedTransactions

public Map<Integer,TransactionHandler> getCompletedTransactions()

setTransactionRate

public void setTransactionRate(int rate)


Copyright © 2012 TeleStax, Inc.. All Rights Reserved.