Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mobicents.slee.runtime
Class EventRouterImpl  view EventRouterImpl download EventRouterImpl.java

java.lang.Object
  extended byorg.mobicents.slee.runtime.EventRouterImpl
All Implemented Interfaces:
EventRouter

public class EventRouterImpl
extends java.lang.Object
implements EventRouter

Implements the router algorithm.


Nested Class Summary
private  class EventRouterImpl.EventExecutor
           
private  class EventRouterImpl.EventPosting
           
 
Field Summary
private  EventTypeID activityEndEventID
           
private  org.mobicents.slee.container.SleeContainer container
           
private static org.jboss.logging.Logger logger
           
private  QueuedExecutor queue
           
private  SbbEntityFactory sbbEntityFactory
           
private  org.mobicents.slee.runtime.transaction.SleeTransactionManager txMgr
           
 
Constructor Summary
EventRouterImpl(org.mobicents.slee.container.SleeContainer container)
          Creates a new instance of EventRouterImpl
 
Method Summary
private static java.lang.String computeConvergenceName(SleeEvent e, org.mobicents.slee.container.service.ServiceComponent svc)
           
private  void handleActivityEndEvent(SleeEventImpl eventObject)
          Execute cascading remove on any root sbb entities whose attachment count has gone to zero after activity end event has detached the sbbs.
private  boolean handleRollback(SbbObject sbbObject, SleeEvent sleeEvent, java.lang.Exception e, java.lang.ClassLoader contextClassLoader)
           
 void handleSbbRolledBack(SbbEntity sbbEntity, SbbObject sbbObj, SleeEvent sleeEvent, java.lang.ClassLoader contextClassLoader, boolean removeRolledBack)
           
protected  SbbEntity higherPrioritySbb(SbbEntity sbbe1, SbbEntity sbbe2)
           
private  void postActivityEndEvent(SleeEventImpl eventObject)
          Now we have some more transactional stuff to do that doesn't constitute a SLEE originated invocation sequence - but we still need to maintain consistency therefore we handle rollback here.
protected  java.util.Stack priorityOfSbb(SbbEntity sbbe)
           
private  void processInitialEvents(ServiceID serviceId, SleeEvent eventObject)
          Process the initial events of a service.
 void routeEvent(EventTypeID eventTypeId, java.lang.Object event, java.lang.Object activity, Address address)
           
private  void routeTheEvent(EventRouterImpl.EventPosting ep)
           
private  void setActivityContextInEndingState(SleeEventImpl eventObject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

container

private org.mobicents.slee.container.SleeContainer container

txMgr

private org.mobicents.slee.runtime.transaction.SleeTransactionManager txMgr

activityEndEventID

private EventTypeID activityEndEventID

sbbEntityFactory

private SbbEntityFactory sbbEntityFactory

logger

private static org.jboss.logging.Logger logger

queue

private QueuedExecutor queue
Constructor Detail

EventRouterImpl

public EventRouterImpl(org.mobicents.slee.container.SleeContainer container)
Creates a new instance of EventRouterImpl

Method Detail

routeEvent

public void routeEvent(EventTypeID eventTypeId,
                       java.lang.Object event,
                       java.lang.Object activity,
                       Address address)
Specified by:
routeEvent in interface EventRouter

computeConvergenceName

private static java.lang.String computeConvergenceName(SleeEvent e,
                                                       org.mobicents.slee.container.service.ServiceComponent svc)
                                                throws java.lang.Exception

processInitialEvents

private void processInitialEvents(ServiceID serviceId,
                                  SleeEvent eventObject)
                           throws java.lang.Exception
Process the initial events of a service. This method possibly creates new Sbbs. The container keeps a factory that creates new Sbbs keyed on the convergence name of the service.


priorityOfSbb

protected java.util.Stack priorityOfSbb(SbbEntity sbbe)

higherPrioritySbb

protected SbbEntity higherPrioritySbb(SbbEntity sbbe1,
                                      SbbEntity sbbe2)

handleRollback

private boolean handleRollback(SbbObject sbbObject,
                               SleeEvent sleeEvent,
                               java.lang.Exception e,
                               java.lang.ClassLoader contextClassLoader)

handleSbbRolledBack

public void handleSbbRolledBack(SbbEntity sbbEntity,
                                SbbObject sbbObj,
                                SleeEvent sleeEvent,
                                java.lang.ClassLoader contextClassLoader,
                                boolean removeRolledBack)

routeTheEvent

private void routeTheEvent(EventRouterImpl.EventPosting ep)

handleActivityEndEvent

private void handleActivityEndEvent(SleeEventImpl eventObject)
                             throws javax.transaction.SystemException
Execute cascading remove on any root sbb entities whose attachment count has gone to zero after activity end event has detached the sbbs. If the activity end event is a received event for the sbb then this would be handled in the previous slee originated invocation sequence. It's done here in the case that the sbb is attached to the ac and so needs to be detached but activity end event is not one of it's received events. So this is a SLEE Originated Invocation Sequence containing at most one SLEE Originated Invocation of type "Remove Only"


setActivityContextInEndingState

private void setActivityContextInEndingState(SleeEventImpl eventObject)
                                      throws javax.transaction.SystemException

postActivityEndEvent

private void postActivityEndEvent(SleeEventImpl eventObject)
                           throws javax.transaction.SystemException
Now we have some more transactional stuff to do that doesn't constitute a SLEE originated invocation sequence - but we still need to maintain consistency therefore we handle rollback here.