Class JMSJobFactoryProvider
- java.lang.Object
-
- com.levigo.jadice.server.jms.client.JMSJobFactoryProvider
-
public class JMSJobFactoryProvider extends Object
After restarting the connected jadice server instance the current instance ofJMSJobFactory
cannot be used anymore. This class is thread-safe. In order to create jobs with this factory provider the following approach is recommended:final ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory( "tcp://localhost:61616"); final JMSJobFactoryProvider jmsJobFactoryProvider = new JMSJobFactoryProvider(activeMQConnectionFactory, JMSJobFactory.DEFAULT_QUEUE_NAME); final JMSJobFactory jmsJobFactory = jmsJobFactoryProvider.get(); try (Job job = jmsJobFactory.createJob()) { // CUSTOM: job configuration, submitting the job as well as providing stream inputs. } catch (ConnectionException ce) { // TODO decide how to cope with connection issues here LOGGER.error("Converter unavailable: " + ce.getMessage(), ce); } catch (JobException | IOException e) { LOGGER.error("Job conversion failed due to: " + e.getMessage(), e); }
-
-
Constructor Summary
Constructors Constructor Description JMSJobFactoryProvider(javax.jms.QueueConnectionFactory queueConnectionFactory)
Creates a new instance of the JMSJobFactoryProvider with the default request queue name.JMSJobFactoryProvider(javax.jms.QueueConnectionFactory queueConnectionFactory, String requestQueueName)
Creates a new instance of the JMSJobFactoryProvider with the default request queue name.
-
-
-
Constructor Detail
-
JMSJobFactoryProvider
public JMSJobFactoryProvider(javax.jms.QueueConnectionFactory queueConnectionFactory)
Creates a new instance of the JMSJobFactoryProvider with the default request queue name.- Parameters:
queueConnectionFactory
- the current queue connection factory.
-
JMSJobFactoryProvider
public JMSJobFactoryProvider(javax.jms.QueueConnectionFactory queueConnectionFactory, String requestQueueName)
Creates a new instance of the JMSJobFactoryProvider with the default request queue name.- Parameters:
queueConnectionFactory
- the current queue connection factory.
-
-
Method Detail
-
get
public final JMSJobFactory get()
Provides a healthy JMSJobFactory instance.- Returns:
- a healthy JMSJobFactory instance.
-
-