001    /**
002     * 
003     */
004    package de.jw.cloud42.webservice.listener;
005    
006    import javax.servlet.ServletContextEvent;
007    import javax.servlet.ServletContextListener;
008    
009    import de.jw.cloud42.core.endpoint.Cloud42Endpoint;
010    import de.jw.cloud42.core.eventing.storage.DefaultSubscriberStore;
011    import de.jw.cloud42.core.hibernate.HibernateUtil;
012    
013    /**
014     * Listener to start endpoint of Cloud42 for incoming notifications during servlet initialization.
015     * 
016     * @author fbitzer
017     * 
018     */
019    
020    public final class StartupListener implements ServletContextListener {
021            public void contextInitialized(ServletContextEvent event) {
022    
023                    /*
024                     * This method is called when the servlet context is initialized(when
025                     * the Web Application is deployed). You can initialize servlet context
026                     * related data here.
027                     */
028    
029                    //Start endpoint
030                    
031                    Cloud42Endpoint.getInstance().startEndpoint();
032                    
033                    
034                    
035    
036            }
037    
038             public void contextDestroyed(ServletContextEvent event) {
039    
040                  /* This method is invoked when the Servlet Context 
041                     (the Web Application) is undeployed or 
042                     WebLogic Server shuts down.
043                  */                            
044    
045                }
046    
047    }