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
           
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
           
protected  int dispatcherThreadPoolSize
           
protected  int memoryThreshold
           
protected  java.lang.String outboundProxy
           
protected  SipApplicationDispatcher sipApplicationDispatcher
           
protected  java.lang.String sipApplicationDispatcherClassName
           
protected  int sipMessageQueueSize
           
 
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[] findSipConnectors()
           
 java.lang.String getAdditionalParameterableHeaders()
           
 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()
           
 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()
           
 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.
 boolean isBypassRequestExecutor()
           
 boolean isBypassResponseExecutor()
           
 boolean isGatherStatistics()
           
 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 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 setDispatcherThreadPoolSize(int dispatcherThreadPoolSize)
           
 void setGatherStatistics(boolean skipStatistics)
           
 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 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

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
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

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

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


Copyright © 2010. All Rights Reserved.