org.mobicents.servlet.sip.startup
Class SipStandardService

java.lang.Object
  extended by org.apache.catalina.core.StandardService
      extended by org.mobicents.servlet.sip.startup.SipStandardService
All Implemented Interfaces:
javax.management.MBeanRegistration, org.apache.catalina.Lifecycle, org.apache.catalina.Service, SipService
Direct Known Subclasses:
SipStandardBalancerNodeService

public class SipStandardService
extends org.apache.catalina.core.StandardService
implements SipService

Sip Servlet implementation of the SipService interface. This class inherits from the Tomcat StandardService. It adds a SipApplicationDispatcher that will be listen for sip messages received by the sip stacks started by the sip connectors associated with this context. This has one attribute which is the sipApplicationDispatcherClassName allowing one to specify the class name of the sipApplicationDispacther to easily replace the default sipApplicationDispatcher with a custom one.

Author:
Jean Deruelle

Field Summary
protected  java.lang.String additionalParameterableHeaders
           
static java.lang.String AUTOMATIC_DIALOG_SUPPORT_STACK_PROP
           
protected  boolean bypassRequestExecutor
           
protected  boolean bypassResponseExecutor
           
protected  java.lang.String concurrencyControlMode
           
protected  long congestionControlCheckingInterval
           
protected  java.lang.String congestionControlPolicy
           
protected  boolean connectorsStartedExternally
           
protected  java.lang.String darConfigurationFileLocation
           
static java.lang.String DEBUG_LOG_STACK_PROP
           
static java.lang.String DEFAULT_SIP_PATH_NAME
           
protected  boolean dialogPendingRequestChecking
           
protected  int dispatcherThreadPoolSize
           
protected  boolean httpFollowsSip
           
static java.lang.String JVM_ROUTE
           
protected  java.lang.String jvmRoute
           
static java.lang.String LOOSE_DIALOG_VALIDATION
           
protected  int memoryThreshold
           
protected  java.lang.String outboundProxy
           
static java.lang.String PASS_INVITE_NON_2XX_ACK_TO_LISTENER
           
static java.lang.String SERVER_HEADER
           
static java.lang.String SERVER_LOG_STACK_PROP
           
protected  SipApplicationDispatcher sipApplicationDispatcher
           
protected  java.lang.String sipApplicationDispatcherClassName
           
protected  int sipMessageQueueSize
           
static java.lang.String TCP_POST_PARSING_THREAD_POOL_SIZE
           
static java.lang.String USER_AGENT_HEADER
           
 
Fields inherited from class org.apache.catalina.core.StandardService
connectors, container, controller, domain, executors, initialized, mserver, oname, suffix, support, type
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
SipStandardService()
           
 
Method Summary
 void addConnector(org.apache.catalina.connector.Connector connector)
           
 boolean addSipConnector(SipConnector sipConnector)
           
protected  javax.management.ObjectName createSipConnectorObjectName(org.apache.catalina.connector.Connector connector, java.lang.String domain, java.lang.String type)
           
 SipConnector findSipConnector(java.lang.String transport)
           
 SipConnector[] findSipConnectors()
           
 java.lang.String getAdditionalParameterableHeaders()
           
 java.lang.String getAddressResolverClass()
           
 int getBackToNormalMemoryThreshold()
           
 int getBackToNormalSipMessageQueueSize()
           
 int getBaseTimerInterval()
           
 java.lang.String getConcurrencyControlMode()
          ConcurrencyControl control mode is SipSession, AppSession or None Specifies the isolation level of concurrently executing requests.
 long getCongestionControlCheckingInterval()
           
 java.lang.String getCongestionControlPolicy()
           
 java.lang.String getDarConfigurationFileLocation()
           
 int getDispatcherThreadPoolSize()
           
 boolean getGatherStatistics()
          PRESENT TO ACCOMODATE JOPR.
 java.lang.String getInfo()
           
 java.lang.String getJvmRoute()
           
 int getMemoryThreshold()
           
 java.lang.String getOutboundProxy()
           
 SipApplicationDispatcher getSipApplicationDispatcher()
          Retrieve the sip application dispatcher associated with this service
 java.lang.String getSipApplicationDispatcherClassName()
          Retrieve the sip application dispatcher class name
 int getSipMessageQueueSize()
          Message queue size.
 java.lang.String getSipPathName()
           
 javax.sip.SipStack getSipStack()
          *Get the underlying SIP Stack handling the incoming and outgoing SIP Messages
 java.util.Properties getSipStackProperties()
           
 java.lang.String getSipStackPropertiesFile()
           
 int getT2Interval()
           
 int getT4Interval()
           
 int getTimerDInterval()
           
 void initialize()
           
 void initializeSystemPortProperties()
          This method simply makes the HTTP and SSL ports avaialble everywhere in the JVM in order jsip ha to read them for balancer description purposes.
