|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.remoting.transporter.InternalTransporterServices
public class InternalTransporterServices
This is a singleton that maintains internal services required for all transporter servers and clients. The transporter server and client use these services to perform their functions. These "services" include an MBeanServer, a Detector to detect other servers on the network and a Network Registry used to maintain a list of known servers that have been detected.
End-users do not have to interface with this singleton unless they want to customize the services used by the
transporter framework. Call setup(MBeanServer)
to setup this singleton with an MBeanServer that is to
be used to house all the internal services. You can then
assign a detector
and/or
assign a network registry
to this singleton.
You can setup and assign those services all in one call via
setup(MBeanServer, Detector, ObjectName, NetworkRegistry, ObjectName, boolean, boolean)
.
The Network Registry and Detector objects are only needed if you want the transporter server/client to use their clustering feature.
Note that once this singleton is setup, it cannot be setup again. You must first reset()
it in order
to re-setup the singleton.
Field Summary | |
---|---|
static javax.management.ObjectName |
DEFAULT_DETECTOR_OBJECTNAME
The default detector name if one is not provided. |
static javax.management.ObjectName |
DEFAULT_NETWORKREGISTRY_OBJECTNAME
The default network registry name if one is not provided. |
Method Summary | |
---|---|
void |
assignDetector(Detector detector,
javax.management.ObjectName detectorName,
boolean registerDetector)
This will assign a detector to this singleton if one has not yet been setup. |
void |
assignNetworkRegistry(NetworkRegistry registry,
javax.management.ObjectName registryName,
boolean registerRegistry)
This will assign a network registry to this singleton if one has not yet been setup. |
Detector |
getDetector()
Returns the detector used to auto-detect other servers on the network. |
javax.management.ObjectName |
getDetectorName()
Returns the name of the detector used to auto-detect other servers on the network. |
static InternalTransporterServices |
getInstance()
Returns the singleton instance containing the services used by all TransporterServer and
TransporterClient instances. |
javax.management.MBeanServer |
getMBeanServer()
Returns the MBeanServer that will house all the internal services. |
NetworkRegistry |
getNetworkRegistry()
Returns the network registry used to maintain the list of known servers. |
javax.management.ObjectName |
getNetworkRegistryName()
Returns the name of the network registry used to maintain the list of known
servers. |
boolean |
isSetup()
Returns true if the internal transporter services singleton has been setup. |
void |
reset()
If the caller wants to reset this singleton (e.g. |
void |
setup(javax.management.MBeanServer mbs)
Sets the MBeanServer used to house the transporter services. |
void |
setup(javax.management.MBeanServer mbs,
Detector detector,
javax.management.ObjectName detectorName,
NetworkRegistry registry,
javax.management.ObjectName registryName,
boolean registerDetector,
boolean registerRegistry)
Sets the MBeanServer used to house the transporter services, assigns the detector used to auto-detect other servers on the network and assigns the network registry that maintains the list of known servers on the network. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final javax.management.ObjectName DEFAULT_DETECTOR_OBJECTNAME
public static final javax.management.ObjectName DEFAULT_NETWORKREGISTRY_OBJECTNAME
Method Detail |
---|
public static InternalTransporterServices getInstance()
TransporterServer
and
TransporterClient
instances.
public javax.management.MBeanServer getMBeanServer()
public Detector getDetector()
public javax.management.ObjectName getDetectorName()
detector
used to auto-detect other servers on the network.
public NetworkRegistry getNetworkRegistry()
public javax.management.ObjectName getNetworkRegistryName()
network registry
used to maintain the list of known
servers.
public boolean isSetup()
true
if the internal transporter services singleton has been setup. When this returns
true
, you can be guaranteed that a non-null
MBeanServer
has been given to this singleton. A detector and/or network registry may or may not be registered - it all
depends on how the singleton was set up and if those services were assigned to this singleton.
true
if this singleton has already been setup; false
if it has not been
setup yetpublic void reset()
public void assignDetector(Detector detector, javax.management.ObjectName detectorName, boolean registerDetector) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.Exception
MBean Server
yet, this will throw an exception. If a
detector
has already been assigned, this will throw an exception. If
registerDetector
is true
, the given detector will be registered on the
MBeanServer
under the given name; if it is false
, it will be assumed
the detector is already registered under that name and does not have to be registered here.
detector
- the detector to assign to this singleton (must not be null
)detectorName
- the name the detector will be registered as (if null
, a default name is
used)registerDetector
- if true
, will register the detector with the given name in the
MBeanServer
java.lang.IllegalStateException
- if the MBeanServer is not setup yet or there is already a detector assigned
java.lang.IllegalArgumentException
- if detector is null
java.lang.Exception
- any other exception means the detector failed to get registered in the
MBeanServerpublic void assignNetworkRegistry(NetworkRegistry registry, javax.management.ObjectName registryName, boolean registerRegistry) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.Exception
MBean Server
yet, this will throw an exception. If a
registry
has already been assigned, this will throw an exception. If
registerRegistry
is true
, the given registry will be registered on the
MBeanServer
with the given name; if it is false
, it will be assumed
the registry is already registered under that name and does not have to be registered here.
registry
- the network registry to assign to this singleton (must not be null
)registryName
- the name the registry will be registered as (if null
a default name is
used)registerRegistry
- if true
, will register the network registry with the given name in the
MBeanServer
java.lang.IllegalStateException
- if the MBeanServer is not setup yet or there is already a registry assigned
java.lang.IllegalArgumentException
- if registry is null
java.lang.Exception
- any other exception means the registry failed to get registered in the
MBeanServerpublic void setup(javax.management.MBeanServer mbs) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
mbs
- the MBeanServer that will house the internal services
java.lang.IllegalArgumentException
- if mbs
is null
java.lang.IllegalStateException
- if the singleton was already setuppublic void setup(javax.management.MBeanServer mbs, Detector detector, javax.management.ObjectName detectorName, NetworkRegistry registry, javax.management.ObjectName registryName, boolean registerDetector, boolean registerRegistry) throws java.lang.Exception
registerXXX
parameter is true
, an exception is thrown.
mbs
- the MBeanServer that will house the internal services (must not be
null
)detector
- the detector that will listen for other servers on the networkdetectorName
- the name of the detector as it is or will be registered in the MBeanServer (if
null
, a default name will be used)registry
- the network registry that will maintain the list of known servers on the networkregistryName
- the name of the network registry as it is or will be registered in the MBeanServer
(if null
, a default name will be used)registerDetector
- if true
, will register the detector with the given nameregisterRegistry
- if true
, will register the network registry with the given name
java.lang.IllegalStateException
- if the singleton was already setup
java.lang.IllegalArgumentException
- if the MBeanServer is null
or detector is null
but
its name is not or registry is null
but its name is not
java.lang.Exception
- if this method failed to register the detector or registryassignDetector(Detector, ObjectName, boolean)
,
assignNetworkRegistry(NetworkRegistry, ObjectName, boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |