|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.client.Closeable
org.apache.qpid.client.AMQConnection
public class AMQConnection
Nested Class Summary | |
---|---|
static class |
AMQConnection.ChannelToSessionMap
|
Field Summary | |
---|---|
protected boolean |
_connected
|
protected AMQConnectionDelegate |
_delegate
|
protected ExceptionListener |
_exceptionListener
|
protected FailoverPolicy |
_failoverPolicy
Policy dictating how to failover |
protected long |
_maximumChannelCount
A channel is roughly analogous to a session. |
protected AMQProtocolHandler |
_protocolHandler
The protocol handler dispatches protocol events for this connection. |
protected boolean |
_started
Whether this connection is started, i.e. |
Fields inherited from class org.apache.qpid.client.Closeable |
---|
_closed, _closing |
Constructor Summary | |
---|---|
|
AMQConnection(ConnectionURL connectionURL,
SSLConfiguration sslConfig)
|
|
AMQConnection(String connection)
|
|
AMQConnection(String host,
int port,
boolean useSSL,
String username,
String password,
String clientName,
String virtualHost,
SSLConfiguration sslConfig)
|
|
AMQConnection(String host,
int port,
String username,
String password,
String clientName,
String virtualHost)
|
|
AMQConnection(String host,
int port,
String username,
String password,
String clientName,
String virtualHost,
SSLConfiguration sslConfig)
|
|
AMQConnection(String connection,
SSLConfiguration sslConfig)
|
protected |
AMQConnection(String username,
String password,
String clientName,
String virtualHost)
|
|
AMQConnection(String broker,
String username,
String password,
String clientName,
String virtualHost)
|
|
AMQConnection(String broker,
String username,
String password,
String clientName,
String virtualHost,
SSLConfiguration sslConfig)
|
Method Summary | ||
---|---|---|
boolean |
attemptReconnection()
|
|
boolean |
attemptReconnection(String host,
int port)
|
|
void |
blockUntilNotFailingOver()
If failover is taking place this will block until it has completed. |
|
void |
bytesReceived(long receivedBytes)
|
|
void |
bytesSent(long writtenBytes)
|
|
boolean |
channelLimitReached()
|
|
protected boolean |
checkException(Throwable thrown)
|
|
void |
close()
Closes this object. |
|
void |
close(List<AMQSession> sessions,
long timeout)
|
|
void |
close(long timeout)
|
|
ConnectionConsumer |
createConnectionConsumer(Destination destination,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
|
|
ConnectionConsumer |
createConnectionConsumer(Queue queue,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
|
|
ConnectionConsumer |
createConnectionConsumer(Topic topic,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
|
|
ConnectionConsumer |
createDurableConnectionConsumer(Topic topic,
String subscriptionName,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
|
|
QueueSession |
createQueueSession(boolean transacted,
int acknowledgeMode)
Returns an AMQQueueSessionAdaptor which wraps an AMQSession and throws IllegalStateExceptions where specified in the JMS spec |
|
Session |
createSession(boolean transacted,
int acknowledgeMode)
|
|
Session |
createSession(boolean transacted,
int acknowledgeMode,
int prefetch)
Create a session specifying the prefetch limit of messages. |
|
Session |
createSession(boolean transacted,
int acknowledgeMode,
int prefetchHigh,
int prefetchLow)
Create a session specifying the prefetch limit of messages. |
|
TopicSession |
createTopicSession(boolean transacted,
int acknowledgeMode)
Returns an AMQTopicSessionAdapter which wraps an AMQSession and throws IllegalStateExceptions where specified in the JMS spec |
|
void |
deregisterSession(int channelId)
|
|
void |
exceptionReceived(Throwable cause)
Invoked by the AMQProtocolSession when a protocol session exception has occurred. |
|
|
executeRetrySupport(FailoverProtectedOperation<T,E> operation)
|
|
boolean |
failoverAllowed()
|
|
void |
failoverPrep()
|
|
void |
fireFailoverComplete()
Fires a failover complete event to the registered connection listener (if any). |
|
boolean |
firePreFailover(boolean redirect)
Fire the preFailover event to the registered connection listener (if any) |
|
boolean |
firePreResubscribe()
Fire the preResubscribe event to the registered connection listener (if any). |
|
BrokerDetails |
getActiveBrokerDetails()
Get the details of the currently active broker |
|
String |
getClientID()
|
|
ConnectionListener |
getConnectionListener()
Get the connection listener that has been registered with this connection, if any |
|
org.apache.qpid.framing.AMQShortString |
getDefaultQueueExchangeName()
|
|
org.apache.qpid.framing.AMQShortString |
getDefaultTopicExchangeName()
|
|
ExceptionListener |
getExceptionListener()
|
|
Object |
getFailoverMutex()
In order to protect the consistency of the connection and its child sessions, consumers and producers, the "failover mutex" must be held when doing any operations that could be corrupted during failover. |
|
FailoverPolicy |
getFailoverPolicy()
|
|
long |
getMaximumChannelCount()
|
|
long |
getMaximumFrameSize()
|
|
long |
getMaxPrefetch()
Get the maximum number of messages that this connection can pre-fetch. |
|
ConnectionMetaData |
getMetaData()
|
|
int |
getNextChannelID()
|
|
String |
getPassword()
|
|
AMQProtocolHandler |
getProtocolHandler()
|
|
org.apache.qpid.framing.ProtocolVersion |
getProtocolVersion()
|
|
Reference |
getReference()
|
|
AMQSession |
getSession(int channelId)
|
|
AMQConnection.ChannelToSessionMap |
getSessions()
|
|
SSLConfiguration |
getSSLConfiguration()
|
|
boolean |
getSyncAck()
Indicates whether we need to sync on every message ack |
|
boolean |
getSyncPersistence()
Indicates whether persistent messages are synchronized |
|
String |
getSyncPublish()
|
|
org.apache.qpid.framing.AMQShortString |
getTemporaryQueueExchangeName()
|
|
org.apache.qpid.framing.AMQShortString |
getTemporaryTopicExchangeName()
|
|
String |
getUsername()
|
|
String |
getVirtualHost()
|
|
boolean |
isFailingOver()
|
|
boolean |
isUseLegacyMapMessageFormat()
|
|
org.apache.qpid.framing.ProtocolVersion |
makeBrokerConnection(BrokerDetails brokerDetail)
|
|
void |
performConnectionTask(Runnable task)
|
|
(package private) void |
registerSession(int channelId,
AMQSession session)
|
|
void |
resubscribeSessions()
|
|
void |
setClientID(String clientID)
|
|
void |
setConnectionListener(ConnectionListener listener)
|
|
void |
setDefaultQueueExchangeName(org.apache.qpid.framing.AMQShortString defaultQueueExchangeName)
|
|
void |
setDefaultTopicExchangeName(org.apache.qpid.framing.AMQShortString defaultTopicExchangeName)
|
|
void |
setExceptionListener(ExceptionListener listener)
|
|
void |
setFailoverPolicy(FailoverPolicy policy)
|
|
void |
setMaximumChannelCount(long maximumChannelCount)
|
|
void |
setMaximumFrameSize(long frameMax)
|
|
void |
setTemporaryQueueExchangeName(org.apache.qpid.framing.AMQShortString temporaryQueueExchangeName)
|
|
void |
setTemporaryTopicExchangeName(org.apache.qpid.framing.AMQShortString temporaryTopicExchangeName)
|
|
void |
setUsername(String id)
|
|
void |
start()
Start the connection, i.e. |
|
boolean |
started()
|
|
void |
stop()
|
|
String |
toString()
|
|
String |
toURL()
|
Methods inherited from class org.apache.qpid.client.Closeable |
---|
checkNotClosed, isClosed, isClosing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected long _maximumChannelCount
protected AMQProtocolHandler _protocolHandler
protected ExceptionListener _exceptionListener
protected volatile boolean _started
protected FailoverPolicy _failoverPolicy
protected boolean _connected
protected AMQConnectionDelegate _delegate
Constructor Detail |
---|
public AMQConnection(String broker, String username, String password, String clientName, String virtualHost) throws org.apache.qpid.AMQException, org.apache.qpid.url.URLSyntaxException
broker
- brokerdetailsusername
- usernamepassword
- passwordclientName
- clientidvirtualHost
- virtualhost
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
public AMQConnection(String broker, String username, String password, String clientName, String virtualHost, SSLConfiguration sslConfig) throws org.apache.qpid.AMQException, org.apache.qpid.url.URLSyntaxException
broker
- brokerdetailsusername
- usernamepassword
- passwordclientName
- clientidvirtualHost
- virtualhost
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
public AMQConnection(String host, int port, String username, String password, String clientName, String virtualHost) throws org.apache.qpid.AMQException, org.apache.qpid.url.URLSyntaxException
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
public AMQConnection(String host, int port, String username, String password, String clientName, String virtualHost, SSLConfiguration sslConfig) throws org.apache.qpid.AMQException, org.apache.qpid.url.URLSyntaxException
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
public AMQConnection(String host, int port, boolean useSSL, String username, String password, String clientName, String virtualHost, SSLConfiguration sslConfig) throws org.apache.qpid.AMQException, org.apache.qpid.url.URLSyntaxException
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
public AMQConnection(String connection) throws org.apache.qpid.AMQException, org.apache.qpid.url.URLSyntaxException
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
public AMQConnection(String connection, SSLConfiguration sslConfig) throws org.apache.qpid.AMQException, org.apache.qpid.url.URLSyntaxException
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
public AMQConnection(ConnectionURL connectionURL, SSLConfiguration sslConfig) throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
protected AMQConnection(String username, String password, String clientName, String virtualHost)
Method Detail |
---|
protected boolean checkException(Throwable thrown)
public boolean attemptReconnection(String host, int port)
public boolean attemptReconnection()
public org.apache.qpid.framing.ProtocolVersion makeBrokerConnection(BrokerDetails brokerDetail) throws IOException, org.apache.qpid.AMQException
IOException
org.apache.qpid.AMQException
public <T,E extends Exception> T executeRetrySupport(FailoverProtectedOperation<T,E> operation) throws E extends Exception
E extends Exception
public BrokerDetails getActiveBrokerDetails()
public boolean failoverAllowed()
public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException
createSession
in interface Connection
JMSException
public Session createSession(boolean transacted, int acknowledgeMode, int prefetch) throws JMSException
Connection
prefetch
- the maximum number of messages to buffer in the client. This
applies as a total across all consumers
JMSException
public Session createSession(boolean transacted, int acknowledgeMode, int prefetchHigh, int prefetchLow) throws JMSException
Connection
prefetchHigh
- the maximum number of messages to buffer in the client.
This applies as a total across all consumersprefetchLow
- the number of messages that must be in the buffer in the client to renable message flow.
This applies as a total across all consumers
JMSException
public void setFailoverPolicy(FailoverPolicy policy)
public FailoverPolicy getFailoverPolicy()
public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException
createQueueSession
in interface QueueConnection
transacted
- acknowledgeMode
-
JMSException
public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException
createTopicSession
in interface TopicConnection
transacted
- acknowledgeMode
-
JMSException
public boolean channelLimitReached()
public String getClientID() throws JMSException
getClientID
in interface Connection
JMSException
public void setClientID(String clientID) throws JMSException
setClientID
in interface Connection
JMSException
public ConnectionMetaData getMetaData() throws JMSException
getMetaData
in interface Connection
JMSException
public ExceptionListener getExceptionListener() throws JMSException
getExceptionListener
in interface Connection
JMSException
public void setExceptionListener(ExceptionListener listener) throws JMSException
setExceptionListener
in interface Connection
JMSException
public void start() throws JMSException
start
in interface Connection
JMSException
public void stop() throws JMSException
stop
in interface Connection
JMSException
public void close() throws JMSException
Closeable
close
in interface Connection
close
in class Closeable
JMSException
- If this cannot be closed for any reason.public void close(long timeout) throws JMSException
JMSException
public void close(List<AMQSession> sessions, long timeout) throws JMSException
JMSException
public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
createConnectionConsumer
in interface Connection
JMSException
public ConnectionConsumer createConnectionConsumer(Queue queue, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
createConnectionConsumer
in interface QueueConnection
JMSException
public ConnectionConsumer createConnectionConsumer(Topic topic, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
createConnectionConsumer
in interface TopicConnection
JMSException
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
createDurableConnectionConsumer
in interface Connection
createDurableConnectionConsumer
in interface TopicConnection
JMSException
public long getMaximumChannelCount() throws JMSException
JMSException
public void setConnectionListener(ConnectionListener listener)
public ConnectionListener getConnectionListener()
Connection
public void setMaximumChannelCount(long maximumChannelCount)
public void setMaximumFrameSize(long frameMax)
public long getMaximumFrameSize()
public AMQConnection.ChannelToSessionMap getSessions()
public String getUsername()
public void setUsername(String id)
public String getPassword()
public String getVirtualHost()
public AMQProtocolHandler getProtocolHandler()
public boolean started()
public void bytesSent(long writtenBytes)
public void bytesReceived(long receivedBytes)
public boolean firePreFailover(boolean redirect)
redirect
- true if this is the result of a redirect request rather than a connection error
public boolean firePreResubscribe() throws JMSException
JMSException
public void fireFailoverComplete()
public final Object getFailoverMutex()
public void failoverPrep()
public void resubscribeSessions() throws JMSException, org.apache.qpid.AMQException, FailoverException
JMSException
org.apache.qpid.AMQException
FailoverException
public void blockUntilNotFailingOver() throws InterruptedException
InterruptedException
public void exceptionReceived(Throwable cause)
cause
- the exceptionvoid registerSession(int channelId, AMQSession session)
public void deregisterSession(int channelId)
public String toString()
toString
in class Object
public String toURL()
public Reference getReference() throws NamingException
getReference
in interface Referenceable
NamingException
public SSLConfiguration getSSLConfiguration()
public org.apache.qpid.framing.AMQShortString getDefaultTopicExchangeName()
public void setDefaultTopicExchangeName(org.apache.qpid.framing.AMQShortString defaultTopicExchangeName)
public org.apache.qpid.framing.AMQShortString getDefaultQueueExchangeName()
public void setDefaultQueueExchangeName(org.apache.qpid.framing.AMQShortString defaultQueueExchangeName)
public org.apache.qpid.framing.AMQShortString getTemporaryTopicExchangeName()
public org.apache.qpid.framing.AMQShortString getTemporaryQueueExchangeName()
public void setTemporaryTopicExchangeName(org.apache.qpid.framing.AMQShortString temporaryTopicExchangeName)
public void setTemporaryQueueExchangeName(org.apache.qpid.framing.AMQShortString temporaryQueueExchangeName)
public void performConnectionTask(Runnable task)
public AMQSession getSession(int channelId)
public org.apache.qpid.framing.ProtocolVersion getProtocolVersion()
public boolean isFailingOver()
public long getMaxPrefetch()
public boolean getSyncPersistence()
public boolean getSyncAck()
public String getSyncPublish()
public int getNextChannelID()
public boolean isUseLegacyMapMessageFormat()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |