public class JMSJobFactory extends Object implements JobFactory
JobFactory
implementation using the Java Messaging Service API.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PRIORITY |
static String |
DEFAULT_QUEUE_NAME
The default name of the JMS request queue.
|
static long |
DEFAULT_TIMEOUT |
static String |
PROPERTY_KEY_COMMUNICATION_TIMEOUT
Property key for the communication timeout.
|
static String |
PROPERTY_KEY_PRIORITY
Property key for the priority.
|
static String |
PROPERTY_KEY_SUBMISSION_TIMEOUT
Property key for the submission timeout.
|
PROPERTY_KEY_EXECUTION_TIMEOUT
Constructor and Description |
---|
JMSJobFactory(javax.jms.QueueConnectionFactory connectionFactory,
String queueName)
Create a new
JMSJobFactory with the given JMS QueueConnectionFactory and the
given request queue name. |
Modifier and Type | Method and Description |
---|---|
void |
adopt(com.levigo.jadice.server.client.internal.DefaultJobInternalImpl job) |
Job |
createJob()
Create a job for the specified
QueueConnectionFactory and the
given default values (see the "see also" section). |
long |
getCommunicationTimeout() |
int |
getDefaultPriority() |
long |
getSubmissionTimeout() |
void |
setCommunicationTimeout(long communicationTimeout)
Set the default communication timeout.
|
void |
setDefaultPriority(int defaultPriority)
Set the default priority for jobs.
|
void |
setSubmissionTimeout(long submissionTimeout)
Set the default job submission timeout (ms).
|
public static final long DEFAULT_TIMEOUT
public static final int DEFAULT_PRIORITY
public static final String DEFAULT_QUEUE_NAME
public static final String PROPERTY_KEY_SUBMISSION_TIMEOUT
If a job has not been accepted by a server by the specified timeout,
submission will fail. If the timeout is 0, the default timeout (as defined
by the JobFactory
) is used, if the timeout is < 0, it will wait
indefinitely for acceptance.
public static final String PROPERTY_KEY_COMMUNICATION_TIMEOUT
If there has been no JMS communication activity on a channel for the time specified by the timeout, the communication is supposed to be dead. This applies to both sides of the communication. If the timeout is <= 0, the default timeout is used.
NB: The minimum timeout accepted by the server is 1000ms.
public static final String PROPERTY_KEY_PRIORITY
public JMSJobFactory(javax.jms.QueueConnectionFactory connectionFactory, String queueName)
JMSJobFactory
with the given JMS QueueConnectionFactory
and the
given request queue name.connectionFactory
- the JMS connection factory to use. Must not be null.queueName
- the name of the request queue, default is "JS.REQUEST". Must
not be null.DEFAULT_QUEUE_NAME
public Job createJob()
QueueConnectionFactory
and the
given default values (see the "see also" section).createJob
in interface JobFactory
getDefaultPriority()
,
PROPERTY_KEY_COMMUNICATION_TIMEOUT
public void adopt(com.levigo.jadice.server.client.internal.DefaultJobInternalImpl job)
adopt
in interface JobFactory
public int getDefaultPriority()
public void setDefaultPriority(int defaultPriority)
Job.putProperty(String, java.io.Serializable)
with the key
PROPERTY_KEY_PRIORITY
and an integer value for the priority.defaultPriority
- MessageProducer.setPriority(int)
,
PROPERTY_KEY_PRIORITY
,
DEFAULT_PRIORITY
public long getSubmissionTimeout()
public void setSubmissionTimeout(long submissionTimeout)
Job.putProperty(String, java.io.Serializable)
with the key
PROPERTY_KEY_SUBMISSION_TIMEOUT
and an integer value for the
timeout.submissionTimeout
- DEFAULT_TIMEOUT
,
PROPERTY_KEY_SUBMISSION_TIMEOUT
public long getCommunicationTimeout()
public void setCommunicationTimeout(long communicationTimeout)
If there has been no JMS communication activity on a channel for the time specified by the timeout, the communication is supposed to be dead. This applies to both sides of the communication.
communicationTimeout
- DEFAULT_TIMEOUT
,
PROPERTY_KEY_COMMUNICATION_TIMEOUT
Copyright © 2016 levigo holding gmbh. All rights reserved.