Class GenericJmsProducer<T>
- java.lang.Object
-
- org.ikasan.component.endpoint.jms.producer.GenericJmsProducer<T>
-
- All Implemented Interfaces:
org.ikasan.spec.component.endpoint.Producer<T>,org.ikasan.spec.configuration.Configured<GenericJmsProducerConfiguration>,org.ikasan.spec.configuration.ConfiguredResource<GenericJmsProducerConfiguration>,org.ikasan.spec.management.ManagedIdentifierService<org.ikasan.spec.event.ManagedEventIdentifierService>,org.ikasan.spec.management.ManagedResource
public class GenericJmsProducer<T> extends java.lang.Object implements org.ikasan.spec.component.endpoint.Producer<T>, org.ikasan.spec.management.ManagedIdentifierService<org.ikasan.spec.event.ManagedEventIdentifierService>, org.ikasan.spec.management.ManagedResource, org.ikasan.spec.configuration.ConfiguredResource<GenericJmsProducerConfiguration>
Implementation of a producer based on the JMS specification.- Author:
- Ikasan Development Team
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classGenericJmsProducer.ByteArrayToMessageSpecific converter implementation for converting byte[] to Messageprotected classGenericJmsProducer.MapToMessageSpecific converter implementation for converting any Map to Messageprotected classGenericJmsProducer.SerializableToMessageSpecific converter implementation for converting any serializable object to Messageprotected classGenericJmsProducer.StringToMessageSpecific converter implementation for converting String to JMS Text Message
-
Field Summary
Fields Modifier and Type Field Description protected org.ikasan.spec.component.transformation.Converter<byte[],javax.jms.Message>byteArrayToMessageConverterprotected GenericJmsProducerConfigurationconfigurationJMS consumer configuration - default to vanilla instanceprotected java.lang.StringconfiguredResourceIdconfigured resource idprotected javax.jms.ConnectionconnectionJMS Connectionprotected javax.jms.ConnectionFactoryconnectionFactoryJMS Connection Factoryprotected javax.jms.DestinationdestinationJMS Destination instanceprotected DestinationResolverdestinationResolverdestination resolver for locating and returning the configured destination instanceprotected booleanisCriticalOnStartupdetermines whether this managed resource failure will fail the startup of the flowprotected org.ikasan.spec.event.ManagedEventIdentifierService<java.lang.String,javax.jms.Message>managedEventIdentifierServicedefault event identifier service - can be overridden via the setterprotected org.ikasan.spec.component.transformation.Converter<java.util.Map<java.lang.String,java.lang.Object>,javax.jms.Message>mapToMessageConverterprotected PostProcessorpostProcessorpost processing operations on the JMS message before being sent over the wireprotected org.ikasan.spec.component.transformation.Converter<java.io.Serializable,javax.jms.Message>serializableToMessageConverterprotected javax.jms.Sessionsessionsession has to be closed prior to connection being closedprotected org.ikasan.spec.component.transformation.Converter<java.lang.String,javax.jms.TextMessage>stringToMessageConverterIncoming object to JMS message converters.
-
Constructor Summary
Constructors Constructor Description GenericJmsProducer()Constructor.GenericJmsProducer(javax.jms.ConnectionFactory connectionFactory, javax.jms.Destination destination)Constructor.GenericJmsProducer(javax.jms.ConnectionFactory connectionFactory, DestinationResolver destinationResolver)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.jms.MessageconvertToMessage(java.lang.Object object)GenericJmsProducerConfigurationgetConfiguration()java.lang.StringgetConfiguredResourceId()protected java.lang.ObjectgetPayload(java.lang.Object message)Extract the payload based on event coming in.voidinvoke(T message)booleanisCriticalOnStartup()voidsetConfiguration(GenericJmsProducerConfiguration configuration)voidsetConfiguredResourceId(java.lang.String configuredResourceId)voidsetCriticalOnStartup(boolean isCriticalOnStartup)voidsetManagedIdentifierService(org.ikasan.spec.event.ManagedEventIdentifierService managedEventIdentifierService)Override the default producer event life identifier servicevoidsetManagedResourceRecoveryManager(org.ikasan.spec.management.ManagedResourceRecoveryManager managedResourceRecoveryManager)voidsetPostProcessor(PostProcessor postProcessor)Allow the setting of a custom message property provider.voidstartManagedResource()voidstopManagedResource()
-
-
-
Field Detail
-
connectionFactory
protected javax.jms.ConnectionFactory connectionFactory
JMS Connection Factory
-
destination
protected javax.jms.Destination destination
JMS Destination instance
-
connection
protected javax.jms.Connection connection
JMS Connection
-
configuredResourceId
protected java.lang.String configuredResourceId
configured resource id
-
configuration
protected GenericJmsProducerConfiguration configuration
JMS consumer configuration - default to vanilla instance
-
managedEventIdentifierService
protected org.ikasan.spec.event.ManagedEventIdentifierService<java.lang.String,javax.jms.Message> managedEventIdentifierService
default event identifier service - can be overridden via the setter
-
session
protected javax.jms.Session session
session has to be closed prior to connection being closed
-
isCriticalOnStartup
protected boolean isCriticalOnStartup
determines whether this managed resource failure will fail the startup of the flow
-
destinationResolver
protected DestinationResolver destinationResolver
destination resolver for locating and returning the configured destination instance
-
postProcessor
protected PostProcessor postProcessor
post processing operations on the JMS message before being sent over the wire
-
stringToMessageConverter
protected org.ikasan.spec.component.transformation.Converter<java.lang.String,javax.jms.TextMessage> stringToMessageConverter
Incoming object to JMS message converters.
-
mapToMessageConverter
protected org.ikasan.spec.component.transformation.Converter<java.util.Map<java.lang.String,java.lang.Object>,javax.jms.Message> mapToMessageConverter
-
byteArrayToMessageConverter
protected org.ikasan.spec.component.transformation.Converter<byte[],javax.jms.Message> byteArrayToMessageConverter
-
serializableToMessageConverter
protected org.ikasan.spec.component.transformation.Converter<java.io.Serializable,javax.jms.Message> serializableToMessageConverter
-
-
Constructor Detail
-
GenericJmsProducer
public GenericJmsProducer()
Constructor.
-
GenericJmsProducer
public GenericJmsProducer(javax.jms.ConnectionFactory connectionFactory, javax.jms.Destination destination)Constructor.- Parameters:
connectionFactory-destination-
-
GenericJmsProducer
public GenericJmsProducer(javax.jms.ConnectionFactory connectionFactory, DestinationResolver destinationResolver)Constructor.- Parameters:
connectionFactory-destinationResolver-
-
-
Method Detail
-
convertToMessage
protected javax.jms.Message convertToMessage(java.lang.Object object)
-
invoke
public void invoke(T message) throws org.ikasan.spec.component.endpoint.EndpointException
- Specified by:
invokein interfaceorg.ikasan.spec.component.endpoint.Producer<T>- Throws:
org.ikasan.spec.component.endpoint.EndpointException
-
setPostProcessor
public void setPostProcessor(PostProcessor postProcessor)
Allow the setting of a custom message property provider.- Parameters:
postProcessor-
-
setManagedIdentifierService
public void setManagedIdentifierService(org.ikasan.spec.event.ManagedEventIdentifierService managedEventIdentifierService)
Override the default producer event life identifier service- Specified by:
setManagedIdentifierServicein interfaceorg.ikasan.spec.management.ManagedIdentifierService<T>- Parameters:
managedEventIdentifierService-
-
getConfiguration
public GenericJmsProducerConfiguration getConfiguration()
- Specified by:
getConfigurationin interfaceorg.ikasan.spec.configuration.Configured<T>
-
getConfiguredResourceId
public java.lang.String getConfiguredResourceId()
- Specified by:
getConfiguredResourceIdin interfaceorg.ikasan.spec.configuration.ConfiguredResource<T>
-
setConfiguration
public void setConfiguration(GenericJmsProducerConfiguration configuration)
- Specified by:
setConfigurationin interfaceorg.ikasan.spec.configuration.Configured<T>
-
setConfiguredResourceId
public void setConfiguredResourceId(java.lang.String configuredResourceId)
- Specified by:
setConfiguredResourceIdin interfaceorg.ikasan.spec.configuration.ConfiguredResource<T>
-
startManagedResource
public void startManagedResource()
- Specified by:
startManagedResourcein interfaceorg.ikasan.spec.management.ManagedResource
-
stopManagedResource
public void stopManagedResource()
- Specified by:
stopManagedResourcein interfaceorg.ikasan.spec.management.ManagedResource
-
isCriticalOnStartup
public boolean isCriticalOnStartup()
- Specified by:
isCriticalOnStartupin interfaceorg.ikasan.spec.management.ManagedResource
-
setCriticalOnStartup
public void setCriticalOnStartup(boolean isCriticalOnStartup)
- Specified by:
setCriticalOnStartupin interfaceorg.ikasan.spec.management.ManagedResource
-
setManagedResourceRecoveryManager
public void setManagedResourceRecoveryManager(org.ikasan.spec.management.ManagedResourceRecoveryManager managedResourceRecoveryManager)
- Specified by:
setManagedResourceRecoveryManagerin interfaceorg.ikasan.spec.management.ManagedResource
-
getPayload
protected java.lang.Object getPayload(java.lang.Object message)
Extract the payload based on event coming in.- Parameters:
message-- Returns:
-
-