protected  void initSipStack()
           
 boolean isBypassRequestExecutor()
           
 boolean isBypassResponseExecutor()
           
 boolean isDialogPendingRequestChecking()
          Whether we check for pending requests and return 491 response if there are any
 boolean isGatherStatistics()
           
 boolean isHttpFollowsSip()
           
 boolean isUsePrettyEncoding()
           
protected  void registerSipConnector(org.apache.catalina.connector.Connector connector)
          Register the sip connector under a different name than HTTP Connector and we add the transport to avoid clashing with 2 connectors having the same port and address
 void removeConnector(org.apache.catalina.connector.Connector connector)
           
 boolean removeSipConnector(java.lang.String ipAddress, int port, java.lang.String transport)
           
 void setAdditionalParameterableHeaders(java.lang.String additionalParameterableHeaders)
           
 void setAddressResolverClass(java.lang.String dnsAddressResolverClass)
           
 void setBackToNormalMemoryThreshold(int backToNormalMemoryThreshold)
           
 void setBackToNormalSipMessageQueueSize(int backToNormalSipMessageQueueSize)
           
 void setBalancers(java.lang.String balancers)
          Deprecated.  
 void setBaseTimerInterval(int baseTimerInterval)
           
 void setBypassRequestExecutor(boolean bypassRequestExecutor)
           
 void setBypassResponseExecutor(boolean bypassResponseExecutor)
           
 void setConcurrencyControlMode(java.lang.String concurrencyControlMode)
          ConcurrencyControl control mode is SipSession, AppSession or None Specifies the isolation level of concurrently executing requests.
 void setCongestionControlCheckingInterval(long congestionControlCheckingInterval)
           
 void setCongestionControlPolicy(java.lang.String congestionControlPolicy)
           
 void setDarConfigurationFileLocation(java.lang.String darConfigurationFileLocation)
           
 void setDialogPendingRequestChecking(boolean dialogPendingRequestChecking)
          Whether we check for pending requests and return 491 response if there are any
 void setDispatcherThreadPoolSize(int dispatcherThreadPoolSize)
           
 void setGatherStatistics(boolean skipStatistics)
           
 void setHttpFollowsSip(boolean httpFollowsSip)
           
 void setJvmRoute(java.lang.String jvmRoute)
           
 void setMemoryThreshold(int memoryThreshold)
           
 void setOutboundProxy(java.lang.String outboundProxy)
           
 void setSipApplicationDispatcher(SipApplicationDispatcher sipApplicationDispatcher)
          Set the sip application dispatcher associated with this service
 void setSipApplicationDispatcherClassName(java.lang.String sipApplicationDispatcherName)
          Set the sip application dispatcher class name
 void setSipMessageQueueSize(int sipMessageQueueSize)
          Message queue size.
 void setSipPathName(java.lang.String sipPathName)
           
 void setSipStackProperties(java.util.Properties sipStackProperties)
           
 void setSipStackPropertiesFile(java.lang.String sipStackPropertiesFile)
           
 void setT2Interval(int t2Interval)
           
 void setT4Interval(int t4Interval)
           
 void setTimerDInterval(int timerDInterval)
           
 void setUsePrettyEncoding(boolean usePrettyEncoding)
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.apache.catalina.core.StandardService
addExecutor, addLifecycleListener, addPropertyChangeListener, destroy, findConnectors, findExecutors, findLifecycleListeners, getConnectorNames, getContainer, getContainerName, getDomain, getExecutor, getName, getObjectName, getServer, init, postDeregister, postRegister, preDeregister, preRegister, removeExecutor, removeLifecycleListener, removePropertyChangeListener, setContainer, setName, setServer, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.catalina.Service
addExecutor, findConnectors, findExecutors, getContainer, getExecutor, getName, getServer, removeExecutor, setContainer, setName, setServer
 

Field Detail

DEFAULT_SIP_PATH_NAME

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

PASS_INVITE_NON_2XX_ACK_TO_LISTENER

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

