/** * 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()); } }
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(); } }
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(); } } /**