org.mobicents.servlet.sip.startup.failover
Class SipStandardBalancerNodeService
java.lang.Object
org.apache.catalina.core.StandardService
org.mobicents.servlet.sip.startup.SipStandardService
org.mobicents.servlet.sip.startup.failover.SipStandardBalancerNodeService
- All Implemented Interfaces:
- javax.management.MBeanRegistration, org.apache.catalina.Lifecycle, org.apache.catalina.Service, SipBalancerNodeService, SipService
public class SipStandardBalancerNodeService
- extends SipStandardService
- implements SipBalancerNodeService
Sip Servlet implementation of the Service interface.
This implementation extends the SipStandardService (that allows Tomcat to become a converged container)
with the failover features.
This implementation will send heartbeats and health information to the sip balancers configured for this service
(configured in the server.xml as balancers attribute fo the Service Tag)
- Author:
- Jean Deruelle
| 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 |
| Methods inherited from class org.mobicents.servlet.sip.startup.SipStandardService |
addConnector, getConcurrencyControlMode, getCongestionControlCheckingInterval, getCongestionControlPolicy, getDarConfigurationFileLocation, getMemoryThreshold, getSipApplicationDispatcher, getSipApplicationDispatcherClassName, getSipMessageQueueSize, removeConnector, setConcurrencyControlMode, setCongestionControlCheckingInterval, setCongestionControlPolicy, setDarConfigurationFileLocation, setMemoryThreshold, setSipApplicationDispatcher, setSipApplicationDispatcherClassName, setSipMessageQueueSize |
| 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 |
SipStandardBalancerNodeService
public SipStandardBalancerNodeService()
getInfo
public java.lang.String getInfo()
- Specified by:
getInfo in interface org.apache.catalina.Service- Overrides:
getInfo in class SipStandardService
initialize
public void initialize()
throws org.apache.catalina.LifecycleException
- Specified by:
initialize in interface org.apache.catalina.Service- Overrides:
initialize in class SipStandardService
- 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 SipStandardService
- 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 SipStandardService
- Throws:
org.apache.catalina.LifecycleException
getHeartBeatInterval
public long getHeartBeatInterval()
-
- Specified by:
getHeartBeatInterval in interface SipBalancerNodeService
setHeartBeatInterval
public void setHeartBeatInterval(long heartBeatInterval)
-
- Specified by:
setHeartBeatInterval in interface SipBalancerNodeService
getBalancers
public java.lang.String[] getBalancers()
-
- Specified by:
getBalancers in interface SipBalancerNodeService
- Returns:
- - list of String objects representing balancer addresses. Example
content:
- 192.168.1.100
- ala.ma.kota.pl
addBalancer
public boolean addBalancer(java.lang.String addr,
int sipPort)
-
- Specified by:
addBalancer in interface SipBalancerNodeService
addBalancer
public boolean addBalancer(java.lang.String hostName,
int sipPort,
int index)
- Adds balancer address to distribution list. Tries to connect to it.
- Specified by:
addBalancer in interface SipBalancerNodeService
- Parameters:
hostName - -
name of the host to be looked up in DNSindex - -
possible index of IP address when host has more than one
address - like InetAddress.getAllByName(..);
- Returns:
- true - if address didnt exist and it has been
injected into list
- false - otherwise
removeBalancer
public boolean removeBalancer(java.lang.String addr,
int sipPort)
- Tries to remove balancer with name: addr[0].addr[1].addr[2].addr[3]
- Specified by:
removeBalancer in interface SipBalancerNodeService
- Parameters:
addr - -
The argument is address representation in network byte order:
the highest order byte of the address is in [0].
- Returns:
- true - if name exists and was removed
- false - otherwise
removeBalancer
public boolean removeBalancer(java.lang.String hostName,
int sipPort,
int index)
-
- Specified by:
removeBalancer in interface SipBalancerNodeService
sendSwitchoverInstruction
public void sendSwitchoverInstruction(java.lang.String fromJvmRoute,
java.lang.String toJvmRoute)
- Parameters:
info -
setBalancers
public void setBalancers(java.lang.String balancers)
- Parameters:
balancers - the balancers to set
Copyright © 2009. All Rights Reserved.