public interface ServiceLifeCycle
TheServiceLifeCycle
.
Additionally, the service life cycle relies on the well-defined initialization and cleanup capabilities of the CallListener
and
is most suited for use with a snap-in that implement call processing functionality. Therefore, a snap-in that makes use of the service
life cycle will need to follow the procedures for implementing the CallListener. These procedures include implementing either
the CallListener interface or extending the CallListenerAbstract
class; they also include providing the sip.xml
and CARRule.xml file as part of your project. The Maven archetype included with the SDK provides the framework for the various
call processing pieces mentioned here.
For more information about developing a snap-in for call processing, see the Service Development Guide.
In addition to the service life cycle capabilities provided by this interface, there are a variety of standard J2EE life cycle
capabilities available to the snap-in developer. Their suitability for any snap-in will depend on the specifics of the snap-in being
developed. Several examples are provided below to demonstrate other life cycle options. Additional information about these J2EE elements
is widely available on the Internet.
@WebServlet(value = "/MyServlet", loadOnStartup = 1) public class MyServlet extends HttpServlet { private Logger logger = Logger.getLogger(MyServlet.class); public void init() throws ServletException { logger.info("MyServlet init"); } public void destroy() { logger.info("MyServlet destroy"); } }
@Startup @Singleton @Path("/myResource") public class MyResource { private Logger logger = Logger.getLogger(MyResource.class); @PostConstruct public void startup() { logger.info("MyResource startup"); } @PreDestroy public void shutdown() { logger.info("MyResource shutdown"); } }
@Startup @Singleton public class MyBean { private Logger logger = Logger.getLogger(MyBean.class); @PostConstruct public void startup() { logger.info("MyBean startup"); } @PreDestroy public void shutdown() { logger.info("MyBean shutdown"); } }
Copyright © 2016 Avaya. All Rights Reserved.