Package org.objectweb.joram.client.jms
Class FactoryParameters
- java.lang.Object
-
- org.objectweb.joram.client.jms.FactoryParameters
-
- All Implemented Interfaces:
Serializable,Cloneable
public class FactoryParameters extends Object implements Serializable, Cloneable
AFactoryParametersinstance holds a<XA>ConnectionFactoryconfiguration parameters, it allows to configure the related ConnectionFactory.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description booleanasyncSendDetermines whether the persistent produced messages are asynchronously sent (without acknowledge) or not.StringclientIDThe clientID used by connectionintcnxPendingTimerPeriod in milliseconds between two ping requests sent by the client connection to the server; if the server does not receive any ping request during approximatively more than 3* cnxPendingTimer, the connection is considered as dead and processed as required.intcompressedMinSizeThis attribute defines the minimum size beyond which the message body is compressed.intcompressionLevelThis attribute defines the compression level (0-9) used when the message body is compressed.intconnectingTimerDuration in seconds during which connecting is attempted (connecting might take time if the server is temporarily not reachable).private StringhostName of host hosting the server to create connections with.booleanimplicitAckDetermines whether the messages consumed are implicitly acknowledged or not.List<MessageInterceptor>inInterceptorsList of Message interceptors while receiving a message.private static StringINTERCEPTOR_CLASS_NAME_SEPARATORprivate static org.objectweb.util.monolog.api.LoggerloggerStringmessageIdPrefixThis attribute allows to customize the JMS MessageID adding the specified string.booleanmultiThreadSyncDetermines whether client threads which are using the same connection are synchronized in order to group together the requests they send.intmultiThreadSyncDelayThe maximum time the threads hang if 'multiThreadSync' is true.intmultiThreadSyncThresholdThe maximum numbers of threads that hang if 'multiThreadSync' is true.booleannoAckedQueueSet this attribute to true to increase performance.List<MessageInterceptor>outInterceptorsList of Message interceptors while sending a message.StringoutLocalAddressThis is the local IP address on which the TCP connection is activated.intoutLocalPortThis is the local IP address port on which the TCP connection is activatedprivate intportPort to be used for accessing the server.intqueueMessageReadMaxThe maximum number of messages that can be read at once from a queue.private static longserialVersionUIDdefine serialVersionUID for interoperabilityStringsocketFactoryAllows to define a specific factory for socket in order to by-pass compatibility problem between JDK version.intSoLingerEnable SO_LINGER with the specified linger time in seconds, if the value is less than 0 then it disables SO_LINGER.intSoTimeoutEnable/disable SO_TIMEOUT with the specified timeout in milliseconds.booleanTcpNoDelayEnable/disable TCP_NODELAY (disable/enable Nagle's algorithm), default value is true.inttopicAckBufferMaxThe maximum number of acknowledgements that can be buffered in Session.DUPS_OK_ACKNOWLEDGE mode when listening to a topic.inttopicActivationThresholdThis threshold is the minimum messages number below which the subscription is activated.inttopicPassivationThresholdThis threshold is the maximum messages number over which the subscription is passivated.inttxPendingTimerDuration in seconds during which a JMS transacted (non XA) session might be pending; above that duration the session is rolled back and closed; the 0 value means "no timer".private Stringurlurl needed to connect to joram HA
-
Constructor Summary
Constructors Constructor Description FactoryParameters()Constructs an emptyFactoryParameters.FactoryParameters(String url)Constructs aFactoryParametersinstance.FactoryParameters(String host, int port)Constructs aFactoryParametersinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInInterceptor(String pInterceptorClassName)private voidaddInterceptor(String pInterceptorClassName, List<MessageInterceptor> pInterceptors)voidaddOutInterceptor(String pInterceptorClassName)Objectclone()Hashtable<String,Object>code(Hashtable<String,Object> h, String prefix)voiddecode(Hashtable<String,Object> h, String prefix)voidfromReference(Reference ref, String prefix)StringgetHost()Returns the name of host hosting the server to create connections with.private StringgetListInInterceptorClassName()private StringgetListInterceptorClassName(List<MessageInterceptor> pInterceptors)private StringgetListOutInterceptorClassName()StringgetMessageIdPrefix()Gets the prefix to add to the JMS MessageID of connection created from this factory.intgetPort()Returns the port to be used for accessing the server.StringgetUrl()Returns the url to be used for accessing the server.booleanremoveInInterceptor(String pInterceptorClassName)booleanremoveInterceptor(String pInterceptorClassName, List<MessageInterceptor> pInterceptors)booleanremoveOutInterceptor(String pInterceptorClassName)private voidsetListInInterceptorClassName(String pListInterceptorClassName)private voidsetListInterceptorClassName(String pListInterceptorClassName, List<MessageInterceptor> pInterceptors)private voidsetListOutInterceptorClassName(String pListInterceptorClassName)voidsetMessageIdPrefix(String messageIdPrefix)Setsthe prefix to add to the JMS MessageID of connection created from this factory.voidsetParameters(Properties properties)voidtoReference(Reference ref, String prefix)StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
define serialVersionUID for interoperability- See Also:
- Constant Field Values
-
logger
private static org.objectweb.util.monolog.api.Logger logger
-
host
private String host
Name of host hosting the server to create connections with.
-
port
private int port
Port to be used for accessing the server.
-
url
private String url
url needed to connect to joram HA
-
clientID
public String clientID
The clientID used by connection
-
TcpNoDelay
public boolean TcpNoDelay
Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm), default value is true.
-
SoLinger
public int SoLinger
Enable SO_LINGER with the specified linger time in seconds, if the value is less than 0 then it disables SO_LINGER. Default value is -1.
-
SoTimeout
public int SoTimeout
Enable/disable SO_TIMEOUT with the specified timeout in milliseconds. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout. Default value is 0.
-
connectingTimer
public int connectingTimer
Duration in seconds during which connecting is attempted (connecting might take time if the server is temporarily not reachable). A value of zero is interpreted as an infinite timeout. The connection will then block until established or a TCP error occurs.The default value is 30.
-
txPendingTimer
public int txPendingTimer
Duration in seconds during which a JMS transacted (non XA) session might be pending; above that duration the session is rolled back and closed; the 0 value means "no timer".The default value is 0 (no timer).
-
cnxPendingTimer
public int cnxPendingTimer
Period in milliseconds between two ping requests sent by the client connection to the server; if the server does not receive any ping request during approximatively more than 3* cnxPendingTimer, the connection is considered as dead and processed as required.
-
socketFactory
public String socketFactory
Allows to define a specific factory for socket in order to by-pass compatibility problem between JDK version. Currently there is two factories, The default factory one for JDK since 1.4, and SocketFactory13 for JDK prior to 1.4.
-
implicitAck
public boolean implicitAck
Determines whether the messages consumed are implicitly acknowledged or not. When true messages are immediately removed from queue when delivered.
-
asyncSend
public boolean asyncSend
Determines whether the persistent produced messages are asynchronously sent (without acknowledge) or not.Messages sent asynchronously may be lost if a failure occurs before the message is persisted on the server.
Non persistent messages are always sent without acknowledgment.
Default is false, persistent messages are sent with acknowledge.
-
queueMessageReadMax
public int queueMessageReadMax
The maximum number of messages that can be read at once from a queue.Default is 1.
-
topicAckBufferMax
public int topicAckBufferMax
The maximum number of acknowledgements that can be buffered in Session.DUPS_OK_ACKNOWLEDGE mode when listening to a topic.Default value is 10.
-
multiThreadSync
public boolean multiThreadSync
Determines whether client threads which are using the same connection are synchronized in order to group together the requests they send.
-
multiThreadSyncDelay
public int multiThreadSyncDelay
The maximum time the threads hang if 'multiThreadSync' is true.Either they wake up (wait time out) or they are notified (by the first waken up thread).
Default value is 1ms.
-
multiThreadSyncThreshold
public int multiThreadSyncThreshold
The maximum numbers of threads that hang if 'multiThreadSync' is true.Default value is 10 waiting threads.
-
topicPassivationThreshold
public int topicPassivationThreshold
This threshold is the maximum messages number over which the subscription is passivated.Default is Integer.MAX_VALUE.
-
topicActivationThreshold
public int topicActivationThreshold
This threshold is the minimum messages number below which the subscription is activated.Default value is 0.
-
outLocalAddress
public String outLocalAddress
This is the local IP address on which the TCP connection is activated.The value can either be a machine name, such as "java.sun.com", or a textual representation of its IP address.
-
outLocalPort
public int outLocalPort
This is the local IP address port on which the TCP connection is activated
-
inInterceptors
public final List<MessageInterceptor> inInterceptors
List of Message interceptors while receiving a message.
These interceptors are called whenSession#receive()is called.
The execution follows the order of the elements within the list.
This property is facultative. If set, then theMessageInterceptorhandlecallback method of the IN interceptors} are called.
-
outInterceptors
public final List<MessageInterceptor> outInterceptors
List of Message interceptors while sending a message.
These interceptors are called whenSession#send()is called.
The execution follows the order of the elements within the list.
This property is facultative. If set, then theMessageInterceptorhandlecallback method of the OUT interceptors} are called.
-
compressedMinSize
public int compressedMinSize
This attribute defines the minimum size beyond which the message body is compressed. The default value is 0 (no compression).
-
compressionLevel
public int compressionLevel
This attribute defines the compression level (0-9) used when the message body is compressed. The default value is 1 (Deflater.BEST_SPEED).
-
noAckedQueue
public boolean noAckedQueue
Set this attribute to true to increase performance. The default value is false (use the AckedQueue)
-
messageIdPrefix
public String messageIdPrefix
This attribute allows to customize the JMS MessageID adding the specified string. This value is overloaded by the property org.objectweb.joram.client.jms.messageid.prefix if it defined. By default empty.
-
INTERCEPTOR_CLASS_NAME_SEPARATOR
private static final String INTERCEPTOR_CLASS_NAME_SEPARATOR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FactoryParameters
public FactoryParameters(String host, int port)
Constructs aFactoryParametersinstance.- Parameters:
host- Name of host hosting the server to create connections with.port- Port to be used for accessing the server.
-
FactoryParameters
public FactoryParameters(String url)
Constructs aFactoryParametersinstance.- Parameters:
url- joram ha url
-
FactoryParameters
public FactoryParameters()
Constructs an emptyFactoryParameters.
-
-
Method Detail
-
getHost
public String getHost()
Returns the name of host hosting the server to create connections with.- Returns:
- The name of host hosting the server.
-
getPort
public int getPort()
Returns the port to be used for accessing the server.- Returns:
- The port to be used for accessing the server.
-
getUrl
public String getUrl()
Returns the url to be used for accessing the server.- Returns:
- The url to be used for accessing the server.
-
getMessageIdPrefix
public String getMessageIdPrefix()
Gets the prefix to add to the JMS MessageID of connection created from this factory.- Returns:
- the prefix to add to the JMS MessageID.
-
setMessageIdPrefix
public void setMessageIdPrefix(String messageIdPrefix)
Setsthe prefix to add to the JMS MessageID of connection created from this factory.- Parameters:
messageIdPrefix- the prefix to add to the JMS MessageID.
-
addInInterceptor
public void addInInterceptor(String pInterceptorClassName)
-
addOutInterceptor
public void addOutInterceptor(String pInterceptorClassName)
-
addInterceptor
private void addInterceptor(String pInterceptorClassName, List<MessageInterceptor> pInterceptors)
-
removeInInterceptor
public boolean removeInInterceptor(String pInterceptorClassName)
-
removeOutInterceptor
public boolean removeOutInterceptor(String pInterceptorClassName)
-
removeInterceptor
public boolean removeInterceptor(String pInterceptorClassName, List<MessageInterceptor> pInterceptors)
-
getListInInterceptorClassName
private String getListInInterceptorClassName()
-
getListOutInterceptorClassName
private String getListOutInterceptorClassName()
-
getListInterceptorClassName
private String getListInterceptorClassName(List<MessageInterceptor> pInterceptors)
-
setListInInterceptorClassName
private void setListInInterceptorClassName(String pListInterceptorClassName)
-
setListOutInterceptorClassName
private void setListOutInterceptorClassName(String pListInterceptorClassName)
-
setListInterceptorClassName
private void setListInterceptorClassName(String pListInterceptorClassName, List<MessageInterceptor> pInterceptors)
-
setParameters
public void setParameters(Properties properties)
-
-