Tabnine Logo
ActivityContext
Code IndexAdd Tabnine to your IDE (free)

How to use
ActivityContext
in
org.mobicents.slee.container.activity

Best Java code snippets using org.mobicents.slee.container.activity.ActivityContext (Showing top 20 results out of 315)

origin: org.mobicents.servers.jainslee.core/services

public ActivityContextInterface[] getActivities()
    throws TransactionRequiredLocalException, IllegalStateException,
    SLEEException {
  if (logger.isTraceEnabled()) {
    logger.trace("getActivities() " + this.sbbObject.getState());
  }
  if (SbbObjectState.READY != this.sbbObject.getState()) {
    throw new IllegalStateException(
        "Cannot call SbbContext.getActivities() in "
            + this.sbbObject.getState());
  }
  ActivityContextFactory acf = sleeContainer.getActivityContextFactory();
  List<ActivityContextInterface> result = new ArrayList<ActivityContextInterface>();
  ActivityContext ac = null;
  for (ActivityContextHandle ach : sbbObject.getSbbEntity()
      .getActivityContexts()) {
    ac = acf.getActivityContext(ach);
    if (ac != null) {
      result.add(ac.getActivityContextInterface());
    }
  }
  return result.toArray(EMPTY_ACI_ARRAY);
}
origin: org.mobicents.servers.jainslee.core/activities

public void endActivity(ActivityContextHandle ach) throws ManagementException {
  // Again this is tx method
  logger.info("Trying to stop null activity[" + ach + "]!!");
  ActivityContext ac = acFactory.getActivityContext(ach);
  if (ac == null) {
    logger.debug("There is no ac associated with given acID["
          + ach + "]!!");
    throw new ManagementException("Can not find AC for given ID["
        + ach + "], try again!!!");
  }
  if (ac.getActivityContextHandle().getActivityType() == ActivityType.NULL) {
    logger.debug("Scheduling activity end for acID[" + ach
          + "]");
    NullActivity nullActivity = (NullActivity) ac.getActivityContextHandle().getActivityObject();
    if (nullActivity != null) {
      nullActivity.endActivity();
    }
  } else {
    logger.debug("AC is not null activity context");
    throw new IllegalArgumentException("Given ID[" + ach
        + "] does not point to NullActivity");
  }        
}
origin: org.mobicents.servers.jainslee.core/resource

if (ac != null) {
  EventRoutingTask routingTask = ac.getLocalActivityContext().getCurrentEventRoutingTask();
  EventContext eventContext = routingTask != null ? routingTask.getEventContext() : null;
  if (eventContext != null && eventContext.isSuspended()) {
  ac.endActivity();							
  .getActivityContext(handle);
  if (ac != null) {
    for(SbbEntityID sbbEntityId : ac.getSbbAttachmentSet()) {
      ac.detachSbbEntity(sbbEntityId);
    ac.activityEnded();							
origin: org.mobicents.servers.jainslee.core/common

org.mobicents.slee.container.activity.ActivityContextInterface sleeAci = (org.mobicents.slee.container.activity.ActivityContextInterface)aci;
ActivityContext ac = sleeAci.getActivityContext();
ActivityContextHandle ach = ac.getActivityContextHandle();
ActivityContextNamingFacilityCacheData cacheData=new ActivityContextNamingFacilityCacheData(aciName, cluster);
cacheData.bindName(ach);
ac.addNameBinding(aciName);
if (log.isDebugEnabled()) {
  log.debug("aci name "+aciName+" bound to "+ach+" . Tx is "+sleeContainer.getTransactionManager().getTransaction());
origin: org.mobicents.servers.jainslee.core/services

if (!ac.isEnding()) {
  ac.endActivity();
origin: org.mobicents.servers.jainslee.core/resource

    final ActivityEventQueueManager aeqm = ac.getLocalActivityContext().getEventQueueManager();
    aeqm.createBarrier(barrierTx);
    TransactionalAction action = new TransactionalAction() {
  ac.endActivity();
} else {
  throw new UnrecognizedActivityHandleException(handle.toString());
origin: org.mobicents.servers.jainslee.core/router

final ActivityContextInterface aci = ac.getActivityContextInterface();
      if(keepSbbEntityIfTxRollbacks) {
        if (ac.attachSbbEntity(sbbEntityID)) {
          sbbEntity.afterACAttach(ac.getActivityContextHandle());
origin: org.mobicents.servers.jainslee.core/services

if (ac.isEnding()) {
  throw new IllegalStateException("activity context "
      + ac.getActivityContextHandle() + " is ending");
    ac.fireEvent(eventTypeID, eventObject, (Address) address, serviceID, eventBeingDelivered);
    return;
ac.fireEvent(eventTypeID, eventObject, (Address) address, serviceID, null, null, null);	
origin: org.mobicents.servers.jainslee.core/activities

boolean attached = getActivityContext().attachSbbEntity(sbbEntity.getSbbEntityId());
    } else {
      sbbEntity.afterACAttach(getActivityContext().getActivityContextHandle());
  final EventRoutingTask routingTask = activityContext.getLocalActivityContext().getCurrentEventRoutingTask();
  EventContext eventContextImpl = routingTask != null ? routingTask.getEventContext() : null; 
  if (eventContextImpl != null && eventContextImpl.getSbbEntitiesThatHandledEvent().remove(sbbEntity.getSbbEntityId())) {
              + sbbEntity.getSbbEntityId()
              + "] from the delivered set of activity context ["
              + getActivityContext().getActivityContextHandle()
              + "]. Seems to be a reattachment after detachment in the same event delivery transaction. See JSLEE 1.0 Spec, Section 8.5.8.");
origin: org.mobicents.servers.jainslee.core/slee-timers

  logger
      .trace("Posting timer event on event router queue. Activity context:  "
          + ac.getActivityContextHandle()
          + " remainingRepetitions: "
          + data.getRemainingRepetitions());
    this)
    : null;
ac.fireEvent(TimerEventImpl.EVENT_TYPE_ID, timerEvent, data
    .getAddress(), null, null, null,
    cancelTimerCallback);
origin: org.mobicents.servers.jainslee.core/activities

ac.detachSbbEntity(sbbEntity.getSbbEntityId());
  } else {
    sbbEntity.afterACDetach(getActivityContext().getActivityContextHandle());
origin: org.mobicents.servers.jainslee.core/router

  nextSbbEntityFinderResult = nextSbbEntityFinder.next(ac, eventContext, sbbEntitiesThatHandledCurrentEvent,container);                                
} catch (Exception e) {
  logger.warn("Failed to find next sbb entity to deliver the event "+eventContext+" in "+ac.getActivityContextHandle(), e);
    ac.beforeDeliveringEvent(eventContext);
      .debug("The event is an activity end event, detaching ac="+eventContext.getActivityContextHandle()+" , sbbEntity="+sbbEntity.getSbbEntityId());
    ac.detachSbbEntity(sbbEntity.getSbbEntityId());
    sbbEntity.afterACDetach(eventContext.getActivityContextHandle());
origin: org.mobicents.servers.jainslee.core/resource

  final ActivityEventQueueManager aeqm = ac.getLocalActivityContext().getEventQueueManager();
  aeqm.createBarrier(barrierTx);
  TransactionalAction action = new TransactionalAction() {
  tc.getAfterRollbackActions().add(action);
return ac.getActivityContextHandle();
origin: org.mobicents.servers.jainslee.core/services

private void startActivity(final ServiceComponent serviceComponent) {
  // create ac for the activity
  ActivityContextHandle ach = new ServiceActivityContextHandle(
      new ServiceActivityHandleImpl(serviceComponent.getServiceID()));
  ActivityContext ac = sleeContainer.getActivityContextFactory()
      .createActivityContext(ach, ActivityFlags.NO_FLAGS);
  if (logger.isDebugEnabled()) {
    logger.debug("Starting " + serviceComponent.getServiceID()
        + " activity.");
  }
  
  serviceComponent.setActivityEnded(false);
  
  // fire slee 1.0 and 1.1 service started events
  ServiceStartedEventImpl event = new ServiceStartedEventImpl(
      serviceComponent.getServiceID());
  ac.fireEvent(ServiceStartedEventImpl.SLEE_10_EVENT_TYPE_ID, event,
      null, null, null, null, null);
  ac.fireEvent(ServiceStartedEventImpl.SLEE_11_EVENT_TYPE_ID, event,
      null, event.getService(), null, null, null);
}
origin: org.mobicents.servers.jainslee.core/resource

  final ActivityEventQueueManager aeqm = ac.getLocalActivityContext().getEventQueueManager();
  aeqm.createBarrier(barrierTx);
  TransactionalAction action = new TransactionalAction() {
    .hasRequestEventReferenceReleasedCallback(eventFlags) ? callbacks
    : null;
ac.fireEvent(eventType.getEventType(), event, address,
    receivableService == null ? null : receivableService
        .getService(), succeedCallback, failedCallback,
origin: org.mobicents.servers.jainslee.core/profiles

/**
 * 
 */
public void endActivity() {
  ActivityContext ac = getActivityContext();
  if (ac != null) {
    ac.endActivity();				
  }                
}
origin: org.mobicents.servers.jainslee.core/slee-timers

aciImpl.getActivityContext().attachTimer(timerID);
TimerFacilityTimerTaskData taskData = new TimerFacilityTimerTaskData(timerID, aciImpl.getActivityContext().getActivityContextHandle(), address, startTime, period, numRepetitions, timerOptions);
final TimerFacilityTimerTask task = new TimerFacilityTimerTask(taskData);
if(configuration.getTaskExecutionWaitsForTxCommitConfirmation()) {
origin: org.mobicents.servers.jainslee.core/router

for (Iterator<SbbEntityID> iter = ac.getSortedSbbAttachmentSet(sbbEntitiesThatHandledCurrentEvent).iterator(); iter
    .hasNext();) {
  sbbEntityId = iter.next();
  if (eventRouterConfiguration.isConfirmSbbEntityAttachement() && !sbbEntity.isAttached(ac.getActivityContextHandle())) {
origin: org.mobicents.servers.jainslee.core/services

if (ac != null && !ac.isEnding()) {
  ac.detachSbbEntity(this.sbbeId);
origin: org.mobicents.servers.jainslee.core/events

public DefaultEventContextData(EventTypeID eventTypeId, Object event,
    ActivityContext ac, Address address, ServiceID serviceID,
    EventProcessingSucceedCallback succeedCallback,
    EventProcessingFailedCallback failedCallback,
    EventUnreferencedCallback unreferencedCallback,
    ReferencesHandler referencesHandler) {
  this.eventTypeId = eventTypeId;
  this.eventObject = event;
  this.localActivityContext = ac.getLocalActivityContext();
  this.address = address;
  this.serviceID = serviceID;
  this.succeedCallback = succeedCallback;
  this.failedCallback = failedCallback;
  this.unreferencedCallback = unreferencedCallback;
  this.referencesHandler = referencesHandler;
}
org.mobicents.slee.container.activityActivityContext

Most used methods

  • getActivityContextInterface
  • getActivityContextHandle
  • fireEvent
  • detachSbbEntity
  • endActivity
  • getLocalActivityContext
  • activityEnded
  • attachSbbEntity
  • isEnding
  • addNameBinding
  • attachTimer
  • beforeDeliveringEvent
  • attachTimer,
  • beforeDeliveringEvent,
  • detachTimer,
  • getAttachedTimers,
  • getDataAttribute,
  • getNamingBindings,
  • getSbbAttachmentSet,
  • getSortedSbbAttachmentSet,
  • removeNameBinding,
  • setDataAttribute

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Reference (javax.naming)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now