TCP_POST_PARSING_THREAD_POOL_SIZE

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

AUTOMATIC_DIALOG_SUPPORT_STACK_PROP

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

LOOSE_DIALOG_VALIDATION

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

SERVER_LOG_STACK_PROP

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

DEBUG_LOG_STACK_PROP

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

SERVER_HEADER

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

USER_AGENT_HEADER

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

JVM_ROUTE

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

sipApplicationDispatcherClassName

protected java.lang.String sipApplicationDispatcherClassName

sipApplicationDispatcher

protected SipApplicationDispatcher sipApplicationDispatcher

sipMessageQueueSize

protected int sipMessageQueueSize

memoryThreshold

protected int memoryThreshold

outboundProxy

protected java.lang.String outboundProxy

congestionControlCheckingInterval

protected long congestionControlCheckingInterval

dispatcherThreadPoolSize

protected int dispatcherThreadPoolSize

concurrencyControlMode

protected java.lang.String concurrencyControlMode

congestionControlPolicy

protected java.lang.String congestionControlPolicy

additionalParameterableHeaders

protected java.lang.String additionalParameterableHeaders

bypassResponseExecutor

protected boolean bypassResponseExecutor

bypassRequestExecutor

protected boolean bypassRequestExecutor

darConfigurationFileLocation

protected java.lang.String darConfigurationFileLocation

connectorsStartedExternally

protected boolean connectorsStartedExternally

dialogPendingRequestChecking

protected boolean dialogPendingRequestChecking

httpFollowsSip

protected boolean httpFollowsSip

jvmRoute

protected java.lang.String jvmRoute
Constructor Detail

SipStandardService

public SipStandardService()
Method Detail

getInfo

public java.lang.String getInfo()
Specified by:
getInfo in interface org.apache.catalina.Service
Overrides:
getInfo in class org.apache.catalina.core.StandardService

addConnector

public void addConnector(org.apache.catalina.connector.Connector connector)
Specified by:
addConnector in interface org.apache.catalina.Service
Overrides:
addConnector in class org.apache.catalina.core.StandardService

registerSipConnector

protected void registerSipConnector(org.apache.catalina.connector.Connector connector)
Register the sip connector under a different name than HTTP Connector and we add the transport to avoid clashing with 2 connectors having the same port and address

Parameters:
connector - connector to register

removeConnector

public void removeConnector(org.apache.catalina.connector.Connector connector)
Specified by:
removeConnector in interface org.apache.catalina.Service
Overrides:
removeConnector in class org.apache.catalina.core.StandardService

initialize

public void initialize()
                throws org.apache.catalina.LifecycleException
Specified by:
initialize in interface org.apache.catalina.Service
Overrides:
initialize in class org.apache.catalina.core.StandardService
Throws:
org.apache.catalina.LifecycleException

start

public void start()
           throws org.apache.catalina.LifecycleException
Specified by:
start in interface org.apache.catalina.Lifecycle
Overrides:
start in class org.apache.catalina.core.StandardService
Throws:
org.apache.catalina.LifecycleException

getJvmRoute

public java.lang.String getJvmRoute()

setJvmRoute

public void setJvmRoute(java.lang.String jvmRoute)

initSipStack

protected void initSipStack()
                     throws org.apache.catalina.LifecycleException
Throws:
org.apache.catalina.LifecycleException

stop

public void stop()
          throws org.apache.catalina.LifecycleException
Specified by:
stop in interface org.apache.catalina.Lifecycle
Overrides:
stop in class org.apache.catalina.core.StandardService
Throws:
org.apache.catalina.LifecycleException

getSipApplicationDispatcherClassName

public java.lang.String getSipApplicationDispatcherClassName()
Retrieve the sip application dispatcher class name

Returns:
the sip application dispatcher class name

setSipApplicationDispatcherClassName

public void setSipApplicationDispatcherClassName(java.lang.String sipApplicationDispatcherName)
Set the sip application dispatcher class name

Parameters:
sipApplicationDispatcherClassName - the sip application dispatcher class name to be set

getSipApplicationDispatcher

public SipApplicationDispatcher getSipApplicationDispatcher()
Description copied from interface: SipService
Retrieve the sip application dispatcher associated with this service

Specified by:
getSipApplicationDispatcher in interface SipService
Returns:
the sipApplicationDispatcher

setSipApplicationDispatcher

