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

java.lang.Object
  extended by org.mobicents.media.server.mgcp.tx.Transaction
All Implemented Interfaces:
ActionListener

public class Transaction
extends Object
implements ActionListener

Represents transaction.

Author:
kulikov

Field Summary
protected  int id
           
 
Constructor Summary
protected Transaction(TransactionManager txManager)
          Create new transaction executor.
 
Method Summary
 int find(Text name, MgcpEndpoint[] endpoints)
          Finds endpoints with specified name pattern.
 MgcpCall getCall(Text id, boolean isNew)
           
 int getId()
           
 Exception getLastError()
          Gets the last observed error.
 MgcpProvider getProvider()
          Provides access to the MGCP provider.
 long getTime()
          Provides access to the wall clock.
protected  int nextID()
           
 void onComplete()
          Called when action terminates execution normally.
 void onFailure(Exception e)
          Called when action execution terminates abnormally
 void onRollback()
          Called when action was rolled back
protected  void process(Action action)
           
 void process(MgcpEvent event)
          Handles event.
 org.mobicents.media.server.scheduler.Scheduler scheduler()
          Gets the access to the scheduler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected int id
Constructor Detail

Transaction

protected Transaction(TransactionManager txManager)
Create new transaction executor.

Parameters:
transactions - pool of the transaction objects.
Controller - the controller instance.
Method Detail

scheduler

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

Returns:
job scheduler.

getId

public int getId()

getProvider

public MgcpProvider getProvider()
Provides access to the MGCP provider.

Returns:
protocol provider object.

getCall

public MgcpCall getCall(Text id,
                        boolean isNew)

find

public int find(Text name,
                MgcpEndpoint[] endpoints)
         throws UnknownEndpointException
Finds endpoints with specified name pattern.

Parameters:
name - the endpoint name pattern. *
endpoints - array for search result
Returns:
number of found endpoints.
Throws:
UnknownEndpointException - if name pattern was wrong.

getLastError

public Exception getLastError()
Gets the last observed error.

Returns:
the exception class.

getTime

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

Returns:
time measured by wall clock.

process

public void process(MgcpEvent event)
Handles event.

Parameters:
event - the event to handle

process

protected void process(Action action)

nextID

protected int nextID()

onComplete

public void onComplete()
Description copied from interface: ActionListener
Called when action terminates execution normally.

Specified by:
onComplete in interface ActionListener

onFailure

public void onFailure(Exception e)
Description copied from interface: ActionListener
Called when action execution terminates abnormally

Specified by:
onFailure in interface ActionListener
Parameters:
e - the exception cause failure

onRollback

public void onRollback()
Description copied from interface: ActionListener
Called when action was rolled back

Specified by:
onRollback in interface ActionListener


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