org.mobicents.servlet.sip.startup
Class SipNamingContextListener

java.lang.Object
  extended by org.apache.catalina.core.NamingContextListener
      extended by org.mobicents.servlet.sip.startup.SipNamingContextListener
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, org.apache.catalina.ContainerListener, org.apache.catalina.LifecycleListener

public class SipNamingContextListener
extends org.apache.catalina.core.NamingContextListener

Helper class used to initialize and populate the JNDI context associated with each context with the sip factory.

Author:
Jean Deruelle

Field Summary
static java.lang.String NAMING_CONTEXT_APPNAME_SUBCONTEXT_ADDED_EVENT
           
static java.lang.String NAMING_CONTEXT_APPNAME_SUBCONTEXT_REMOVED_EVENT
           
static java.lang.String NAMING_CONTEXT_SIP_FACTORY_ADDED_EVENT
           
static java.lang.String NAMING_CONTEXT_SIP_FACTORY_REMOVED_EVENT
           
static java.lang.String NAMING_CONTEXT_SIP_SESSIONS_UTIL_ADDED_EVENT
           
static java.lang.String NAMING_CONTEXT_SIP_SESSIONS_UTIL_REMOVED_EVENT
           
static java.lang.String NAMING_CONTEXT_SIP_SUBCONTEXT_ADDED_EVENT
           
static java.lang.String NAMING_CONTEXT_SIP_SUBCONTEXT_REMOVED_EVENT
           
static java.lang.String NAMING_CONTEXT_TIMER_SERVICE_ADDED_EVENT
           
static java.lang.String NAMING_CONTEXT_TIMER_SERVICE_REMOVED_EVENT
           
static java.lang.String SIP_FACTORY_JNDI_NAME
           
static java.lang.String SIP_SESSIONS_UTIL_JNDI_NAME
           
static java.lang.String SIP_SUBCONTEXT
           
static java.lang.String TIMER_SERVICE_JNDI_NAME
           
 
Fields inherited from class org.apache.catalina.core.NamingContextListener
compCtx, container, envCtx, initialized, name, namingContext, namingResources, objectNames, sm
 
Constructor Summary
SipNamingContextListener()
           
 
Method Summary
static void addAppNameSubContext(javax.naming.Context envCtx, java.lang.String appName)
          Add the application name subcontext from the jndi mapping
static void addSipFactory(javax.naming.Context envCtx, java.lang.String appName, SipFactory sipFactory)
          Add the sip factory binding from the jndi mapping and bind the sip factory in paramter to it
static void addSipSessionsUtil(javax.naming.Context envCtx, java.lang.String appName, SipSessionsUtil sipSessionsUtil)
          Add the sip sessions util binding from the jndi mapping and bind the sip sessions util in parameter to it
static void addSipSubcontext(javax.naming.Context envCtx)
          Add the sip subcontext to JNDI
static void addTimerService(javax.naming.Context envCtx, java.lang.String appName, TimerService timerService)
          Add the sip timer service from the jndi mapping and bind the timer service in parameter to it
 void containerEvent(org.apache.catalina.ContainerEvent event)
           
 void lifecycleEvent(org.apache.catalina.LifecycleEvent event)
           
static void removeAppNameSubContext(javax.naming.Context envCtx, java.lang.String appName)
          Removes the app name subcontext from the jndi mapping
static void removeSipFactory(javax.naming.Context envCtx, java.lang.String appName, SipFactory sipFactory)
          Removes the sip factory binding from the jndi mapping
static void removeSipSessionsUtil(javax.naming.Context envCtx, java.lang.String appName, SipSessionsUtil sipSessionsUtil)
          Removes the sip sessions util binding from the jndi mapping
static void removeSipSubcontext(javax.naming.Context envCtx)
          Removes the sip subcontext from JNDI
static void removeTimerService(javax.naming.Context envCtx, java.lang.String appName, TimerService timerService)
          Removes the Timer Service binding from the jndi mapping
 
Methods inherited from class org.apache.catalina.core.NamingContextListener
addEjb, addEnvironment, addLocalEjb, addResource, addResourceEnvRef, addResourceLink, addService, createObjectName, getCompContext, getEnvContext, getName, getNamingContext, propertyChange, removeEjb, removeEnvironment, removeLocalEjb, removeResource, removeResourceEnvRef, removeResourceLink, removeService, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMING_CONTEXT_SIP_SUBCONTEXT_ADDED_EVENT

public static final java.lang.String NAMING_CONTEXT_SIP_SUBCONTEXT_ADDED_EVENT
See Also:
Constant Field Values

NAMING_CONTEXT_SIP_SUBCONTEXT_REMOVED_EVENT

public static final java.lang.String NAMING_CONTEXT_SIP_SUBCONTEXT_REMOVED_EVENT
See Also:
Constant Field Values

NAMING_CONTEXT_APPNAME_SUBCONTEXT_ADDED_EVENT

public static final java.lang.String NAMING_CONTEXT_APPNAME_SUBCONTEXT_ADDED_EVENT
See Also:
Constant Field Values

NAMING_CONTEXT_APPNAME_SUBCONTEXT_REMOVED_EVENT

public static final java.lang.String NAMING_CONTEXT_APPNAME_SUBCONTEXT_REMOVED_EVENT
See Also:
Constant Field Values