public void setSipApplicationDispatcher(SipApplicationDispatcher sipApplicationDispatcher)
Description copied from interface: SipService
Set the sip application dispatcher associated with this service

Specified by:
setSipApplicationDispatcher in interface SipService
Parameters:
sipApplicationDispatcher - the sipApplicationDispatcher to set

getDarConfigurationFileLocation

public java.lang.String getDarConfigurationFileLocation()
Returns:
the darConfigurationFileLocation

setDarConfigurationFileLocation

public void setDarConfigurationFileLocation(java.lang.String darConfigurationFileLocation)
Parameters:
darConfigurationFileLocation - the darConfigurationFileLocation to set

getSipMessageQueueSize

public int getSipMessageQueueSize()
Message queue size. If the number of pending requests exceeds this number they are rejected.

Returns:

setSipMessageQueueSize

public void setSipMessageQueueSize(int sipMessageQueueSize)
Message queue size. If the number of pending requests exceeds this number they are rejected.


getConcurrencyControlMode

public java.lang.String getConcurrencyControlMode()
ConcurrencyControl control mode is SipSession, AppSession or None Specifies the isolation level of concurrently executing requests.

Returns:

setConcurrencyControlMode

public void setConcurrencyControlMode(java.lang.String concurrencyControlMode)
ConcurrencyControl control mode is SipSession, AppSession or None Specifies the isolation level of concurrently executing requests.


setMemoryThreshold

public void setMemoryThreshold(int memoryThreshold)
Parameters:
memoryThreshold - the memoryThreshold to set

getMemoryThreshold

public int getMemoryThreshold()
Returns:
the memoryThreshold

setGatherStatistics

public void setGatherStatistics(boolean skipStatistics)
Parameters:
skipStatistics - the skipStatistics to set

isGatherStatistics

public boolean isGatherStatistics()
Returns:
the skipStatistics

getGatherStatistics

public boolean getGatherStatistics()
PRESENT TO ACCOMODATE JOPR. NEED TO FILE A BUG ON THIS

Returns:
the skipStatistics

setBackToNormalMemoryThreshold

public void setBackToNormalMemoryThreshold(int backToNormalMemoryThreshold)
Parameters:
backToNormalPercentageOfMemoryUsed - the backToNormalPercentageOfMemoryUsed to set

getBackToNormalMemoryThreshold

public int getBackToNormalMemoryThreshold()
Returns:
the backToNormalPercentageOfMemoryUsed

setBackToNormalSipMessageQueueSize

public void setBackToNormalSipMessageQueueSize(int backToNormalSipMessageQueueSize)
Parameters:
backToNormalQueueSize - the backToNormalQueueSize to set

getBackToNormalSipMessageQueueSize

public int getBackToNormalSipMessageQueueSize()
Returns:
the backToNormalQueueSize

setCongestionControlPolicy

public void setCongestionControlPolicy(java.lang.String congestionControlPolicy)
Parameters:
congestionControlPolicy - the congestionControlPolicy to set

getCongestionControlPolicy

public java.lang.String getCongestionControlPolicy()
Returns:
the congestionControlPolicy

setCongestionControlCheckingInterval

public void setCongestionControlCheckingInterval(long congestionControlCheckingInterval)
Parameters:
congestionControlCheckingInterval - the congestionControlCheckingInterval to set

getCongestionControlCheckingInterval

public long getCongestionControlCheckingInterval()
Returns:
the congestionControlCheckingInterval

getAdditionalParameterableHeaders

public java.lang.String getAdditionalParameterableHeaders()

setAdditionalParameterableHeaders

public void setAdditionalParameterableHeaders(java.lang.String additionalParameterableHeaders)

isBypassResponseExecutor

public boolean isBypassResponseExecutor()
Returns:
the bypassResponseExecutor

setBypassResponseExecutor

public void setBypassResponseExecutor(boolean bypassResponseExecutor)
Parameters:
bypassResponseExecutor - the bypassResponseExecutor to set

isBypassRequestExecutor

public boolean isBypassRequestExecutor()
Returns:
the bypassRequestExecutor

setBypassRequestExecutor

public void setBypassRequestExecutor(boolean bypassRequestExecutor)
Parameters:
bypassRequestExecutor - the bypassRequestExecutor to set

setUsePrettyEncoding

public void setUsePrettyEncoding(boolean usePrettyEncoding)
Parameters:
usePrettyEncoding - the usePrettyEncoding to set

isUsePrettyEncoding

