org.objectweb.joram.mom.dest.amqp
Class LiveServerConnection

java.lang.Object
  extended by org.objectweb.joram.mom.dest.amqp.LiveServerConnection
All Implemented Interfaces:
LiveServerConnectionMBean

public class LiveServerConnection
extends java.lang.Object
implements LiveServerConnectionMBean

A LiveServerConnection keeps alive a connection to an AMQP server. When the connection fails, a reconnection routine starts.


Constructor Summary
LiveServerConnection()
          Starts a connection with a default AMQP server.
LiveServerConnection(com.rabbitmq.client.ConnectionFactory factory)
          Starts a connection with a server accessible via the factory provided.
 
Method Summary
 boolean equals(java.lang.Object obj)
          2 LiveServerConnection are equals if they have the same address and port, their connection state doesn't matter.
 com.rabbitmq.client.Connection getConnection()
           
 com.rabbitmq.client.ConnectionFactory getConnectionFactory()
           
 java.lang.String getHost()
           
 int getPort()
           
 java.lang.String getState()
           
 java.lang.String getUserName()
           
 int hashCode()
           
 boolean isConnectionOpen()
           
 void stopLiveConnection()
          Stops maintaining the connection alive with the server.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LiveServerConnection

public LiveServerConnection()
Starts a connection with a default AMQP server.


LiveServerConnection

public LiveServerConnection(com.rabbitmq.client.ConnectionFactory factory)
Starts a connection with a server accessible via the factory provided.

Parameters:
factory - the factory used to access the server.
Method Detail

isConnectionOpen

public boolean isConnectionOpen()

getConnection

public com.rabbitmq.client.Connection getConnection()

getConnectionFactory

public com.rabbitmq.client.ConnectionFactory getConnectionFactory()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
2 LiveServerConnection are equals if they have the same address and port, their connection state doesn't matter.

Overrides:
equals in class java.lang.Object

stopLiveConnection

public void stopLiveConnection()
Stops maintaining the connection alive with the server.


getHost

public java.lang.String getHost()
Specified by:
getHost in interface LiveServerConnectionMBean

getPort

public int getPort()
Specified by:
getPort in interface LiveServerConnectionMBean

getUserName

public java.lang.String getUserName()
Specified by:
getUserName in interface LiveServerConnectionMBean

getState

public java.lang.String getState()
Specified by:
getState in interface LiveServerConnectionMBean


Copyright © 2011 ScalAgent D.T.. All Rights Reserved.