public void setSbbContext(SbbContext sbbContext) { this.sbbContext = sbbContext; this.logger = sbbContext.getTracer("Test"); }
protected final SbbLocalObject getSbbLocalObject() { return sbbContext.getSbbLocalObject(); }
/** * Starts dialog. * * @param endpointName the user's endpoint. * @param aci the user's activity context interface. */ public void startConversation(String endpointName) { logger.info("Joining " + endpointName + " with " + LOOP_ENDPOINT); MsConnection connection = (MsConnection) sbbContext.getActivities()[0].getActivity(); MsSession session = connection.getSession(); MsLink link = session.createLink(MsLinkMode.FULL_DUPLEX); ActivityContextInterface linkActivity = null; try { linkActivity = mediaAcif.getActivityContextInterface(link); } catch (UnrecognizedActivityException ex) { } linkActivity.attach(sbbContext.getSbbLocalObject()); link.join(endpointName, LOOP_ENDPOINT); }
public void onStartServiceEvent( javax.slee.serviceactivity.ServiceStartedEvent event, ActivityContextInterface aci) { //create profiles, since its 1.1 service, we will get event only for this. //JSLEE 1.1: 8.8.3 // Changed in 1.1: A new version of the Service Started Event type has // been added. This event is fired only to // the starting Service. log.info("Processing activation of: "+getSbbContext().getService()+", in "+getSbbContext().getSbb()); try{ ProfileCreator.createProfiles(); }catch(Exception e) { e.printStackTrace(); } }
private ServerTransaction getServerTransaction() { ActivityContextInterface[] activities = sbbContext.getActivities(); for (ActivityContextInterface activity : activities) { if (activity.getActivity() instanceof ServerTransaction) { return (ServerTransaction) activity.getActivity(); } } return null; }
/** * implements javax.slee.Sbb Please refer to JSLEE v1.1 Specification, Early * Draft Review Page 54 for further information. <br> * The SLEE invokes this method after a new instance of the SBB abstract * class is created. During this method, an SBB entity has not been assigned * to the SBB object. The SBB object can take advantage of this method to * allocate and initialize state or connect to resources that are to be held * by the SBB object during its lifetime. Such state and resources cannot be * specific to an SBB entity because the SBB object might be reused during * its lifetime to serve multiple SBB entities. <br> * This method indicates a transition from state "DOES NOT EXIST" to * "POOLED" (see page 52) */ public void setSbbContext(SbbContext sbbContext) { this.sbbContext = sbbContext; sbbId = sbbContext.getSbb(); try { Context ctx = (Context) new InitialContext() .lookup("java:comp/env"); // get the reference to the RAFrameProvider class which implements // RAFrameResourceAdaptorSbbInterface sbb2ra = (MessageResourceAdaptorSbbInterface) ctx .lookup("slee/resources/raframe/1.0/sbb2ra"); } catch (NamingException ne) { System.out.println("Could not set SBB context: " + ne.toString()); } }
private MgcpConnectionActivity getMgcpConnectionActivity() { ActivityContextInterface[] activities = sbbContext.getActivities(); for (ActivityContextInterface activity : activities) { if (activity.getActivity() instanceof MgcpConnectionActivity) { return (MgcpConnectionActivity) activity.getActivity(); } } return null; }
public void onActivityEndEvent( javax.slee.ActivityEndEvent event, ActivityContextInterface aci) { if(aci.getActivity() instanceof ServiceActivity) { ServiceActivity sa = (ServiceActivity) aci.getActivity(); //again, we will be attached only to our SA. //cleanup. log.info("Processing deactivation of: "+getSbbContext().getService()+", in "+getSbbContext().getSbb()); ProfileCreator.removeProfiles(); } } /**
public void onAppUsageAddedEvent(AppUsageAddedEvent event, ActivityContextInterface aci) { aci.detach(sbbContext.getSbbLocalObject()); if (!event.getAuid().equals(XCAPCapsAppUsage.ID)) { // update xcap caps global doc try { updateXCAPCapsGlobalDoc(); } catch (InternalServerErrorException e) { tracer.severe("failed to update xcap caps global doc", e); } } }
public void setSbbContext(SbbContext context) { this.tracer = context.getTracer("CS-ABMF"); this.sbbContext = (SbbContextExt) context; }
private void releaseMediaConnectionAndDialog() { ActivityContextInterface[] activities = sbbContext.getActivities(); SbbLocalObject sbbLocalObject = getSbbContext().getSbbLocalObject(); MsConnection msConnection = null; for (ActivityContextInterface attachedAci : activities) { if (attachedAci.getActivity() instanceof Dialog) { attachedAci.detach(sbbLocalObject); attachedAci.detach(this.getParentCmp()); } if (attachedAci.getActivity() instanceof MsConnection) { attachedAci.detach(sbbLocalObject); msConnection = (MsConnection) attachedAci.getActivity(); attachedAci.detach(this.getParentCmp()); } } if (msConnection != null) { msConnection.release(); } }
public MsLink getLink() { ActivityContextInterface[] activities = sbbContext.getActivities(); for (int i = 0; i < activities.length; i++) { if (activities[i].getActivity() instanceof MsLink) { return (MsLink) activities[i].getActivity(); } } return null; }
public void onAppUsageRemovedEvent(AppUsageRemovedEvent event, ActivityContextInterface aci) { aci.detach(sbbContext.getSbbLocalObject()); if (!event.getAuid().equals(XCAPCapsAppUsage.ID)) { // update xcap caps global doc try { updateXCAPCapsGlobalDoc(); } catch (InternalServerErrorException e) { tracer.severe("failed to update xcap caps global doc", e); } } }
public void setSbbContext(SbbContext sbbContext) { this.sbbContext = sbbContext; if (tracer == null) { tracer = sbbContext.getTracer(HSSClientParentSbb.class.getSimpleName()); } }
private void releaseState() { ActivityContextInterface[] activities = getSbbContext().getActivities(); SbbLocalObject sbbLocalObject = getSbbContext().getSbbLocalObject();
private ServerTransaction getServerTransaction() { ActivityContextInterface[] activities = sbbContext.getActivities(); for (ActivityContextInterface activity : activities) { if (activity.getActivity() instanceof ServerTransaction) { return (ServerTransaction) activity.getActivity(); } } return null; }
public void onStartServiceEvent( javax.slee.serviceactivity.ServiceStartedEvent event, ActivityContextInterface aci) { tracer.info("Retreiving www.telestax.com..."); try { HttpClientNIORequestActivity activity = httpClientRA.execute( new HttpGet("http://www.telestax.com"), null, System.currentTimeMillis()); httpClientACIF.getActivityContextInterface(activity).attach( sbbContext.getSbbLocalObject()); } catch (Exception e) { tracer.severe("failed to retrieve webpage", e); } }
/** * Called when an sbb object is instantied and enters the pooled state. */ public void setSbbContext(SbbContext context) { this.sbbContext = context; this.tracer = context.getTracer(getClass().getSimpleName()); }
private Dialog getDialog() { ActivityContextInterface[] activities = sbbContext.getActivities(); for (ActivityContextInterface activity : activities) { if (activity.getActivity() instanceof Dialog) { return (Dialog) activity.getActivity(); } } return null; }
public void onOrderCancelled(CustomEvent event, ActivityContextInterface ac) { logger.info("======== OrderDeliverDateSbb ORDER_CANCELLED ========"); if (this.getTimerID() != null) { timerFacility.cancelTimer(this.getTimerID()); ac.detach(getSbbContext().getSbbLocalObject()); } }