Class ServerLocatorImpl
- java.lang.Object
-
- org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl
-
- All Implemented Interfaces:
AutoCloseable,ServerLocator,ServerLocatorInternal,DiscoveryListener
public final class ServerLocatorImpl extends Object implements ServerLocatorInternal, DiscoveryListener
This is the implementation ofServerLocatorand all the proper javadoc is located on that interface.
-
-
Constructor Summary
Constructors Constructor Description ServerLocatorImpl(boolean useHA, DiscoveryGroupConfiguration groupConfiguration)Create a ServerLocatorImpl using UDP discovery to lookup clusterServerLocatorImpl(boolean useHA, TransportConfiguration... transportConfigs)Create a ServerLocatorImpl using a static list of live serversServerLocatorImpl(Topology topology, boolean useHA, DiscoveryGroupConfiguration groupConfiguration)Create a ServerLocatorImpl using UDP discovery to lookup clusterServerLocatorImpl(Topology topology, boolean useHA, TransportConfiguration... transportConfigs)Create a ServerLocatorImpl using a static list of live servers
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ServerLocatorImpladdClusterTopologyListener(ClusterTopologyListener listener)ServerLocatorImpladdIncomingInterceptor(Interceptor interceptor)Adds an interceptor which will be executed after packets are received from the server.ServerLocatorImpladdOutgoingInterceptor(Interceptor interceptor)Adds an interceptor which will be executed before packets are sent to the server.booleanallInVM()Verify if all of the transports are using inVM.voidcleanup()static voidclearThreadPools()voidclose()Closes this factory and release all its resourcesClientSessionFactoryInternalconnect()ClientSessionFactoryInternalconnectNoWarnings()LikeServerLocatorInternal.connect()but it does not log warnings if it fails to connect.voidconnectorsChanged(List<DiscoveryEntry> newConnectors)ClientSessionFactorycreateSessionFactory()Creates a ClientSessionFactory using whatever load balancing policy is in forceClientSessionFactorycreateSessionFactory(String nodeID)Creates aClientSessionFactoryto a specific server.ClientSessionFactorycreateSessionFactory(TransportConfiguration transportConfiguration)Creates aClientSessionFactoryto a specific server.ClientSessionFactorycreateSessionFactory(TransportConfiguration transportConfiguration, int reconnectAttempts)Creates aClientSessionFactoryto a specific server.ClientSessionFactorycreateSessionFactory(TransportConfiguration transportConfiguration, int reconnectAttempts, boolean failoverOnInitialConnection)Deprecated.voidfactoryClosed(ClientSessionFactory factory)voidflushTopology()intgetAckBatchSize()Returns the acknowledgments batch size.AfterConnectInternalListenergetAfterConnectInternalListener()longgetCallFailoverTimeout()Returns the blocking calls failover timeout when the client is awaiting failover, this is over and above the normal call timeout.longgetCallTimeout()Returns the blocking calls timeout.longgetClientFailureCheckPeriod()Returns the period used to check if a client has failed to receive pings from the server.TransportConfigurationgetClusterTransportConfiguration()intgetConfirmationWindowSize()Returns the size for the confirmation window of clients using this factory.StringgetConnectionLoadBalancingPolicyClassName()Returns the class name of the connection load balancing policy.longgetConnectionTTL()Returns the connection time-to-live.intgetConsumerMaxRate()Returns the maximum rate of message consumption for consumers created through this factory.intgetConsumerWindowSize()Returns the window size for flow control of the consumers created through this factory.DiscoveryGroupgetDiscoveryGroup()For tests onlyDiscoveryGroupConfigurationgetDiscoveryGroupConfiguration()The discovery group configurationSet<ClientSessionFactoryInternal>getFactories()For tests onlyStringgetGroupID()Returns the group ID that will be eventually set on each message for the propertyMessage.HDR_GROUP_ID.StringgetIncomingInterceptorList()intgetInitialConnectAttempts()TransportConfiguration[]getInitialConnectors()for tests only and not part of the public interface.intgetInitialMessagePacketSize()Returns the initial size of messages created through this factory.ServerLocatorConfiggetLocatorConfig()longgetMaxRetryInterval()Returns the maximum retry interval (in the case a retry interval multiplier has been specified).intgetMinLargeMessageSize()Returns the large message size threshold.StringgetNodeID()StringgetOutgoingInterceptorList()intgetProducerMaxRate()Returns the maximum rate of message production for producers created through this factory.intgetProducerWindowSize()Returns the window size for flow control of the producers created through this factory.ClientProtocolManagerFactorygetProtocolManagerFactory()intgetReconnectAttempts()Returns the maximum number of attempts to retry connection in case of failure.longgetRetryInterval()Returns the time to retry connections created by this factory after failure.doublegetRetryIntervalMultiplier()Returns the multiplier to apply to successive retry intervals.intgetScheduledThreadPoolMaxSize()Returns the maximum size of the scheduled thread pool.TransportConfiguration[]getStaticTransportConfigurations()Returns an array of TransportConfigurations representing the static list of live servers used when creating this objectintgetThreadPoolMaxSize()Returns the maximum size of the thread pool.TopologygetTopology()Exposes the Topology used by this ServerLocator.booleangetUseTopologyForLoadBalancing()voidinitialize()This will only instantiate internal objects such as the topologybooleanisAutoGroup()Returns whether producers created through this factory will automatically assign a group ID to the messages they sent.booleanisBlockOnAcknowledge()Returns whether consumers created through this factory will block while sending message acknowledgments or do it asynchronously.booleanisBlockOnDurableSend()Returns whether producers created through this factory will block while sending durable messages or do it asynchronously.booleanisBlockOnNonDurableSend()Returns whether producers created through this factory will block while sending non-durable messages or do it asynchronously.booleanisCacheLargeMessagesClient()Whentrue, consumers created through this factory will create temporary files to cache large messages.booleanisClosed()Returns true if close was already calledbooleanisClusterConnection()booleanisCompressLargeMessage()Whether to compress large messages.booleanisConnectable()booleanisFailoverOnInitialConnection()Deprecated.booleanisHA()Whether this server receives topology notifications from the cluster as servers join or leave the cluster.booleanisPreAcknowledge()Returns whether messages will pre-acknowledged on the server before they are sent to the consumers or not.booleanisReceivedTopology()booleanisUseGlobalPools()Returns whether this factory will use global thread pools (shared among all the factories in the same JVM) or its own pools.static ServerLocatornewLocator(String uri)static ServerLocatornewLocator(URI uri)ClientProtocolManagernewProtocolManager()voidnotifyNodeDown(long eventTime, String nodeID)This is directly called when the connection to the node is gone, or when the node sends a disconnection.voidnotifyNodeUp(long uniqueEventID, String nodeID, String backupGroupName, String scaleDownGroupName, Pair<TransportConfiguration,TransportConfiguration> connectorPair, boolean last)voidremoveClusterTopologyListener(ClusterTopologyListener listener)booleanremoveIncomingInterceptor(Interceptor interceptor)Removes an incoming interceptor.booleanremoveOutgoingInterceptor(Interceptor interceptor)Removes an outgoing interceptor.voidresetToInitialConnectors()ServerLocatorImplsetAckBatchSize(int ackBatchSize)Sets the acknowledgments batch size.ServerLocatorImplsetAfterConnectionInternalListener(AfterConnectInternalListener listener)ServerLocatorImplsetAutoGroup(boolean autoGroup)Sets whether producers created through this factory will automatically assign a group ID to the messages they sent.ServerLocatorImplsetBlockOnAcknowledge(boolean blockOnAcknowledge)Sets whether consumers created through this factory will block while sending message acknowledgments or do it asynchronously.ServerLocatorImplsetBlockOnDurableSend(boolean blockOnDurableSend)Sets whether producers created through this factory will block while sending durable messages or do it asynchronously.ServerLocatorImplsetBlockOnNonDurableSend(boolean blockOnNonDurableSend)Sets whether producers created through this factory will block while sending non-durable messages or do it asynchronously.ServerLocatorImplsetCacheLargeMessagesClient(boolean cached)Sets whether large messages received by consumers created through this factory will be cached in temporary files or not.ServerLocatorImplsetCallFailoverTimeout(long callFailoverTimeout)Sets the blocking call failover timeout.ServerLocatorImplsetCallTimeout(long callTimeout)Sets the blocking call timeout.ServerLocatorImplsetClientFailureCheckPeriod(long clientFailureCheckPeriod)Sets the period (in milliseconds) used to check if a client has failed to receive pings from the server.ServerLocatorImplsetClusterConnection(boolean clusterConnection)ServerLocatorImplsetClusterTransportConfiguration(TransportConfiguration tc)ServerLocatorImplsetCompressLargeMessage(boolean avoid)Sets whether to compress or not large messages.ServerLocatorImplsetConfirmationWindowSize(int confirmationWindowSize)Sets the size for the confirmation window buffer of clients using this factory.ServerLocatorImplsetConnectionLoadBalancingPolicyClassName(String loadBalancingPolicyClassName)Sets the class name of the connection load balancing policy.ServerLocatorImplsetConnectionTTL(long connectionTTL)Sets this factory's connections time-to-live.ServerLocatorImplsetConsumerMaxRate(int consumerMaxRate)Sets the maximum rate of message consumption for consumers created through this factory.ServerLocatorImplsetConsumerWindowSize(int consumerWindowSize)Sets the window size for flow control of the consumers created through this factory.ServerLocatorImplsetFailoverOnInitialConnection(boolean failover)Deprecated.ServerLocatorImplsetGroupID(String groupID)Sets the group ID that will be set on each message sent through this factory.ServerLocatorImplsetIdentity(String identity)Used to better identify Cluster Connection Locators on logs.ServerLocatorsetIncomingInterceptorList(String interceptorList)ServerLocatorImplsetInitialConnectAttempts(int initialConnectAttempts)Sets the maximum number of attempts to establish an initial connection.ServerLocatorImplsetInitialMessagePacketSize(int size)Sets the initial size of messages created through this factory.voidsetLocatorConfig(ServerLocatorConfig config)ServerLocatorImplsetMaxRetryInterval(long retryInterval)Sets the maximum retry interval.ServerLocatorImplsetMinLargeMessageSize(int minLargeMessageSize)Sets the large message size threshold.ServerLocatorImplsetNodeID(String nodeID)ServerLocatorsetOutgoingInterceptorList(String interceptorList)ServerLocatorImplsetPreAcknowledge(boolean preAcknowledge)Sets totrueto pre-acknowledge consumed messages on the server before they are sent to consumers, else set tofalseto let clients acknowledge the message they consume.ServerLocatorImplsetProducerMaxRate(int producerMaxRate)Sets the maximum rate of message production for producers created through this factory.ServerLocatorImplsetProducerWindowSize(int producerWindowSize)Returns the window size for flow control of the producers created through this factory.ServerLocatorsetProtocolManagerFactory(ClientProtocolManagerFactory protocolManagerFactory)ServerLocatorImplsetReconnectAttempts(int reconnectAttempts)Sets the maximum number of attempts to retry connection in case of failure.ServerLocatorImplsetRetryInterval(long retryInterval)Sets the time to retry connections created by this factory after failure.ServerLocatorImplsetRetryIntervalMultiplier(double retryIntervalMultiplier)Sets the multiplier to apply to successive retry intervals.ServerLocatorImplsetScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize)Sets the maximum size of the scheduled thread pool.ServerLocatorImplsetThreadPoolMaxSize(int threadPoolMaxSize)Sets the maximum size of the thread pool.booleansetThreadPools(Executor threadPool, ScheduledExecutorService scheduledThreadPool)ServerLocatorImplsetUseGlobalPools(boolean useGlobalPools)Sets whether this factory will use global thread pools (shared among all the factories in the same JVM) or its own pools.ServerLocatorsetUseTopologyForLoadBalancing(boolean useTopologyForLoadBalancing)voidstart(Executor executor)StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.api.core.client.ServerLocator
disableFinalizeCheck
-
-
-
-
Constructor Detail
-
ServerLocatorImpl
public ServerLocatorImpl(boolean useHA, DiscoveryGroupConfiguration groupConfiguration)Create a ServerLocatorImpl using UDP discovery to lookup cluster
-
ServerLocatorImpl
public ServerLocatorImpl(boolean useHA, TransportConfiguration... transportConfigs)Create a ServerLocatorImpl using a static list of live servers- Parameters:
transportConfigs-
-
ServerLocatorImpl
public ServerLocatorImpl(Topology topology, boolean useHA, DiscoveryGroupConfiguration groupConfiguration)
Create a ServerLocatorImpl using UDP discovery to lookup cluster
-
ServerLocatorImpl
public ServerLocatorImpl(Topology topology, boolean useHA, TransportConfiguration... transportConfigs)
Create a ServerLocatorImpl using a static list of live servers- Parameters:
transportConfigs-
-
-
Method Detail
-
getDiscoveryGroup
public DiscoveryGroup getDiscoveryGroup()
For tests only
-
getFactories
public Set<ClientSessionFactoryInternal> getFactories()
For tests only
-
clearThreadPools
public static void clearThreadPools()
-
setThreadPools
public boolean setThreadPools(Executor threadPool, ScheduledExecutorService scheduledThreadPool)
- Specified by:
setThreadPoolsin interfaceServerLocator
-
initialize
public void initialize() throws ActiveMQExceptionDescription copied from interface:ServerLocatorThis will only instantiate internal objects such as the topology- Specified by:
initializein interfaceServerLocator- Throws:
ActiveMQException
-
getLocatorConfig
public ServerLocatorConfig getLocatorConfig()
- Specified by:
getLocatorConfigin interfaceServerLocator
-
setLocatorConfig
public void setLocatorConfig(ServerLocatorConfig config)
- Specified by:
setLocatorConfigin interfaceServerLocator
-
newLocator
public static ServerLocator newLocator(String uri)
-
newLocator
public static ServerLocator newLocator(URI uri)
-
resetToInitialConnectors
public void resetToInitialConnectors()
- Specified by:
resetToInitialConnectorsin interfaceServerLocatorInternal
-
allInVM
public boolean allInVM()
Description copied from interface:ServerLocatorVerify if all of the transports are using inVM.- Specified by:
allInVMin interfaceServerLocator- Returns:
trueif the locator has all inVM transports.
-
start
public void start(Executor executor) throws Exception
- Specified by:
startin interfaceServerLocatorInternal- Throws:
Exception
-
newProtocolManager
public ClientProtocolManager newProtocolManager()
- Specified by:
newProtocolManagerin interfaceServerLocatorInternal
-
getProtocolManagerFactory
public ClientProtocolManagerFactory getProtocolManagerFactory()
- Specified by:
getProtocolManagerFactoryin interfaceServerLocator
-
setProtocolManagerFactory
public ServerLocator setProtocolManagerFactory(ClientProtocolManagerFactory protocolManagerFactory)
- Specified by:
setProtocolManagerFactoryin interfaceServerLocator
-
connect
public ClientSessionFactoryInternal connect() throws ActiveMQException
- Specified by:
connectin interfaceServerLocatorInternal- Throws:
ActiveMQException
-
connectNoWarnings
public ClientSessionFactoryInternal connectNoWarnings() throws ActiveMQException
Description copied from interface:ServerLocatorInternalLikeServerLocatorInternal.connect()but it does not log warnings if it fails to connect.- Specified by:
connectNoWarningsin interfaceServerLocatorInternal- Throws:
ActiveMQException
-
setAfterConnectionInternalListener
public ServerLocatorImpl setAfterConnectionInternalListener(AfterConnectInternalListener listener)
- Specified by:
setAfterConnectionInternalListenerin interfaceServerLocatorInternal
-
getAfterConnectInternalListener
public AfterConnectInternalListener getAfterConnectInternalListener()
- Specified by:
getAfterConnectInternalListenerin interfaceServerLocatorInternal
-
createSessionFactory
public ClientSessionFactory createSessionFactory(String nodeID) throws Exception
Description copied from interface:ServerLocatorCreates aClientSessionFactoryto a specific server. The server must already be known about by this ServerLocator. This method allows the user to make a connection to a specific server bypassing any load balancing policy in force- Specified by:
createSessionFactoryin interfaceServerLocator- Returns:
- a ClientSessionFactory instance or
nullif the node is not present on the topology - Throws:
Exception- if a failure happened in creating the ClientSessionFactory or the ServerLocator does not know about the passed in transportConfiguration
-
createSessionFactory
public ClientSessionFactory createSessionFactory(TransportConfiguration transportConfiguration) throws Exception
Description copied from interface:ServerLocatorCreates aClientSessionFactoryto a specific server. The server must already be known about by this ServerLocator. This method allows the user to make a connection to a specific server bypassing any load balancing policy in force- Specified by:
createSessionFactoryin interfaceServerLocator- Returns:
- a
ClientSessionFactoryinstance - Throws:
Exception- if a failure happened in creating the ClientSessionFactory or the ServerLocator does not know about the passed in transportConfiguration
-
createSessionFactory
public ClientSessionFactory createSessionFactory(TransportConfiguration transportConfiguration, int reconnectAttempts) throws Exception
Description copied from interface:ServerLocatorCreates aClientSessionFactoryto a specific server. The server must already be known about by this ServerLocator. This method allows the user to make a connection to a specific server bypassing any load balancing policy in force- Specified by:
createSessionFactoryin interfaceServerLocatorreconnectAttempts- number of attempts of reconnection to perform- Returns:
- a
ClientSessionFactoryinstance - Throws:
Exception- if a failure happened in creating the ClientSessionFactory or the ServerLocator does not know about the passed in transportConfiguration
-
createSessionFactory
@Deprecated public ClientSessionFactory createSessionFactory(TransportConfiguration transportConfiguration, int reconnectAttempts, boolean failoverOnInitialConnection) throws Exception
Deprecated.Description copied from interface:ServerLocatorCreates aClientSessionFactoryto a specific server. The server must already be known about by this ServerLocator. This method allows the user to make a connection to a specific server bypassing any load balancing policy in force- Specified by:
createSessionFactoryin interfaceServerLocatorreconnectAttempts- number of attempts of reconnection to perform- Returns:
- a
ClientSessionFactoryinstance - Throws:
Exception- if a failure happened in creating the ClientSessionFactory or the ServerLocator does not know about the passed in transportConfiguration
-
createSessionFactory
public ClientSessionFactory createSessionFactory() throws ActiveMQException
Description copied from interface:ServerLocatorCreates a ClientSessionFactory using whatever load balancing policy is in force- Specified by:
createSessionFactoryin interfaceServerLocator- Returns:
- The ClientSessionFactory
- Throws:
ActiveMQException
-
flushTopology
public void flushTopology()
-
isHA
public boolean isHA()
Description copied from interface:ServerLocatorWhether this server receives topology notifications from the cluster as servers join or leave the cluster.- Specified by:
isHAin interfaceServerLocator- Returns:
trueif the locator receives topology updates from the cluster
-
setIncomingInterceptorList
public ServerLocator setIncomingInterceptorList(String interceptorList)
- Specified by:
setIncomingInterceptorListin interfaceServerLocator- Parameters:
interceptorList- a comma separated string of incoming interceptor class names to be used. Each interceptor needs a default Constructor to be used with this method.- Returns:
- this
-
getIncomingInterceptorList
public String getIncomingInterceptorList()
- Specified by:
getIncomingInterceptorListin interfaceServerLocator
-
setOutgoingInterceptorList
public ServerLocator setOutgoingInterceptorList(String interceptorList)
- Specified by:
setOutgoingInterceptorListin interfaceServerLocator- Parameters:
interceptorList- a comma separated string of incoming interceptor class names to be used. Each interceptor needs a default Constructor to be used with this method.- Returns:
- this
-
getOutgoingInterceptorList
public String getOutgoingInterceptorList()
- Specified by:
getOutgoingInterceptorListin interfaceServerLocator
-
isCacheLargeMessagesClient
public boolean isCacheLargeMessagesClient()
Description copied from interface:ServerLocatorWhentrue, consumers created through this factory will create temporary files to cache large messages.There is 1 temporary file created for each large message.
Default value is
ActiveMQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT.- Specified by:
isCacheLargeMessagesClientin interfaceServerLocator- Returns:
trueif consumers created through this factory will cache large messages in temporary files,falseelse
-
setCacheLargeMessagesClient
public ServerLocatorImpl setCacheLargeMessagesClient(boolean cached)
Description copied from interface:ServerLocatorSets whether large messages received by consumers created through this factory will be cached in temporary files or not.- Specified by:
setCacheLargeMessagesClientin interfaceServerLocator- Parameters:
cached-trueto cache large messages in temporary files,falseelse- Returns:
- this ServerLocator
-
getClientFailureCheckPeriod
public long getClientFailureCheckPeriod()
Description copied from interface:ServerLocatorReturns the period used to check if a client has failed to receive pings from the server.Period is in milliseconds, default value is
ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD.- Specified by:
getClientFailureCheckPeriodin interfaceServerLocator- Returns:
- the period used to check if a client has failed to receive pings from the server
-
setClientFailureCheckPeriod
public ServerLocatorImpl setClientFailureCheckPeriod(long clientFailureCheckPeriod)
Description copied from interface:ServerLocatorSets the period (in milliseconds) used to check if a client has failed to receive pings from the server.Value must be -1 (to disable) or greater than 0.
- Specified by:
setClientFailureCheckPeriodin interfaceServerLocator- Parameters:
clientFailureCheckPeriod- the period to check failure- Returns:
- this ServerLocator
-
getConnectionTTL
public long getConnectionTTL()
Description copied from interface:ServerLocatorReturns the connection time-to-live.This TTL determines how long the server will keep a connection alive in the absence of any data arriving from the client. Value is in milliseconds, default value is
ActiveMQClient.DEFAULT_CONNECTION_TTL.- Specified by:
getConnectionTTLin interfaceServerLocator- Returns:
- the connection time-to-live in milliseconds
-
setConnectionTTL
public ServerLocatorImpl setConnectionTTL(long connectionTTL)
Description copied from interface:ServerLocatorSets this factory's connections time-to-live.Value must be -1 (to disable) or greater or equals to 0.
- Specified by:
setConnectionTTLin interfaceServerLocator- Parameters:
connectionTTL- period in milliseconds- Returns:
- this ServerLocator
-
getCallTimeout
public long getCallTimeout()
Description copied from interface:ServerLocatorReturns the blocking calls timeout.If client's blocking calls to the server take more than this timeout, the call will throw a
ActiveMQExceptionwith the codeActiveMQExceptionType.CONNECTION_TIMEDOUT. Value is in milliseconds, default value isActiveMQClient.DEFAULT_CALL_TIMEOUT.- Specified by:
getCallTimeoutin interfaceServerLocator- Returns:
- the blocking calls timeout
-
setCallTimeout
public ServerLocatorImpl setCallTimeout(long callTimeout)
Description copied from interface:ServerLocatorSets the blocking call timeout.Value must be greater or equals to 0
- Specified by:
setCallTimeoutin interfaceServerLocator- Parameters:
callTimeout- blocking call timeout in milliseconds- Returns:
- this ServerLocator
-
getCallFailoverTimeout
public long getCallFailoverTimeout()
Description copied from interface:ServerLocatorReturns the blocking calls failover timeout when the client is awaiting failover, this is over and above the normal call timeout.If client is in the process of failing over when a blocking call is called then the client will wait this long before actually trying the send.
- Specified by:
getCallFailoverTimeoutin interfaceServerLocator- Returns:
- the blocking calls failover timeout
-
setCallFailoverTimeout
public ServerLocatorImpl setCallFailoverTimeout(long callFailoverTimeout)
Description copied from interface:ServerLocatorSets the blocking call failover timeout.When the client is awaiting failover, this is over and above the normal call timeout.
Value must be greater or equals to -1, -1 means forever
- Specified by:
setCallFailoverTimeoutin interfaceServerLocator- Parameters:
callFailoverTimeout- blocking call timeout in milliseconds- Returns:
- this ServerLocator
-
getMinLargeMessageSize
public int getMinLargeMessageSize()
Description copied from interface:ServerLocatorReturns the large message size threshold.Messages whose size is if greater than this value will be handled as large messages. Value is in bytes, default value is
ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE.- Specified by:
getMinLargeMessageSizein interfaceServerLocator- Returns:
- the message size threshold to treat messages as large messages.
-
setMinLargeMessageSize
public ServerLocatorImpl setMinLargeMessageSize(int minLargeMessageSize)
Description copied from interface:ServerLocatorSets the large message size threshold.Value must be greater than 0.
- Specified by:
setMinLargeMessageSizein interfaceServerLocator- Parameters:
minLargeMessageSize- large message size threshold in bytes- Returns:
- this ServerLocator
-
getConsumerWindowSize
public int getConsumerWindowSize()
Description copied from interface:ServerLocatorReturns the window size for flow control of the consumers created through this factory.Value is in bytes, default value is
ActiveMQClient.DEFAULT_CONSUMER_WINDOW_SIZE.- Specified by:
getConsumerWindowSizein interfaceServerLocator- Returns:
- the window size used for consumer flow control
-
setConsumerWindowSize
public ServerLocatorImpl setConsumerWindowSize(int consumerWindowSize)
Description copied from interface:ServerLocatorSets the window size for flow control of the consumers created through this factory.Value must be -1 (to disable flow control), 0 (to not buffer any messages) or greater than 0 (to set the maximum size of the buffer)
- Specified by:
setConsumerWindowSizein interfaceServerLocator- Parameters:
consumerWindowSize- window size (in bytes) used for consumer flow control- Returns:
- this ServerLocator
-
getConsumerMaxRate
public int getConsumerMaxRate()
Description copied from interface:ServerLocatorReturns the maximum rate of message consumption for consumers created through this factory.This value controls the rate at which a consumer can consume messages. A consumer will never consume messages at a rate faster than the rate specified.
Value is -1 (to disable) or a positive integer corresponding to the maximum desired message consumption rate specified in units of messages per second. Default value is
ActiveMQClient.DEFAULT_CONSUMER_MAX_RATE.- Specified by:
getConsumerMaxRatein interfaceServerLocator- Returns:
- the consumer max rate
-
setConsumerMaxRate
public ServerLocatorImpl setConsumerMaxRate(int consumerMaxRate)
Description copied from interface:ServerLocatorSets the maximum rate of message consumption for consumers created through this factory.Value must -1 (to disable) or a positive integer corresponding to the maximum desired message consumption rate specified in units of messages per second.
- Specified by:
setConsumerMaxRatein interfaceServerLocator- Parameters:
consumerMaxRate- maximum rate of message consumption (in messages per seconds)- Returns:
- this ServerLocator
-
getConfirmationWindowSize
public int getConfirmationWindowSize()
Description copied from interface:ServerLocatorReturns the size for the confirmation window of clients using this factory.Value is in bytes or -1 (to disable the window). Default value is
ActiveMQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE.- Specified by:
getConfirmationWindowSizein interfaceServerLocator- Returns:
- the size for the confirmation window of clients using this factory
-
setConfirmationWindowSize
public ServerLocatorImpl setConfirmationWindowSize(int confirmationWindowSize)
Description copied from interface:ServerLocatorSets the size for the confirmation window buffer of clients using this factory.Value must be -1 (to disable the window) or greater than 0.
- Specified by:
setConfirmationWindowSizein interfaceServerLocator- Parameters:
confirmationWindowSize- size of the confirmation window (in bytes)- Returns:
- this ServerLocator
-
getProducerWindowSize
public int getProducerWindowSize()
Description copied from interface:ServerLocatorReturns the window size for flow control of the producers created through this factory.Value must be -1 (to disable flow control) or greater than 0 to determine the maximum amount of bytes at any give time (to prevent overloading the connection). Default value is
ActiveMQClient.DEFAULT_PRODUCER_WINDOW_SIZE.- Specified by:
getProducerWindowSizein interfaceServerLocator- Returns:
- the window size for flow control of the producers created through this factory.
-
setProducerWindowSize
public ServerLocatorImpl setProducerWindowSize(int producerWindowSize)
Description copied from interface:ServerLocatorReturns the window size for flow control of the producers created through this factory.Value must be -1 (to disable flow control) or greater than 0.
- Specified by:
setProducerWindowSizein interfaceServerLocator- Parameters:
producerWindowSize- window size (in bytest) for flow control of the producers created through this factory.- Returns:
- this ServerLocator
-
getProducerMaxRate
public int getProducerMaxRate()
Description copied from interface:ServerLocatorReturns the maximum rate of message production for producers created through this factory.This value controls the rate at which a producer can produce messages. A producer will never produce messages at a rate faster than the rate specified.
Value is -1 (to disable) or a positive integer corresponding to the maximum desired message production rate specified in units of messages per second. Default value is
ActiveMQClient.DEFAULT_PRODUCER_MAX_RATE.- Specified by:
getProducerMaxRatein interfaceServerLocator- Returns:
- maximum rate of message production (in messages per seconds)
-
setProducerMaxRate
public ServerLocatorImpl setProducerMaxRate(int producerMaxRate)
Description copied from interface:ServerLocatorSets the maximum rate of message production for producers created through this factory.Value must -1 (to disable) or a positive integer corresponding to the maximum desired message production rate specified in units of messages per second.
- Specified by:
setProducerMaxRatein interfaceServerLocator- Parameters:
producerMaxRate- maximum rate of message production (in messages per seconds)- Returns:
- this ServerLocator
-
isBlockOnAcknowledge
public boolean isBlockOnAcknowledge()
Description copied from interface:ServerLocatorReturns whether consumers created through this factory will block while sending message acknowledgments or do it asynchronously.Default value is
ActiveMQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE.- Specified by:
isBlockOnAcknowledgein interfaceServerLocator- Returns:
- whether consumers will block while sending message acknowledgments or do it asynchronously
-
setBlockOnAcknowledge
public ServerLocatorImpl setBlockOnAcknowledge(boolean blockOnAcknowledge)
Description copied from interface:ServerLocatorSets whether consumers created through this factory will block while sending message acknowledgments or do it asynchronously.- Specified by:
setBlockOnAcknowledgein interfaceServerLocator- Parameters:
blockOnAcknowledge-trueto block when sending message acknowledgments orfalseto send them asynchronously- Returns:
- this ServerLocator
-
isBlockOnDurableSend
public boolean isBlockOnDurableSend()
Description copied from interface:ServerLocatorReturns whether producers created through this factory will block while sending durable messages or do it asynchronously.
If the session is configured to send durable message asynchronously, the client can set a SendAcknowledgementHandler on the ClientSession to be notified once the message has been handled by the server.Default value is
ActiveMQClient.DEFAULT_BLOCK_ON_DURABLE_SEND.- Specified by:
isBlockOnDurableSendin interfaceServerLocator- Returns:
- whether producers will block while sending persistent messages or do it asynchronously
-
setBlockOnDurableSend
public ServerLocatorImpl setBlockOnDurableSend(boolean blockOnDurableSend)
Description copied from interface:ServerLocatorSets whether producers created through this factory will block while sending durable messages or do it asynchronously.- Specified by:
setBlockOnDurableSendin interfaceServerLocator- Parameters:
blockOnDurableSend-trueto block when sending durable messages orfalseto send them asynchronously- Returns:
- this ServerLocator
-
isBlockOnNonDurableSend
public boolean isBlockOnNonDurableSend()
Description copied from interface:ServerLocatorReturns whether producers created through this factory will block while sending non-durable messages or do it asynchronously.
If the session is configured to send non-durable message asynchronously, the client can set a SendAcknowledgementHandler on the ClientSession to be notified once the message has been handled by the server.Default value is
ActiveMQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND.- Specified by:
isBlockOnNonDurableSendin interfaceServerLocator- Returns:
- whether producers will block while sending non-durable messages or do it asynchronously
-
setBlockOnNonDurableSend
public ServerLocatorImpl setBlockOnNonDurableSend(boolean blockOnNonDurableSend)
Description copied from interface:ServerLocatorSets whether producers created through this factory will block while sending non-durable messages or do it asynchronously.- Specified by:
setBlockOnNonDurableSendin interfaceServerLocator- Parameters:
blockOnNonDurableSend-trueto block when sending non-durable messages orfalseto send them asynchronously- Returns:
- this ServerLocator
-
isAutoGroup
public boolean isAutoGroup()
Description copied from interface:ServerLocatorReturns whether producers created through this factory will automatically assign a group ID to the messages they sent.if
true, a random unique group ID is created and set on each message for the propertyMessage.HDR_GROUP_ID. Default value isActiveMQClient.DEFAULT_AUTO_GROUP.- Specified by:
isAutoGroupin interfaceServerLocator- Returns:
- whether producers will automatically assign a group ID to their messages
-
setAutoGroup
public ServerLocatorImpl setAutoGroup(boolean autoGroup)
Description copied from interface:ServerLocatorSets whether producers created through this factory will automatically assign a group ID to the messages they sent.- Specified by:
setAutoGroupin interfaceServerLocator- Parameters:
autoGroup-trueto automatically assign a group ID to each messages sent through this factory,falseelse- Returns:
- this ServerLocator
-
isPreAcknowledge
public boolean isPreAcknowledge()
Description copied from interface:ServerLocatorReturns whether messages will pre-acknowledged on the server before they are sent to the consumers or not.Default value is
ActiveMQClient.DEFAULT_PRE_ACKNOWLEDGE- Specified by:
isPreAcknowledgein interfaceServerLocator
-
setPreAcknowledge
public ServerLocatorImpl setPreAcknowledge(boolean preAcknowledge)
Description copied from interface:ServerLocatorSets totrueto pre-acknowledge consumed messages on the server before they are sent to consumers, else set tofalseto let clients acknowledge the message they consume.- Specified by:
setPreAcknowledgein interfaceServerLocator- Parameters:
preAcknowledge-trueto enable pre-acknowledgment,falseelse- Returns:
- this ServerLocator
-
getAckBatchSize
public int getAckBatchSize()
Description copied from interface:ServerLocatorReturns the acknowledgments batch size.Default value is
ActiveMQClient.DEFAULT_ACK_BATCH_SIZE.- Specified by:
getAckBatchSizein interfaceServerLocator- Returns:
- the acknowledgments batch size
-
setAckBatchSize
public ServerLocatorImpl setAckBatchSize(int ackBatchSize)
Description copied from interface:ServerLocatorSets the acknowledgments batch size.Value must be equal or greater than 0.
- Specified by:
setAckBatchSizein interfaceServerLocator- Parameters:
ackBatchSize- acknowledgments batch size- Returns:
- this ServerLocator
-
isUseGlobalPools
public boolean isUseGlobalPools()
Description copied from interface:ServerLocatorReturns whether this factory will use global thread pools (shared among all the factories in the same JVM) or its own pools.Default value is
ActiveMQClient.DEFAULT_USE_GLOBAL_POOLS.- Specified by:
isUseGlobalPoolsin interfaceServerLocator- Returns:
trueif this factory uses global thread pools,falseelse
-
setUseGlobalPools
public ServerLocatorImpl setUseGlobalPools(boolean useGlobalPools)
Description copied from interface:ServerLocatorSets whether this factory will use global thread pools (shared among all the factories in the same JVM) or its own pools.- Specified by:
setUseGlobalPoolsin interfaceServerLocator- Parameters:
useGlobalPools-trueto let this factory uses global thread pools,falseelse- Returns:
- this ServerLocator
-
getScheduledThreadPoolMaxSize
public int getScheduledThreadPoolMaxSize()
Description copied from interface:ServerLocatorReturns the maximum size of the scheduled thread pool.Default value is
ActiveMQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE.- Specified by:
getScheduledThreadPoolMaxSizein interfaceServerLocator- Returns:
- the maximum size of the scheduled thread pool.
-
setScheduledThreadPoolMaxSize
public ServerLocatorImpl setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize)
Description copied from interface:ServerLocatorSets the maximum size of the scheduled thread pool.This setting is relevant only if this factory does not use global pools. Value must be greater than 0.
- Specified by:
setScheduledThreadPoolMaxSizein interfaceServerLocator- Parameters:
scheduledThreadPoolMaxSize- maximum size of the scheduled thread pool.- Returns:
- this ServerLocator
-
getThreadPoolMaxSize
public int getThreadPoolMaxSize()
Description copied from interface:ServerLocatorReturns the maximum size of the thread pool.Default value is
ActiveMQClient.DEFAULT_THREAD_POOL_MAX_SIZE.- Specified by:
getThreadPoolMaxSizein interfaceServerLocator- Returns:
- the maximum size of the thread pool.
-
setThreadPoolMaxSize
public ServerLocatorImpl setThreadPoolMaxSize(int threadPoolMaxSize)
Description copied from interface:ServerLocatorSets the maximum size of the thread pool.This setting is relevant only if this factory does not use global pools. Value must be -1 (for unlimited thread pool) or greater than 0.
- Specified by:
setThreadPoolMaxSizein interfaceServerLocator- Parameters:
threadPoolMaxSize- maximum size of the thread pool.- Returns:
- this ServerLocator
-
getRetryInterval
public long getRetryInterval()
Description copied from interface:ServerLocatorReturns the time to retry connections created by this factory after failure.Value is in milliseconds, default is
ActiveMQClient.DEFAULT_RETRY_INTERVAL.- Specified by:
getRetryIntervalin interfaceServerLocator- Returns:
- the time to retry connections created by this factory after failure
-
setRetryInterval
public ServerLocatorImpl setRetryInterval(long retryInterval)
Description copied from interface:ServerLocatorSets the time to retry connections created by this factory after failure.Value must be greater than 0.
- Specified by:
setRetryIntervalin interfaceServerLocator- Parameters:
retryInterval- time (in milliseconds) to retry connections created by this factory after failure- Returns:
- this ServerLocator
-
getMaxRetryInterval
public long getMaxRetryInterval()
Description copied from interface:ServerLocatorReturns the maximum retry interval (in the case a retry interval multiplier has been specified).Value is in milliseconds, default value is
ActiveMQClient.DEFAULT_MAX_RETRY_INTERVAL.- Specified by:
getMaxRetryIntervalin interfaceServerLocator- Returns:
- the maximum retry interval
-
setMaxRetryInterval
public ServerLocatorImpl setMaxRetryInterval(long retryInterval)
Description copied from interface:ServerLocatorSets the maximum retry interval.Value must be greater than 0.
- Specified by:
setMaxRetryIntervalin interfaceServerLocator- Parameters:
retryInterval- maximum retry interval to apply in the case a retry interval multiplier has been specified- Returns:
- this ServerLocator
-
getRetryIntervalMultiplier
public double getRetryIntervalMultiplier()
Description copied from interface:ServerLocatorReturns the multiplier to apply to successive retry intervals.Default value is
ActiveMQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER.- Specified by:
getRetryIntervalMultiplierin interfaceServerLocator- Returns:
- the multiplier to apply to successive retry intervals
-
setRetryIntervalMultiplier
public ServerLocatorImpl setRetryIntervalMultiplier(double retryIntervalMultiplier)
Description copied from interface:ServerLocatorSets the multiplier to apply to successive retry intervals.Value must be positive.
- Specified by:
setRetryIntervalMultiplierin interfaceServerLocator- Parameters:
retryIntervalMultiplier- multiplier to apply to successive retry intervals- Returns:
- this ServerLocator
-
getReconnectAttempts
public int getReconnectAttempts()
Description copied from interface:ServerLocatorReturns the maximum number of attempts to retry connection in case of failure.Default value is
ActiveMQClient.DEFAULT_RECONNECT_ATTEMPTS.- Specified by:
getReconnectAttemptsin interfaceServerLocator- Returns:
- the maximum number of attempts to retry connection in case of failure.
-
setReconnectAttempts
public ServerLocatorImpl setReconnectAttempts(int reconnectAttempts)
Description copied from interface:ServerLocatorSets the maximum number of attempts to retry connection in case of failure.Value must be -1 (to retry infinitely), 0 (to never retry connection) or greater than 0.
- Specified by:
setReconnectAttemptsin interfaceServerLocator- Parameters:
reconnectAttempts- maximum number of attempts to retry connection in case of failure- Returns:
- this ServerLocator
-
setInitialConnectAttempts
public ServerLocatorImpl setInitialConnectAttempts(int initialConnectAttempts)
Description copied from interface:ServerLocatorSets the maximum number of attempts to establish an initial connection.Value must be -1 (to retry infinitely), 0 (to never retry connection) or greater than 0.
- Specified by:
setInitialConnectAttemptsin interfaceServerLocator- Parameters:
initialConnectAttempts- maximum number of attempts for the initial connection- Returns:
- this ServerLocator
-
getInitialConnectAttempts
public int getInitialConnectAttempts()
- Specified by:
getInitialConnectAttemptsin interfaceServerLocator- Returns:
- the number of attempts to be made for first initial connection.
-
isFailoverOnInitialConnection
@Deprecated public boolean isFailoverOnInitialConnection()
Deprecated.Description copied from interface:ServerLocatorReturns true if the client will automatically attempt to connect to the backup server if the initial connection to the live server failsDefault value is
ActiveMQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION.- Specified by:
isFailoverOnInitialConnectionin interfaceServerLocator
-
setFailoverOnInitialConnection
@Deprecated public ServerLocatorImpl setFailoverOnInitialConnection(boolean failover)
Deprecated.Description copied from interface:ServerLocatorSets the value for FailoverOnInitialReconnection- Specified by:
setFailoverOnInitialConnectionin interfaceServerLocator- Returns:
- this ServerLocator
-
getConnectionLoadBalancingPolicyClassName
public String getConnectionLoadBalancingPolicyClassName()
Description copied from interface:ServerLocatorReturns the class name of the connection load balancing policy.Default value is "org.apache.activemq.artemis.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy".
- Specified by:
getConnectionLoadBalancingPolicyClassNamein interfaceServerLocator- Returns:
- the class name of the connection load balancing policy
-
setConnectionLoadBalancingPolicyClassName
public ServerLocatorImpl setConnectionLoadBalancingPolicyClassName(String loadBalancingPolicyClassName)
Description copied from interface:ServerLocatorSets the class name of the connection load balancing policy.Value must be the name of a class implementing
ConnectionLoadBalancingPolicy.- Specified by:
setConnectionLoadBalancingPolicyClassNamein interfaceServerLocator- Parameters:
loadBalancingPolicyClassName- class name of the connection load balancing policy- Returns:
- this ServerLocator
-
getStaticTransportConfigurations
public TransportConfiguration[] getStaticTransportConfigurations()
Description copied from interface:ServerLocatorReturns an array of TransportConfigurations representing the static list of live servers used when creating this object- Specified by:
getStaticTransportConfigurationsin interfaceServerLocator- Returns:
- array with all static
TransportConfigurations
-
getDiscoveryGroupConfiguration
public DiscoveryGroupConfiguration getDiscoveryGroupConfiguration()
Description copied from interface:ServerLocatorThe discovery group configuration- Specified by:
getDiscoveryGroupConfigurationin interfaceServerLocator
-
addIncomingInterceptor
public ServerLocatorImpl addIncomingInterceptor(Interceptor interceptor)
Description copied from interface:ServerLocatorAdds an interceptor which will be executed after packets are received from the server.- Specified by:
addIncomingInterceptorin interfaceServerLocator- Parameters:
interceptor- an Interceptor- Returns:
- this ServerLocator
-
addOutgoingInterceptor
public ServerLocatorImpl addOutgoingInterceptor(Interceptor interceptor)
Description copied from interface:ServerLocatorAdds an interceptor which will be executed before packets are sent to the server.- Specified by:
addOutgoingInterceptorin interfaceServerLocator- Parameters:
interceptor- an Interceptor- Returns:
- this ServerLocator
-
removeIncomingInterceptor
public boolean removeIncomingInterceptor(Interceptor interceptor)
Description copied from interface:ServerLocatorRemoves an incoming interceptor.- Specified by:
removeIncomingInterceptorin interfaceServerLocator- Parameters:
interceptor- interceptor to remove- Returns:
trueif the incoming interceptor is removed from this factory,falseelse
-
removeOutgoingInterceptor
public boolean removeOutgoingInterceptor(Interceptor interceptor)
Description copied from interface:ServerLocatorRemoves an outgoing interceptor.- Specified by:
removeOutgoingInterceptorin interfaceServerLocator- Parameters:
interceptor- interceptor to remove- Returns:
trueif the outgoing interceptor is removed from this factory,falseelse
-
getInitialMessagePacketSize
public int getInitialMessagePacketSize()
Description copied from interface:ServerLocatorReturns the initial size of messages created through this factory.Value is in bytes, default value is
ActiveMQClient.DEFAULT_INITIAL_MESSAGE_PACKET_SIZE.- Specified by:
getInitialMessagePacketSizein interfaceServerLocator- Returns:
- the initial size of messages created through this factory
-
setInitialMessagePacketSize
public ServerLocatorImpl setInitialMessagePacketSize(int size)
Description copied from interface:ServerLocatorSets the initial size of messages created through this factory.Value must be greater than 0.
- Specified by:
setInitialMessagePacketSizein interfaceServerLocator- Parameters:
size- initial size of messages created through this factory.- Returns:
- this ServerLocator
-
setGroupID
public ServerLocatorImpl setGroupID(String groupID)
Description copied from interface:ServerLocatorSets the group ID that will be set on each message sent through this factory.- Specified by:
setGroupIDin interfaceServerLocator- Parameters:
groupID- the group ID to use- Returns:
- this ServerLocator
-
getGroupID
public String getGroupID()
Description copied from interface:ServerLocatorReturns the group ID that will be eventually set on each message for the propertyMessage.HDR_GROUP_ID.Default value is is
nulland no group ID will be set on the messages.- Specified by:
getGroupIDin interfaceServerLocator- Returns:
- the group ID that will be eventually set on each message
-
isCompressLargeMessage
public boolean isCompressLargeMessage()
Description copied from interface:ServerLocatorWhether to compress large messages.- Specified by:
isCompressLargeMessagein interfaceServerLocator- Returns:
-
setCompressLargeMessage
public ServerLocatorImpl setCompressLargeMessage(boolean avoid)
Description copied from interface:ServerLocatorSets whether to compress or not large messages.- Specified by:
setCompressLargeMessagein interfaceServerLocator- Returns:
- this ServerLocator
-
setIdentity
public ServerLocatorImpl setIdentity(String identity)
Description copied from interface:ServerLocatorInternalUsed to better identify Cluster Connection Locators on logs. To facilitate eventual debugging. This method used to be on tests interface, but I'm now making it part of the public interface since- Specified by:
setIdentityin interfaceServerLocatorInternal
-
setNodeID
public ServerLocatorImpl setNodeID(String nodeID)
- Specified by:
setNodeIDin interfaceServerLocatorInternal
-
getNodeID
public String getNodeID()
- Specified by:
getNodeIDin interfaceServerLocatorInternal
-
setClusterConnection
public ServerLocatorImpl setClusterConnection(boolean clusterConnection)
- Specified by:
setClusterConnectionin interfaceServerLocatorInternal
-
isClusterConnection
public boolean isClusterConnection()
- Specified by:
isClusterConnectionin interfaceServerLocatorInternal
-
getClusterTransportConfiguration
public TransportConfiguration getClusterTransportConfiguration()
- Specified by:
getClusterTransportConfigurationin interfaceServerLocatorInternal
-
setClusterTransportConfiguration
public ServerLocatorImpl setClusterTransportConfiguration(TransportConfiguration tc)
- Specified by:
setClusterTransportConfigurationin interfaceServerLocatorInternal
-
cleanup
public void cleanup()
- Specified by:
cleanupin interfaceServerLocatorInternal
-
close
public void close()
Description copied from interface:ServerLocatorCloses this factory and release all its resources- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceServerLocator
-
notifyNodeDown
public void notifyNodeDown(long eventTime, String nodeID)This is directly called when the connection to the node is gone, or when the node sends a disconnection. Look for callers of this method!- Specified by:
notifyNodeDownin interfaceServerLocatorInternal- Parameters:
eventTime- 0 means get the previous ID +1
-
notifyNodeUp
public void notifyNodeUp(long uniqueEventID, String nodeID, String backupGroupName, String scaleDownGroupName, Pair<TransportConfiguration,TransportConfiguration> connectorPair, boolean last)- Specified by:
notifyNodeUpin interfaceServerLocatorInternal
-
connectorsChanged
public void connectorsChanged(List<DiscoveryEntry> newConnectors)
- Specified by:
connectorsChangedin interfaceDiscoveryListener
-
factoryClosed
public void factoryClosed(ClientSessionFactory factory)
- Specified by:
factoryClosedin interfaceServerLocatorInternal
-
setUseTopologyForLoadBalancing
public ServerLocator setUseTopologyForLoadBalancing(boolean useTopologyForLoadBalancing)
- Specified by:
setUseTopologyForLoadBalancingin interfaceServerLocator- Returns:
-
getUseTopologyForLoadBalancing
public boolean getUseTopologyForLoadBalancing()
- Specified by:
getUseTopologyForLoadBalancingin interfaceServerLocator
-
getTopology
public Topology getTopology()
Description copied from interface:ServerLocatorExposes the Topology used by this ServerLocator.- Specified by:
getTopologyin interfaceServerLocator- Specified by:
getTopologyin interfaceServerLocatorInternal- Returns:
- topology
-
isConnectable
public boolean isConnectable()
- Specified by:
isConnectablein interfaceServerLocatorInternal
-
addClusterTopologyListener
public ServerLocatorImpl addClusterTopologyListener(ClusterTopologyListener listener)
- Specified by:
addClusterTopologyListenerin interfaceServerLocator
-
removeClusterTopologyListener
public void removeClusterTopologyListener(ClusterTopologyListener listener)
- Specified by:
removeClusterTopologyListenerin interfaceServerLocator
-
getInitialConnectors
public TransportConfiguration[] getInitialConnectors()
for tests only and not part of the public interface. Do not use it.- Returns:
-
isClosed
public boolean isClosed()
Description copied from interface:ServerLocatorReturns true if close was already called- Specified by:
isClosedin interfaceServerLocator- Returns:
trueif closed,falseotherwise.
-
isReceivedTopology
public boolean isReceivedTopology()
-
-