Package org.apache.openjpa.event
Class JMSRemoteCommitProvider
java.lang.Object
org.apache.openjpa.event.AbstractRemoteCommitProvider
org.apache.openjpa.event.JMSRemoteCommitProvider
- All Implemented Interfaces:
- jakarta.jms.ExceptionListener,- RemoteCommitProvider,- Configurable,- GenericConfigurable,- Closeable
public class JMSRemoteCommitProvider
extends AbstractRemoteCommitProvider
implements Configurable, GenericConfigurable, jakarta.jms.ExceptionListener
JMS-based implementation of 
RemoteCommitProvider that
 listens for object modifications and propagates those changes to
 other RemoteCommitProviders over a JMS topic.- Since:
- 0.2.5.0
- Author:
- Patrick Linskey
- 
Field SummaryFields inherited from class org.apache.openjpa.event.AbstractRemoteCommitProvidereventManager, log
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidbroadcast(RemoteCommitEvent event) Notifies other remote event managers in this JVM and on other machines of changes to the cache.voidclose()Free the resources used by this provider.protected voidconnect()protected jakarta.jms.MessagecreateMessage(RemoteCommitEvent event) Returns a newMessageto send to the topic.voidSubclasses that need to perform actions inConfigurable.endConfiguration()must invoke this method.protected jakarta.jms.MessageListenerprotected ContextReturns a newContextobject for use by this provider.voidonException(jakarta.jms.JMSException ex) voidsetExceptionReconnectAttempts(int attempts) The number of times to attempt to reconnect after a JMS send exception is detected.voidSet a map of properties to pass to theInitialContextconstructor for JNDI lookups.voidSets the JMS Topic name.voidSets the JMS TopicConnectionFactory name.Methods inherited from class org.apache.openjpa.event.AbstractRemoteCommitProviderfireEvent, setConfiguration, setRemoteCommitEventManager, startConfigurationMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.openjpa.lib.conf.ConfigurablesetConfiguration, startConfiguration
- 
Constructor Details- 
JMSRemoteCommitProviderpublic JMSRemoteCommitProvider()
 
- 
- 
Method Details- 
setTopicSets the JMS Topic name. Defaults totopic/OpenJPACommitProviderTopic.
- 
setTopicConnectionFactorySets the JMS TopicConnectionFactory name. Defaults tojava:/ConnectionFactory.
- 
setExceptionReconnectAttemptspublic void setExceptionReconnectAttempts(int attempts) The number of times to attempt to reconnect after a JMS send exception is detected. Defaults to 0, meaning no attempt to reconnect is made; the exception is logged and ignored.
- 
setIntoSet a map of properties to pass to theInitialContextconstructor for JNDI lookups. Implementation ofGenericConfigurable.- Specified by:
- setIntoin interface- GenericConfigurable
 
- 
newContextReturns a newContextobject for use by this provider.- Throws:
- NamingException
 
- 
broadcastDescription copied from interface:RemoteCommitProviderNotifies other remote event managers in this JVM and on other machines of changes to the cache. This method must not notify the event manager associated with the broker that originated this commit.- Specified by:
- broadcastin interface- RemoteCommitProvider
 
- 
closepublic void close()Description copied from interface:RemoteCommitProviderFree the resources used by this provider.- Specified by:
- closein interface- Closeable
- Specified by:
- closein interface- RemoteCommitProvider
 
- 
endConfigurationpublic void endConfiguration()Subclasses that need to perform actions inConfigurable.endConfiguration()must invoke this method.- Specified by:
- endConfigurationin interface- Configurable
- Overrides:
- endConfigurationin class- AbstractRemoteCommitProvider
 
- 
connectprotected void connect()
- 
getMessageListenerprotected jakarta.jms.MessageListener getMessageListener()
- 
createMessageprotected jakarta.jms.Message createMessage(RemoteCommitEvent event) throws jakarta.jms.JMSException Returns a newMessageto send to the topic. This implementation creates anObjectMessage.- Throws:
- jakarta.jms.JMSException
 
- 
onExceptionpublic void onException(jakarta.jms.JMSException ex) - Specified by:
- onExceptionin interface- jakarta.jms.ExceptionListener
 
 
-