|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.remoting.detection.AbstractDetector
org.jboss.remoting.detection.jndi.JNDIDetector
public class JNDIDetector
This is a remoting detector for the remoting package which uses a JNDI server to maintain the registeries for remote invoker servers (stored as Detection messages). This detector is intended to be used in conjuntion with an external JNDI server that is already running. This is done by passing all the information needed to connect to the remote JNDI server via the setter methods. This can also be done within the jboss-service.xml. An example of the entry is as follows:
<mbean code="org.jboss.remoting.detection.jndi.JNDIDetector" name="jboss.remoting:service=Detector,transport=jndi">
<attribute name="Port">5555</attribute>
<attribute name="Host">foo.bar.com</attribute>
<attribute name="ContextFactory">org.jnp.interfaces.NamingContextFactory</attribute>
<attribute name="URLPackage">org.jboss.naming:org.jnp.interfaces</attribute>
</mbean>
Note: The above xml is for the JBoss JNP JNDI server, and has not be tested (just an example).
Be aware that just because this detector is stopped (and the entry removed from the JNDI server) remote JNDIDetectors may not recognize that the invoker servers are not available. This is because once remote invoker servers (connectors) are detected, they will be pinged directly to determine if they are no longer available. However, no new JNDIDetectors will detect your server once stopped. Also, please note that currently the detection registries are bound at the root context and not a sub context (which is on the todo list, but you know how that goes).
Important to also note that if any of the above attributes are set once the detector has started, they will not be used in connecting to the JNDI server until the detector is stopped and re-started (they do not change the JNDI server connection dynamically).
Field Summary | |
---|---|
static java.lang.String |
DETECTION_SUBCONTEXT_NAME
|
protected org.jboss.logging.Logger |
log
|
Fields inherited from class org.jboss.remoting.detection.AbstractDetector |
---|
mbeanserver, networkRegistry, objectName, registryObjectName |
Constructor Summary | |
---|---|
JNDIDetector()
|
|
JNDIDetector(java.util.Map config)
|
Method Summary | |
---|---|
protected void |
forceHeartbeat()
Used to force detection messages to be sent by remoting servers and consumed by detector and registered with network registry. |
int |
getCleanDetectionNumber()
Gets the number of detection iterations before manually pinging remote server to make sure still alive. |
java.lang.String |
getContextFactory()
The context factory string used when connecting to the JNDI server |
java.lang.String |
getHost()
Gets the host to use when connecting to JNDI server |
int |
getPort()
Gets the port used to connect to the JNDI Server. |
java.lang.String |
getSubContextName()
Gets the sub context name under which detection messages will be bound and looked up. |
java.lang.String |
getURLPackage()
The url package string used when connecting to JNDI server |
protected void |
heartbeat()
Creates connection to JNDI server (which should have already happened in start() method) and will begin checking for remote servers as well as registering itself so will be visible by remote detectors. |
void |
setCleanDetectionNumber(int cleanDetectionNumber)
Sets the number of detection iterations before manually pinging remote server to make sure still alive. |
void |
setContextFactory(java.lang.String contextFactory)
The context factory string to use when connecting to the JNDI server. |
void |
setHost(java.lang.String host)
Sets the host to use when connecting to JNDI server |
void |
setPort(int port)
Sets the port to use when connecting to JNDI server |
void |
setSubContextName(java.lang.String subContextName)
Sets the sub context name under which detection messages will be bound and looked up. |
void |
setURLPackage(java.lang.String urlPackage)
The url package string to use when connecting to the JNDI server. |
void |
start()
Will establish the connection to the JNDI server and start detection of other servers. |
void |
stop()
called by the MBeanServer to stop the mbean lifecycle |
Methods inherited from class org.jboss.remoting.detection.AbstractDetector |
---|
checkInvokerServer, createDetection, detect, forceDetection, getConfiguration, getDefaultTimeDelay, getHeartbeatDelay, getHeartbeatPeriod, getHeartbeatTimeDelay, getPingerDelay, getPingerPeriod, isRemoteDetection, postDeregister, postRegister, preDeregister, preRegister, setConfiguration, setDefaultTimeDelay, setHeartbeatTimeDelay, startHeartbeat, startPinger, stopHeartbeat, stopPinger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.remoting.detection.AbstractDetectorMBean |
---|
getConfiguration, getDefaultTimeDelay, getHeartbeatTimeDelay, setConfiguration, setDefaultTimeDelay, setHeartbeatTimeDelay |
Methods inherited from interface javax.management.MBeanRegistration |
---|
postDeregister, postRegister, preDeregister, preRegister |
Field Detail |
---|
public static final java.lang.String DETECTION_SUBCONTEXT_NAME
protected final org.jboss.logging.Logger log
Constructor Detail |
---|
public JNDIDetector()
public JNDIDetector(java.util.Map config)
Method Detail |
---|
public int getPort()
getPort
in interface JNDIDetectorMBean
public void setPort(int port)
setPort
in interface JNDIDetectorMBean
port
- public java.lang.String getHost()
getHost
in interface JNDIDetectorMBean
public void setHost(java.lang.String host)
setHost
in interface JNDIDetectorMBean
host
- public java.lang.String getContextFactory()
getContextFactory
in interface JNDIDetectorMBean
public void setSubContextName(java.lang.String subContextName)
subContextName
- public java.lang.String getSubContextName()
public void setContextFactory(java.lang.String contextFactory)
setContextFactory
in interface JNDIDetectorMBean
contextFactory
- public java.lang.String getURLPackage()
getURLPackage
in interface JNDIDetectorMBean
public void setURLPackage(java.lang.String urlPackage)
setURLPackage
in interface JNDIDetectorMBean
urlPackage
- public void start() throws java.lang.Exception
start
in interface Detector
start
in class AbstractDetector
java.lang.Exception
protected void heartbeat()
heartbeat
in class AbstractDetector
protected void forceHeartbeat()
AbstractDetector
forceHeartbeat
in class AbstractDetector
public int getCleanDetectionNumber()
getCleanDetectionNumber
in interface JNDIDetectorMBean
public void setCleanDetectionNumber(int cleanDetectionNumber)
setCleanDetectionNumber
in interface JNDIDetectorMBean
cleanDetectionNumber
- public void stop() throws java.lang.Exception
AbstractDetector
stop
in interface Detector
stop
in class AbstractDetector
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |