Package org.ow2.joram.mom.amqp
Class AMQPService
- java.lang.Object
-
- org.ow2.joram.mom.amqp.AMQPService
-
public class AMQPService extends Object
AMQP service used to open the server socket and start the connection listeners.
-
-
Field Summary
Fields Modifier and Type Field Description private static Stringaddressprotected static AMQPServiceamqpServiceThe proxy reference (used to stop it).static StringBACKLOG_PROPName of the property that allow to fix the TCP BACKLOG property for the client's connections.static Vector<AMQPConnectionListener>connectionListenersThe thread listening to incoming TCP connections.static intDEFAULT_BACKLOGDefault value for the TCP BACKLOG property.static StringDEFAULT_BINDADDRESSstatic intDEFAULT_HEARTBEATDefault value in seconds for the server heartbeat property.static intDEFAULT_PORTDefault value for the TCP port of the listen socket.static intheartbeatstatic StringHEARTBEAT_PROPName of the property that allows to set the server requested heartbeat.private static Loggerloggerstatic Namingnamingprivate static intportprivate static ServerSocketserverSocketThe listening server socket
-
Constructor Summary
Constructors Constructor Description AMQPService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcreateConnectionListener()static StringgetListenAddress()static intgetListenPort()static voidinit(String args, boolean firstTime)Initializes the TCP entry point by creating a server socket listening to the specified port.private static voidloads()static voidremoveConnectionListener(AMQPConnectionListener cnxListener)protected voidstart()private voidstop()static voidstopService()Stops the service.
-
-
-
Field Detail
-
logger
private static final Logger logger
-
naming
public static Naming naming
-
DEFAULT_HEARTBEAT
public static final int DEFAULT_HEARTBEAT
Default value in seconds for the server heartbeat property.- See Also:
- Constant Field Values
-
HEARTBEAT_PROP
public static final String HEARTBEAT_PROP
Name of the property that allows to set the server requested heartbeat. Socket timeout (SO_TIMEOUT) property will be 2 times the desired heartbeat.- See Also:
- Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
Default value for the TCP port of the listen socket.- See Also:
- Constant Field Values
-
DEFAULT_BINDADDRESS
public static final String DEFAULT_BINDADDRESS
- See Also:
- Constant Field Values
-
DEFAULT_BACKLOG
public static final int DEFAULT_BACKLOG
Default value for the TCP BACKLOG property.- See Also:
- Constant Field Values
-
BACKLOG_PROP
public static final String BACKLOG_PROP
Name of the property that allow to fix the TCP BACKLOG property for the client's connections.- See Also:
- Constant Field Values
-
heartbeat
public static int heartbeat
-
amqpService
protected static AMQPService amqpService
The proxy reference (used to stop it).
-
port
private static int port
-
address
private static String address
-
serverSocket
private static ServerSocket serverSocket
The listening server socket
-
connectionListeners
public static Vector<AMQPConnectionListener> connectionListeners
The thread listening to incoming TCP connections.
-
-
Constructor Detail
-
AMQPService
public AMQPService() throws IOException- Throws:
IOExceptionException
-
-
Method Detail
-
getListenPort
public static final int getListenPort()
-
getListenAddress
public static final String getListenAddress()
-
init
public static void init(String args, boolean firstTime) throws Exception
Initializes the TCP entry point by creating a server socket listening to the specified port.- Parameters:
args- stringified listening portfirstTime-truewhen the agent server starts.- Throws:
Exception
-
loads
private static void loads() throws TransactionException, IOException, ClassNotFoundException
-
stopService
public static void stopService()
Stops the service.
-
start
protected void start()
-
stop
private void stop()
-
createConnectionListener
public static void createConnectionListener() throws IOException- Throws:
IOException
-
removeConnectionListener
public static void removeConnectionListener(AMQPConnectionListener cnxListener)
-
-