org.hornetq.api.core.client
Class HornetQClient

java.lang.Object
  extended by org.hornetq.api.core.client.HornetQClient

public class HornetQClient
extends Object

Utility class for creating HornetQ ClientSessionFactory objects. Once a ClientSessionFactory has been created, it can be further configured using its setter methods before creating the sessions. Once a session is created, the factory can no longer be modified (its setter methods will throw a IllegalStateException.

Author:
Andy Taylor

Field Summary
static int DEFAULT_ACK_BATCH_SIZE
           
static boolean DEFAULT_AUTO_GROUP
           
static boolean DEFAULT_BLOCK_ON_ACKNOWLEDGE
           
static boolean DEFAULT_BLOCK_ON_DURABLE_SEND
           
static boolean DEFAULT_BLOCK_ON_NON_DURABLE_SEND
           
static boolean DEFAULT_CACHE_LARGE_MESSAGE_CLIENT
           
static long DEFAULT_CALL_TIMEOUT
           
static long DEFAULT_CLIENT_FAILURE_CHECK_PERIOD
           
static int DEFAULT_CONFIRMATION_WINDOW_SIZE
           
static String DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME
           
static long DEFAULT_CONNECTION_TTL
           
static int DEFAULT_CONSUMER_MAX_RATE
           
static int DEFAULT_CONSUMER_WINDOW_SIZE
           
static long DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT
           
static long DEFAULT_DISCOVERY_REFRESH_TIMEOUT
           
static boolean DEFAULT_FAILOVER_ON_INITIAL_CONNECTION
           
static boolean DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN
           
static int DEFAULT_INITIAL_MESSAGE_PACKET_SIZE
           
static long DEFAULT_MAX_RETRY_INTERVAL
           
static int DEFAULT_MIN_LARGE_MESSAGE_SIZE
           
static boolean DEFAULT_PRE_ACKNOWLEDGE
           
static int DEFAULT_PRODUCER_MAX_RATE
           
static int DEFAULT_PRODUCER_WINDOW_SIZE
           
static int DEFAULT_RECONNECT_ATTEMPTS
           
static long DEFAULT_RETRY_INTERVAL
           
static double DEFAULT_RETRY_INTERVAL_MULTIPLIER
           
static int DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE
           
static int DEFAULT_THREAD_POOL_MAX_SIZE
           
static boolean DEFAULT_USE_GLOBAL_POOLS
           
 
Method Summary
static ClientSessionFactory createClientSessionFactory()
          Creates a ClientSessionFactory using all the defaults.
static ClientSessionFactory createClientSessionFactory(ClientSessionFactory other)
          Creates a new ClientSessionFactory using the same configuration as the one passed in.
static ClientSessionFactory createClientSessionFactory(List<Pair<TransportConfiguration,TransportConfiguration>> staticConnectors)
          Creates a ClientSessionFactory using a List of TransportConfigurations and backups.
static ClientSessionFactory createClientSessionFactory(String discoveryAddress, int discoveryPort)
          Creates a ClientSessionFactory that uses discovery to connect to the servers.
static ClientSessionFactory createClientSessionFactory(TransportConfiguration connectorConfig)
          Creates a ClientSessionFactory using the TransportConfiguration of the server to connect to.
static ClientSessionFactory createClientSessionFactory(TransportConfiguration connectorConfig, TransportConfiguration backupConnectorConfig)
          Creates a ClientConnectionFactory using a TransportConfiguration of the server and a backup if needed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME

public static final String DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME

DEFAULT_CLIENT_FAILURE_CHECK_PERIOD

public static final long DEFAULT_CLIENT_FAILURE_CHECK_PERIOD
See Also:
Constant Field Values

DEFAULT_CONNECTION_TTL

public static final long DEFAULT_CONNECTION_TTL
See Also:
Constant Field Values

DEFAULT_MIN_LARGE_MESSAGE_SIZE

public static final int DEFAULT_MIN_LARGE_MESSAGE_SIZE
See Also:
Constant Field Values

DEFAULT_CONSUMER_WINDOW_SIZE

public static final int DEFAULT_CONSUMER_WINDOW_SIZE
See Also:
Constant Field Values

DEFAULT_CONSUMER_MAX_RATE

public static final int DEFAULT_CONSUMER_MAX_RATE
See Also:
Constant Field Values

DEFAULT_CONFIRMATION_WINDOW_SIZE

public static final int DEFAULT_CONFIRMATION_WINDOW_SIZE
See Also:
Constant Field Values

DEFAULT_PRODUCER_WINDOW_SIZE

public static final int DEFAULT_PRODUCER_WINDOW_SIZE
See Also:
Constant Field Values

DEFAULT_PRODUCER_MAX_RATE

public static final int DEFAULT_PRODUCER_MAX_RATE
See Also:
Constant Field Values

DEFAULT_BLOCK_ON_ACKNOWLEDGE

public static final boolean DEFAULT_BLOCK_ON_ACKNOWLEDGE
See Also:
Constant Field Values

DEFAULT_BLOCK_ON_DURABLE_SEND

public static final boolean DEFAULT_BLOCK_ON_DURABLE_SEND
See Also:
Constant Field Values

DEFAULT_BLOCK_ON_NON_DURABLE_SEND

public static final boolean DEFAULT_BLOCK_ON_NON_DURABLE_SEND
See Also:
Constant Field Values

DEFAULT_AUTO_GROUP

public static final boolean DEFAULT_AUTO_GROUP
See Also:
Constant Field Values

DEFAULT_CALL_TIMEOUT

public static final long DEFAULT_CALL_TIMEOUT
See Also:
Constant Field Values

DEFAULT_ACK_BATCH_SIZE

public static final int DEFAULT_ACK_BATCH_SIZE
See Also:
Constant Field Values

DEFAULT_PRE_ACKNOWLEDGE

public static final boolean DEFAULT_PRE_ACKNOWLEDGE
See Also:
Constant Field Values

DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT

public static final long DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT
See Also:
Constant Field Values

DEFAULT_DISCOVERY_REFRESH_TIMEOUT

public static final long DEFAULT_DISCOVERY_REFRESH_TIMEOUT
See Also:
Constant Field Values

DEFAULT_RETRY_INTERVAL

public static final long DEFAULT_RETRY_INTERVAL
See Also:
Constant Field Values

DEFAULT_RETRY_INTERVAL_MULTIPLIER

public static final double DEFAULT_RETRY_INTERVAL_MULTIPLIER
See Also:
Constant Field Values

DEFAULT_MAX_RETRY_INTERVAL

public static final long DEFAULT_MAX_RETRY_INTERVAL
See Also:
Constant Field Values

DEFAULT_RECONNECT_ATTEMPTS

public static final int DEFAULT_RECONNECT_ATTEMPTS
See Also:
Constant Field Values

DEFAULT_FAILOVER_ON_INITIAL_CONNECTION

public static final boolean DEFAULT_FAILOVER_ON_INITIAL_CONNECTION
See Also:
Constant Field Values

DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN

public static final boolean DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN
See Also:
Constant Field Values

DEFAULT_USE_GLOBAL_POOLS

public static final boolean DEFAULT_USE_GLOBAL_POOLS
See Also:
Constant Field Values

DEFAULT_THREAD_POOL_MAX_SIZE

public static final int DEFAULT_THREAD_POOL_MAX_SIZE
See Also:
Constant Field Values

DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE

public static final int DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE
See Also:
Constant Field Values

DEFAULT_CACHE_LARGE_MESSAGE_CLIENT

public static final boolean DEFAULT_CACHE_LARGE_MESSAGE_CLIENT
See Also:
Constant Field Values

DEFAULT_INITIAL_MESSAGE_PACKET_SIZE

public static final int DEFAULT_INITIAL_MESSAGE_PACKET_SIZE
See Also:
Constant Field Values
Method Detail

createClientSessionFactory

public static ClientSessionFactory createClientSessionFactory()
Creates a ClientSessionFactory using all the defaults.

Returns:
the ClientSessionFactory.

createClientSessionFactory

public static ClientSessionFactory createClientSessionFactory(ClientSessionFactory other)
Creates a new ClientSessionFactory using the same configuration as the one passed in.

Parameters:
other - The ClientSessionFactory to copy
Returns:
The new ClientSessionFactory

createClientSessionFactory

public static ClientSessionFactory createClientSessionFactory(String discoveryAddress,
                                                              int discoveryPort)
Creates a ClientSessionFactory that uses discovery to connect to the servers.

Parameters:
discoveryAddress - The address to use for discovery
discoveryPort - The port to use for discovery.
Returns:
The ClientSessionFactory.

createClientSessionFactory

public static ClientSessionFactory createClientSessionFactory(List<Pair<TransportConfiguration,TransportConfiguration>> staticConnectors)
Creates a ClientSessionFactory using a List of TransportConfigurations and backups.

Parameters:
staticConnectors - The list of TransportConfiguration's to use.
Returns:
The ClientSessionFactory.

createClientSessionFactory

public static ClientSessionFactory createClientSessionFactory(TransportConfiguration connectorConfig,
                                                              TransportConfiguration backupConnectorConfig)
Creates a ClientConnectionFactory using a TransportConfiguration of the server and a backup if needed.

Parameters:
connectorConfig - The TransportConfiguration of the server to connect to.
backupConnectorConfig - The TransportConfiguration of the backup server to connect to (or null if there is no backup)
Returns:
The ClientSessionFactory.

createClientSessionFactory

public static ClientSessionFactory createClientSessionFactory(TransportConfiguration connectorConfig)
Creates a ClientSessionFactory using the TransportConfiguration of the server to connect to.

Parameters:
connectorConfig - The TransportConfiguration of the server.
Returns:
The ClientSessionFactory.


Copyright © 2009 Red Hat Inc. All Rights Reserved.