NAMING_CONTEXT_SIP_FACTORY_ADDED_EVENT

public static final java.lang.String NAMING_CONTEXT_SIP_FACTORY_ADDED_EVENT
See Also:
Constant Field Values

NAMING_CONTEXT_SIP_FACTORY_REMOVED_EVENT

public static final java.lang.String NAMING_CONTEXT_SIP_FACTORY_REMOVED_EVENT
See Also:
Constant Field Values

NAMING_CONTEXT_SIP_SESSIONS_UTIL_ADDED_EVENT

public static final java.lang.String NAMING_CONTEXT_SIP_SESSIONS_UTIL_ADDED_EVENT
See Also:
Constant Field Values

NAMING_CONTEXT_SIP_SESSIONS_UTIL_REMOVED_EVENT

public static final java.lang.String NAMING_CONTEXT_SIP_SESSIONS_UTIL_REMOVED_EVENT
See Also:
Constant Field Values

NAMING_CONTEXT_TIMER_SERVICE_ADDED_EVENT

public static final java.lang.String NAMING_CONTEXT_TIMER_SERVICE_ADDED_EVENT
See Also:
Constant Field Values

NAMING_CONTEXT_TIMER_SERVICE_REMOVED_EVENT

public static final java.lang.String NAMING_CONTEXT_TIMER_SERVICE_REMOVED_EVENT
See Also:
Constant Field Values

SIP_SUBCONTEXT

public static final java.lang.String SIP_SUBCONTEXT
See Also:
Constant Field Values

SIP_FACTORY_JNDI_NAME

public static final java.lang.String SIP_FACTORY_JNDI_NAME
See Also:
Constant Field Values

SIP_SESSIONS_UTIL_JNDI_NAME

public static final java.lang.String SIP_SESSIONS_UTIL_JNDI_NAME
See Also:
Constant Field Values

TIMER_SERVICE_JNDI_NAME

public static final java.lang.String TIMER_SERVICE_JNDI_NAME
See Also:
Constant Field Values
Constructor Detail

SipNamingContextListener

public SipNamingContextListener()
Method Detail

lifecycleEvent

public void lifecycleEvent(org.apache.catalina.LifecycleEvent event)
Specified by:
lifecycleEvent in interface org.apache.catalina.LifecycleListener
Overrides:
lifecycleEvent in class org.apache.catalina.core.NamingContextListener

containerEvent

public void containerEvent(org.apache.catalina.ContainerEvent event)
Specified by:
containerEvent in interface org.apache.catalina.ContainerListener
Overrides:
containerEvent in class org.apache.catalina.core.NamingContextListener

removeSipSubcontext

public static void removeSipSubcontext(javax.naming.Context envCtx)
Removes the sip subcontext from JNDI

Parameters:
envCtx - the envContext from which the sip subcontext should be removed

addSipSubcontext

public static void addSipSubcontext(javax.naming.Context envCtx)
Add the sip subcontext to JNDI

Parameters:
envCtx - the envContext to which the sip subcontext should be added

removeAppNameSubContext

public static void removeAppNameSubContext(javax.naming.Context envCtx,
                                           java.lang.String appName)
Removes the app name subcontext from the jndi mapping

Parameters:
appName - sub context Name

addAppNameSubContext

public static void addAppNameSubContext(javax.naming.Context envCtx,
                                        java.lang.String appName)
Add the application name subcontext from the jndi mapping

Parameters:
appName - sub context Name

removeSipSessionsUtil

public static void removeSipSessionsUtil(javax.naming.Context envCtx,
                                         java.lang.String appName,
                                         SipSessionsUtil sipSessionsUtil)
Removes the sip sessions util binding from the jndi mapping

Parameters:
appName - the application name subcontext
sipSessionsUtil - the sip sessions util to remove

addSipSessionsUtil

public static void addSipSessionsUtil(javax.naming.Context envCtx,
                                      java.lang.String appName,
                                      SipSessionsUtil sipSessionsUtil)
Add the sip sessions util binding from the jndi mapping and bind the sip sessions util in parameter to it

Parameters:
appName - the application name subcontext
sipSessionsUtil - the sip sessions util to add

removeTimerService

public static void removeTimerService(javax.naming.Context envCtx,
                                      java.lang.String appName,
                                      TimerService timerService)
Removes the Timer Service binding from the jndi mapping

Parameters:
appName - the application name subcontext
timerService - the Timer Service to remove

addTimerService

public static void addTimerService(javax.naming.Context envCtx,
                                   java.lang.String appName,
                                   TimerService timerService)
Add the sip timer service from the jndi mapping and bind the timer service in parameter to it

Parameters:
appName - the application name subcontext
timerService - the Timer Service to add

removeSipFactory

public static void removeSipFactory(javax.naming.Context envCtx,
                                    java.lang.String appName,
                                    SipFactory sipFactory)
Removes the sip factory binding from the jndi mapping

Parameters:
appName - the application name subcontext
sipFactory - the sip factory to remove

addSipFactory

public static void addSipFactory(javax.naming.Context envCtx,
                                 java.lang.String appName,
                                 SipFactory sipFactory)
Add the sip factory binding from the jndi mapping and bind the sip factory in paramter to it

Parameters:
appName -
sipFactory - the sip factory to add


Copyright © 2008. All Rights Reserved.