public boolean isUsePrettyEncoding()
Returns:
the usePrettyEncoding

setSipPathName

public void setSipPathName(java.lang.String sipPathName)
Parameters:
sipPathName - the sipPathName to set

getSipPathName

public java.lang.String getSipPathName()
Returns:
the sipPathName

setBaseTimerInterval

public void setBaseTimerInterval(int baseTimerInterval)
Parameters:
baseTimerInterval - the baseTimerInterval to set

getBaseTimerInterval

public int getBaseTimerInterval()
Returns:
the baseTimerInterval

getOutboundProxy

public java.lang.String getOutboundProxy()

setOutboundProxy

public void setOutboundProxy(java.lang.String outboundProxy)

getDispatcherThreadPoolSize

public int getDispatcherThreadPoolSize()

setDispatcherThreadPoolSize

public void setDispatcherThreadPoolSize(int dispatcherThreadPoolSize)

setBalancers

public void setBalancers(java.lang.String balancers)
Deprecated. 

Parameters:
balancers - the balancers to set

addSipConnector

public boolean addSipConnector(SipConnector sipConnector)
                        throws java.lang.Exception
Throws:
java.lang.Exception

removeSipConnector

public boolean removeSipConnector(java.lang.String ipAddress,
                                  int port,
                                  java.lang.String transport)
                           throws java.lang.Exception
Throws:
java.lang.Exception

findSipConnector

public SipConnector findSipConnector(java.lang.String transport)

findSipConnectors

public SipConnector[] findSipConnectors()

initializeSystemPortProperties

public void initializeSystemPortProperties()
This method simply makes the HTTP and SSL ports avaialble everywhere in the JVM in order jsip ha to read them for balancer description purposes. There is no other good way to communicate the properies to jsip ha without adding more dependencies.


createSipConnectorObjectName

protected javax.management.ObjectName createSipConnectorObjectName(org.apache.catalina.connector.Connector connector,
                                                                   java.lang.String domain,
                                                                   java.lang.String type)
                                                            throws javax.management.MalformedObjectNameException
Throws:
javax.management.MalformedObjectNameException

setT2Interval

public void setT2Interval(int t2Interval)
Parameters:
t2Interval - the t2Interval to set

getT2Interval

public int getT2Interval()
Returns:
the t2Interval

setT4Interval

public void setT4Interval(int t4Interval)
Parameters:
t4Interval - the t4Interval to set

getT4Interval

public int getT4Interval()
Returns:
the t4Interval

setTimerDInterval

public void setTimerDInterval(int timerDInterval)
Parameters:
timerDInterval - the timerDInterval to set

getTimerDInterval

public int getTimerDInterval()
Returns:
the timerDInterval

setSipStackPropertiesFile

public void setSipStackPropertiesFile(java.lang.String sipStackPropertiesFile)
Parameters:
sipStackPropertiesFile - the sipStackPropertiesFile to set

getSipStackProperties

public java.util.Properties getSipStackProperties()
Returns:
the sipStackProperties

setSipStackProperties

public void setSipStackProperties(java.util.Properties sipStackProperties)
Parameters:
sipStackProperties - the sipStackProperties to set

getSipStackPropertiesFile

public java.lang.String getSipStackPropertiesFile()
Returns:
the sipStackPropertiesFile

setAddressResolverClass

public void setAddressResolverClass(java.lang.String dnsAddressResolverClass)
Parameters:
dnsAddressResolverClass - the dnsAddressResolverClass to set

getAddressResolverClass

public java.lang.String getAddressResolverClass()
Returns:
the dnsAddressResolverClass

isDialogPendingRequestChecking

public boolean isDialogPendingRequestChecking()
Whether we check for pending requests and return 491 response if there are any

Returns:
the flag value

setDialogPendingRequestChecking

public void setDialogPendingRequestChecking(boolean dialogPendingRequestChecking)
Whether we check for pending requests and return 491 response if there are any

Parameters:
dialogPendingRequestChecking -

isHttpFollowsSip

public boolean isHttpFollowsSip()

setHttpFollowsSip

public void setHttpFollowsSip(boolean httpFollowsSip)

getSipStack

public javax.sip.SipStack getSipStack()
Description copied from interface: SipService
*Get the underlying SIP Stack handling the incoming and outgoing SIP Messages

Specified by:
getSipStack in interface SipService
Returns:
the sipStack


Copyright © 2010. All Rights Reserved.