org.mobicents.media.server.mgcp.tx
Class TransactionManager

java.lang.Object
  extended by org.mobicents.media.server.mgcp.tx.TransactionManager

public class TransactionManager
extends Object

Implements pool of transactions.

Author:
kulikov

Field Summary
protected  CallManager callManager
           
protected  NamingTree namingService
           
protected  MgcpProvider provider
           
 
Constructor Summary
TransactionManager(org.mobicents.media.server.scheduler.Scheduler scheduler, int size)
          Creates new transaction's pool.
 
Method Summary
 Transaction find(int id)
          Find active transaction with specified identifier.
 long getTime()
          Provides access to the wall clock.
protected  int nextID()
          Generates unique transaction identifier.
protected  int remainder()
          Gets the remainder of unused transaction objects.
 org.mobicents.media.server.scheduler.Scheduler scheduler()
          Gets the access to the scheduler.
 void setCallManager(CallManager callManager)
           
 void setMgcpProvider(MgcpProvider provider)
          Assigns MGCP provider.
 void setNamingService(NamingTree namingService)
          Associates endpoint naming service.
protected  void terminate(Transaction t)
          Terminates active transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

provider

protected MgcpProvider provider

namingService

protected NamingTree namingService

callManager

protected CallManager callManager
Constructor Detail

TransactionManager

public TransactionManager(org.mobicents.media.server.scheduler.Scheduler scheduler,
                          int size)
Creates new transaction's pool.

Parameters:
scheduler - the job scheduler
size - the size of the pool.
Method Detail

setNamingService

public void setNamingService(NamingTree namingService)
Associates endpoint naming service.

Parameters:
namingService - the endpoint naming service.

scheduler

public org.mobicents.media.server.scheduler.Scheduler scheduler()
Gets the access to the scheduler.

Returns:
job scheduler.

getTime

public long getTime()
Provides access to the wall clock.

Returns:
time measured by wall clock.

setCallManager

public void setCallManager(CallManager callManager)

setMgcpProvider

public void setMgcpProvider(MgcpProvider provider)
Assigns MGCP provider.

Parameters:
provider - mgcp provider instance

find

public Transaction find(int id)
Find active transaction with specified identifier.

Parameters:
id - the transaction identifier.
Returns:
transaction object or null if does not exist.

terminate

protected void terminate(Transaction t)
Terminates active transaction.

Parameters:
t - the transaction to be terminated

nextID

protected int nextID()
Generates unique transaction identifier.

Returns:
unique integer identifier.

remainder

protected int remainder()
Gets the remainder of unused transaction objects. Used for test purpose.

Returns:
the number of available transaction objects.


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