|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener
public class JBossRemotingGatewayListener
JBoss Remoting listener implementation for receiving ESB unaware messages over a JBoss Remoting channel.
This class implements the JBoss Remoting interfaceServerInvocationHandler
.
Messages are pushed in through the invoke(org.jboss.remoting.InvocationRequest)
method,
which is an implementation of the ServerInvocationHandler.invoke(org.jboss.remoting.InvocationRequest)
method.
The JBoss Remoting Connector
configuration is populated by the initaliseJBRConnectorConfiguration(java.util.Map)
method. The remoting server locator URI is constructed by the
getJbrServerLocatorURI()
method.
The default MessageComposer
used by this listener is the
JBossRemotingGatewayListener.JBossRemotingMessageComposer
. All
message composer implementation supplied to this class will be supplied an instance of
InvocationRequest
, from which they must compose an ESB aware
Message
instance.
See the JBoss Remoting docs
for details on configuring specific remoting server protocols.
Nested Class Summary | |
---|---|
static class |
JBossRemotingGatewayListener.JBossRemotingMessageComposer<T extends org.jboss.remoting.InvocationRequest>
Message composer for a JBoss Remoting InvocationRequest
instance. |
Field Summary | |
---|---|
static java.lang.String |
JBR_PREFIX
JBoss Remoting connector config attribute name prefix. |
static java.lang.String |
JBR_SERVER_HOST
Server Host config attribute name. |
static java.lang.String |
JBR_SERVER_PORT
Server port config attribute name. |
static java.lang.String |
JBR_SERVER_PROTOCOL
Server Protocol config attribute name. |
Fields inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle |
---|
PARAM_TERMINATION_PERIOD |
Constructor Summary | |
---|---|
JBossRemotingGatewayListener(ConfigTree config)
Construct the threaded managed lifecycle. |
Method Summary | |
---|---|
void |
addListener(org.jboss.remoting.callback.InvokerCallbackHandler invokerCallbackHandler)
|
protected UncomposedMessageDeliveryAdapter |
createDeliveryAdapter()
Factory method for adapter creation. |
protected void |
doDestroy()
Handle the destroy of the managed instance. |
protected void |
doInitialise()
Handle the initialisation of the managed instance. |
protected void |
doStart()
Handle the start of the managed instance. |
protected void |
doStop()
Handle the stop of the managed instance. |
protected java.net.URI |
getJbrServerLocatorURI()
Get the Service Locator URI for this remotng based listener. |
protected void |
initaliseJBRConnectorConfiguration(java.util.Map<java.lang.String,java.lang.String> connectorConfig)
Initialise the JBossRemoting connector configuration. |
java.lang.Object |
invoke(org.jboss.remoting.InvocationRequest invocationRequest)
Process a remoting invocation message. |
boolean |
isInitialised()
Is this listener instance initialised. |
boolean |
isStarted()
Is this listener instance started. |
void |
removeListener(org.jboss.remoting.callback.InvokerCallbackHandler invokerCallbackHandler)
|
void |
setInvoker(org.jboss.remoting.ServerInvoker serverInvoker)
|
void |
setMBeanServer(javax.management.MBeanServer mBeanServer)
|
Methods inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle |
---|
addManagedLifecycleEventListener, changeState, destroy, getConfig, getState, getTerminationPeriod, initialise, removeManagedLifecycleEventListener, start, stop, waitUntilDestroyed, waitUntilDestroyed, waitUntilNotState, waitUntilState |
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.ServerInvocationHandler |
---|
toString |
Field Detail |
---|
public static final java.lang.String JBR_PREFIX
public static final java.lang.String JBR_SERVER_PROTOCOL
public static final java.lang.String JBR_SERVER_HOST
public static final java.lang.String JBR_SERVER_PORT
Constructor Detail |
---|
public JBossRemotingGatewayListener(ConfigTree config) throws ConfigurationException
config
- The configuration associated with this instance.
ConfigurationException
- for configuration errors during initialisation.Method Detail |
---|
public boolean isInitialised()
public boolean isStarted()
protected void doInitialise() throws ManagedLifecycleException
AbstractManagedLifecycle
doInitialise
in class AbstractManagedLifecycle
ManagedLifecycleException
- for errors while initialisation.protected void doStart() throws ManagedLifecycleException
AbstractManagedLifecycle
doStart
in class AbstractManagedLifecycle
ManagedLifecycleException
- for errors while starting.protected void doStop() throws ManagedLifecycleException
AbstractManagedLifecycle
doStop
in class AbstractManagedLifecycle
ManagedLifecycleException
- for errors while stopping.protected void doDestroy() throws ManagedLifecycleException
AbstractManagedLifecycle
doDestroy
in class AbstractManagedLifecycle
ManagedLifecycleException
- for errors while destroying.public java.lang.Object invoke(org.jboss.remoting.InvocationRequest invocationRequest) throws java.lang.Throwable
UncomposedMessageDeliveryAdapter
to carry out the delivery. This delivery adpter is constructed with a
MessageComposer
instance supplied through
configuration, otherwise it uses the
JBossRemotingGatewayListener.JBossRemotingMessageComposer
.
The message composer is responsible for mapping the remoting InvocationRequest
into an ESB aware Message
, while the
UncomposedMessageDeliveryAdapter
is responsible for its
delivery to the target service.
invoke
in interface org.jboss.remoting.ServerInvocationHandler
invocationRequest
- JBoss Remoting request.
java.lang.Throwable
- Message processing failure.public void setMBeanServer(javax.management.MBeanServer mBeanServer)
setMBeanServer
in interface org.jboss.remoting.ServerInvocationHandler
public void setInvoker(org.jboss.remoting.ServerInvoker serverInvoker)
setInvoker
in interface org.jboss.remoting.ServerInvocationHandler
public void addListener(org.jboss.remoting.callback.InvokerCallbackHandler invokerCallbackHandler)
addListener
in interface org.jboss.remoting.ServerInvocationHandler
public void removeListener(org.jboss.remoting.callback.InvokerCallbackHandler invokerCallbackHandler)
removeListener
in interface org.jboss.remoting.ServerInvocationHandler
protected void initaliseJBRConnectorConfiguration(java.util.Map<java.lang.String,java.lang.String> connectorConfig) throws ConfigurationException
InvokerLocator
URI
through a call to getJbrServerLocatorURI()
. Also
populates the server connector properties.
Default behavior for population of the connector configuration is to load
all listener configuration properties whose name is prefixed with "jbr-",
stripping off the "jbr-" prefix from the name before adding.
So, to set the Server "timeout" configuration property
on the connector, you set the property name to "jbr-timeout".
connectorConfig
- The configuration map instance to be populated.
ConfigurationException
- Problem populating the configuration.protected java.net.URI getJbrServerLocatorURI() throws ConfigurationException
protcol
,
host
and port
parameters for the server. The host address defaults to
the value returned by InetAddress.getLocalHost()
.
ConfigurationException
- One or more of the locator properties
are missing from the listener config.protected UncomposedMessageDeliveryAdapter createDeliveryAdapter() throws ConfigurationException
ConfigurationException
- Configuration error.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |