|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.ejb.plugins.jms.JMSContainerInvoker
public class JMSContainerInvoker
EJBProxyFactory for JMS MessageDrivenBeans
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jboss.ejb.GenericEntityObjectFactory |
---|
GenericEntityObjectFactory.UTIL |
Field Summary | |
---|---|
protected int |
acknowledgeMode
JMS acknowledge mode, used when session is not XA. |
protected javax.jms.Connection |
connection
The JMS connection. |
protected javax.jms.ConnectionConsumer |
connectionConsumer
The JMS connection consumer. |
protected Container |
container
The container. |
protected boolean |
createJBossMQDestination
|
protected static String |
DEFAULT_DESTINATION_TYPE
Default destination type. |
protected boolean |
deliveryActive
|
protected Element |
dlqConfig
DLQConfig element from MDBConfig element from jboss.xml. |
protected DLQHandler |
dlqHandler
Dead letter queue handler. |
protected org.jboss.ejb.plugins.jms.JMSContainerInvoker.ExceptionListenerImpl |
exListener
|
protected String |
invokerBinding
|
protected InvokerProxyBindingMetaData |
invokerMetaData
|
protected boolean |
isContainerManagedTx
|
protected boolean |
isNotSupportedTx
|
protected long |
keepAlive
Keep alive server sessions. |
protected int |
maxMessagesNr
Maximum number provider is allowed to stuff into a session. |
protected int |
maxPoolSize
Maximun pool size of server sessions. |
protected int |
minPoolSize
Minimun pool size of server sessions. |
protected static Method |
ON_MESSAGE
MessageListener.onMessage(javax.jms.Message) reference. |
protected boolean |
optimize
|
protected javax.jms.ServerSessionPool |
pool
|
protected String |
providerAdapterJNDI
JNDI name of the provider adapter. |
protected long |
reconnectInterval
Time to wait before retrying to reconnect a lost connection. |
protected String |
serverSessionPoolFactoryJNDI
JNDI name of the server session factory. |
protected TransactionManager |
tm
|
protected boolean |
useDLQ
If Dead letter queue should be used or not. |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
---|
server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ServiceMBean |
---|
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
---|---|
JMSContainerInvoker()
|
Method Summary | |
---|---|
protected javax.jms.Destination |
createDestination(Class type,
Context ctx,
String jndiName,
String jndiSuffix)
Create and or lookup a JMS destination. |
protected void |
createService()
Initialize the container invoker. |
protected javax.jms.ServerSessionPool |
createSessionPool(javax.jms.Destination destination,
javax.jms.Connection connection,
int minSession,
int maxSession,
long keepAlive,
boolean isTransacted,
int ack,
javax.jms.MessageListener listener)
Create a server session pool for the given connection. |
protected String |
getActivationConfigProperty(String property)
|
boolean |
getCreateJBossMQDestination()
Get whether JBossMQ destinations should be constructed when the destination is not in JNDI |
boolean |
getDeliveryActive()
Get whether delivery is active |
protected String |
getDestinationType(Context ctx,
String destinationJNDI)
Try to get a destination type by looking up the destination JNDI, or provide a default if there is not destinationJNDI or if it is not possible to lookup. |
Object |
getEJBHome()
This method is called whenever the EJBHome implementation for this container is needed. |
javax.ejb.EJBMetaData |
getEJBMetaData()
This method is called whenever the metadata for this container is needed. |
Collection |
getEntityCollection(Collection ids)
This method is called whenever a collection of EJBObjects for a collection of primary keys is needed. |
Object |
getEntityEJBObject(Object id)
This method is called whenever an EJBObject implementation for an entitybean is needed. |
protected JMSProviderAdapter |
getJMSProviderAdapter()
Return the JMSProviderAdapter that should be used. |
long |
getKeepAliveMillis()
Get the keep alive millis |
int |
getMaxMessages()
Get the maximum number of messages |
int |
getMaxPoolSize()
Get the maximum pool size |
MessageDrivenMetaData |
getMetaData()
Get the message driven metadata |
int |
getMinPoolSize()
Get the minimum pool size |
Object |
getStatefulSessionEJBObject(Object id)
This method is called whenever an EJBObject implementation for a stateful session bean is needed. |
Object |
getStatelessSessionEJBObject()
This method is called whenever an EJBObject implementation for a stateless session bean is needed. |
void |
importXml(Element element)
XmlLoadable implementation. |
protected void |
innerStartDelivery()
Initialize the container invoker. |
protected void |
innerStopDelivery()
Stop done from inside, we should not stop the exceptionListener in inner stop. |
Object |
invoke(Object id,
Method m,
Object[] args,
Transaction tx,
Principal identity,
Object credential)
|
boolean |
isIdentical(Container container,
Invocation mi)
Protocol specific isIdentical implementation |
boolean |
isOptimized()
|
protected String |
parseJndiSuffix(String jndiname,
String defautSuffix)
Parse the JNDI suffix from the given JNDI name. |
protected void |
sendNotification(String event,
Object userData)
Notify of an event |
void |
setContainer(Container container)
Set the container for which this is an invoker to. |
void |
setInvokerBinding(String binding)
Set the invoker jndi binding |
void |
setInvokerMetaData(InvokerProxyBindingMetaData imd)
Set the invoker meta data so that the ProxyFactory can initialize properly |
void |
setKeepAliveMillis(long keepAlive)
Set the keep alive millis |
void |
setMaxMessages(int maxMessages)
Set the maximum number of messages |
void |
setMaxPoolSize(int maxPoolSize)
Set the maximum pool size |
void |
setMinPoolSize(int minPoolSize)
Set the minimum pool size |
void |
setOptimized(boolean optimize)
Sets the Optimized attribute of the JMSContainerInvoker object |
void |
startDelivery()
Start delivery |
protected void |
startService()
|
void |
stopDelivery()
Stop delivery |
protected void |
stopService()
|
String |
toString()
Return a string representation of the current config state. |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
---|
create, destroy, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
---|
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jboss.system.Service |
---|
create, destroy, start, stop |
Methods inherited from interface org.jboss.system.ServiceMBean |
---|
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service |
---|
create, destroy, start, stop |
Field Detail |
---|
protected static Method ON_MESSAGE
MessageListener.onMessage(javax.jms.Message)
reference.
protected static final String DEFAULT_DESTINATION_TYPE
protected boolean optimize
protected int maxMessagesNr
protected int minPoolSize
protected long keepAlive
protected int maxPoolSize
protected long reconnectInterval
protected boolean useDLQ
protected String providerAdapterJNDI
JMSProviderAdapter
protected String serverSessionPoolFactoryJNDI
ServerSessionPoolFactory
protected int acknowledgeMode
protected boolean isContainerManagedTx
protected boolean isNotSupportedTx
protected Container container
protected javax.jms.Connection connection
protected javax.jms.ConnectionConsumer connectionConsumer
protected TransactionManager tm
protected javax.jms.ServerSessionPool pool
protected org.jboss.ejb.plugins.jms.JMSContainerInvoker.ExceptionListenerImpl exListener
protected DLQHandler dlqHandler
protected Element dlqConfig
protected InvokerProxyBindingMetaData invokerMetaData
protected String invokerBinding
protected boolean deliveryActive
protected boolean createJBossMQDestination
Constructor Detail |
---|
public JMSContainerInvoker()
Method Detail |
---|
public void setInvokerMetaData(InvokerProxyBindingMetaData imd)
setInvokerMetaData
in interface EJBProxyFactory
public void setInvokerBinding(String binding)
setInvokerBinding
in interface EJBProxyFactory
public void setContainer(Container container)
setContainer
in interface ContainerPlugin
container
- The container for which this is an invoker to.public int getMinPoolSize()
JMSContainerInvokerMBean
getMinPoolSize
in interface JMSContainerInvokerMBean
public void setMinPoolSize(int minPoolSize)
JMSContainerInvokerMBean
setMinPoolSize
in interface JMSContainerInvokerMBean
minPoolSize
- the sizepublic int getMaxPoolSize()
JMSContainerInvokerMBean
getMaxPoolSize
in interface JMSContainerInvokerMBean
public void setMaxPoolSize(int maxPoolSize)
JMSContainerInvokerMBean
setMaxPoolSize
in interface JMSContainerInvokerMBean
maxPoolSize
- the sizepublic long getKeepAliveMillis()
JMSContainerInvokerMBean
getKeepAliveMillis
in interface JMSContainerInvokerMBean
public void setKeepAliveMillis(long keepAlive)
JMSContainerInvokerMBean
setKeepAliveMillis
in interface JMSContainerInvokerMBean
keepAlive
- the millisecondspublic int getMaxMessages()
JMSContainerInvokerMBean
getMaxMessages
in interface JMSContainerInvokerMBean
public void setMaxMessages(int maxMessages)
JMSContainerInvokerMBean
setMaxMessages
in interface JMSContainerInvokerMBean
maxMessages
- the number of messagespublic MessageDrivenMetaData getMetaData()
JMSContainerInvokerMBean
getMetaData
in interface JMSContainerInvokerMBean
public boolean getDeliveryActive()
JMSContainerInvokerMBean
getDeliveryActive
in interface JMSContainerInvokerMBean
public boolean getCreateJBossMQDestination()
JMSContainerInvokerMBean
getCreateJBossMQDestination
in interface JMSContainerInvokerMBean
public void startDelivery() throws Exception
JMSContainerInvokerMBean
startDelivery
in interface JMSContainerInvokerMBean
Exception
- for any errorpublic void stopDelivery() throws Exception
JMSContainerInvokerMBean
stopDelivery
in interface JMSContainerInvokerMBean
Exception
- for any errorpublic void setOptimized(boolean optimize)
optimize
- The new Optimized valuepublic boolean isIdentical(Container container, Invocation mi)
EJBProxyFactory
isIdentical
in interface EJBProxyFactory
container
- the containermi
- the invocation
public Object getEJBHome()
EJBProxyFactory
getEJBHome
in interface EJBProxyFactory
public javax.ejb.EJBMetaData getEJBMetaData()
EJBProxyFactory
getEJBMetaData
in interface EJBProxyFactory
public Collection getEntityCollection(Collection ids)
EJBProxyFactory
getEntityCollection
in interface EJBProxyFactory
ids
- Enumeration of primary keys.
public Object getEntityEJBObject(Object id)
EJBProxyFactory
getEntityEJBObject
in interface EJBProxyFactory
getEntityEJBObject
in interface GenericEntityObjectFactory
id
- The primary key of the entity.
public Object getStatefulSessionEJBObject(Object id)
EJBProxyFactory
getStatefulSessionEJBObject
in interface EJBProxyFactory
id
- The id of the session.
public Object getStatelessSessionEJBObject()
EJBProxyFactory
getStatelessSessionEJBObject
in interface EJBProxyFactory
public boolean isOptimized()
public void importXml(Element element) throws Exception
element
- Description of Parameter
org.jboss.deployment.DeploymentException
- Description of Exception
Exception
protected void createService() throws Exception
Any JMSExceptions produced while initializing will be assumed to be caused due to JMS Provider failure.
createService
in class org.jboss.system.ServiceMBeanSupport
Exception
- Failed to initalize.protected void innerStartDelivery() throws Exception
Exception
- Failed to initalize.protected void startService() throws Exception
startService
in class org.jboss.system.ServiceMBeanSupport
Exception
protected void stopService() throws Exception
stopService
in class org.jboss.system.ServiceMBeanSupport
Exception
protected void innerStopDelivery()
public Object invoke(Object id, Method m, Object[] args, Transaction tx, Principal identity, Object credential) throws Exception
Exception
protected String getDestinationType(Context ctx, String destinationJNDI)
ctx
- The naming context to lookup destinations from.destinationJNDI
- The name to use when looking up destinations.
protected JMSProviderAdapter getJMSProviderAdapter() throws NamingException
NamingException
protected javax.jms.Destination createDestination(Class type, Context ctx, String jndiName, String jndiSuffix) throws Exception
type
- Either javax.jms.Queue or javax.jms.Topic.ctx
- The naming context to lookup destinations from.jndiName
- The name to use when looking up destinations.jndiSuffix
- The name to use when creating destinations.
IllegalArgumentException
- Type is not Queue or Topic.
Exception
- Description of Exceptionprotected String getActivationConfigProperty(String property)
protected javax.jms.ServerSessionPool createSessionPool(javax.jms.Destination destination, javax.jms.Connection connection, int minSession, int maxSession, long keepAlive, boolean isTransacted, int ack, javax.jms.MessageListener listener) throws NamingException, javax.jms.JMSException
destination
- the destinationconnection
- The connection to use.minSession
- The minumum number of sessionsmaxSession
- The maximum number of sessions.keepAlive
- The time to keep sessions aliveisTransacted
- True if the sessions are transacted.ack
- The session acknowledgement mode.listener
- The message listener.
javax.jms.JMSException
NamingException
- Description of Exceptionprotected void sendNotification(String event, Object userData)
event
- the eventuserData
- any user data, e.g. the exception on a failureprotected String parseJndiSuffix(String jndiname, String defautSuffix)
jndiname
- The JNDI name used to lookup the destination.defautSuffix
- Description of Parameter
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |