|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.joram.mom.proxies.tcp.TcpProxyService
public class TcpProxyService
Starts a TCP entry point for MOM clients.
Field Summary | |
---|---|
private boolean |
activated
|
(package private) java.lang.String |
address
|
(package private) int |
backlog
|
static java.lang.String |
BACKLOG_PROP
Name the property that allow to fix the TCP BACKLOG property for the client's connections. |
private TcpConnectionListener[] |
connectionListeners
The thread listening to incoming TCP connections. |
private java.util.Vector |
connections
The list of opened connections |
static int |
DEFAULT_BACKLOG
Default value for the TCP BACKLOG property. |
static java.lang.String |
DEFAULT_BINDADDRESS
Default IP address for binding the listen socket. |
static int |
DEFAULT_POOL_SIZE
Default value for the pool size. |
static int |
DEFAULT_PORT
Default value for the TCP port of the listen socket. |
static int |
DEFAULT_SO_TIMEOUT
Default value for the TCP SO_TIMEOUT property. |
static org.objectweb.util.monolog.api.Logger |
logger
logger |
private static java.lang.String |
MBEAN_NAME
|
static java.lang.String |
POOL_SIZE_PROP
Name the property that allow to fix the pool size for the connection's listener. |
(package private) int |
port
|
private static TcpProxyService |
proxyService
The proxy service reference (used to stop it). |
private java.net.ServerSocket |
serverSocket
The server socket listening to connections from the JMS clients. |
static java.lang.String |
SO_TIMEOUT_PROP
Name the property that allow to fix the TCP SO_TIMEOUT property for the client's connections. |
Constructor Summary | |
---|---|
TcpProxyService(int port,
int backlog,
java.lang.String address)
|
Method Summary | |
---|---|
void |
activate()
Activates the connection manager. |
void |
closeAllConnections()
Closes all opened connections. |
protected java.net.ServerSocket |
createServerSocket(int port,
int backlog,
java.lang.String address)
Initialize the listening socket. |
void |
deactivate()
Deactivates the connection manager. |
(package private) TcpConnection |
getConnection(AgentId proxyId,
int key)
|
int |
getFailedLoginCount()
Gets the number of connections rejected due to a failed authentication. |
int |
getInitiatedConnectionCount()
Gets the number of initiated connections since server start. |
java.lang.String |
getMBeanName()
Gets the name of the MBean. |
int |
getProtocolErrorCount()
Gets the number of connections rejected due to a wrong protocol header. |
int |
getRunningConnectionsCount()
Gets the number of living connections. |
java.lang.String |
getServerAddress()
Gets the socket address of the server. |
(package private) java.net.ServerSocket |
getServerSocket()
Gets the listening socket. |
int |
getTcpListenersPoolSize()
Gets the number of threads listening for incoming tcp connections. |
static void |
init(java.lang.String args,
boolean firstTime)
Initializes the TCP entry point by creating a server socket listening to the specified port. |
boolean |
isActivated()
Tells if the ConnectionManager is active. |
(package private) void |
registerConnection(TcpConnection tcpConnection)
|
protected void |
resetServerSocket()
Closes the listening socket and sets the variable to null. |
protected void |
start()
|
private void |
stop()
|
static void |
stopService()
Stops the service. |
(package private) void |
unregisterConnection(TcpConnection tcpConnection)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static org.objectweb.util.monolog.api.Logger logger
public static final java.lang.String SO_TIMEOUT_PROP
public static final int DEFAULT_SO_TIMEOUT
public static final java.lang.String POOL_SIZE_PROP
public static final int DEFAULT_POOL_SIZE
public static final java.lang.String BACKLOG_PROP
public static final int DEFAULT_BACKLOG
public static final int DEFAULT_PORT
public static final java.lang.String DEFAULT_BINDADDRESS
private static final java.lang.String MBEAN_NAME
private static TcpProxyService proxyService
int port
int backlog
java.lang.String address
private java.net.ServerSocket serverSocket
private java.util.Vector connections
private TcpConnectionListener[] connectionListeners
private boolean activated
Constructor Detail |
---|
public TcpProxyService(int port, int backlog, java.lang.String address) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
java.net.ServerSocket getServerSocket()
protected void resetServerSocket()
protected java.net.ServerSocket createServerSocket(int port, int backlog, java.lang.String address) throws java.lang.Exception
port
- backlog
- address
-
java.lang.Exception
public static void init(java.lang.String args, boolean firstTime) throws java.lang.Exception
args
- stringified listening portfirstTime
- true
when the agent server starts.
java.lang.Exception
public static void stopService()
protected void start()
public java.lang.String getMBeanName()
ConnectionManagerMBean
getMBeanName
in interface ConnectionManagerMBean
void registerConnection(TcpConnection tcpConnection)
void unregisterConnection(TcpConnection tcpConnection)
TcpConnection getConnection(AgentId proxyId, int key)
private void stop()
public void activate()
ConnectionManagerMBean
activate
in interface ConnectionManagerMBean
public void closeAllConnections()
ConnectionManagerMBean
closeAllConnections
in interface ConnectionManagerMBean
public void deactivate()
ConnectionManagerMBean
deactivate
in interface ConnectionManagerMBean
public boolean isActivated()
ConnectionManagerMBean
isActivated
in interface ConnectionManagerMBean
public int getRunningConnectionsCount()
ConnectionManagerMBean
getRunningConnectionsCount
in interface ConnectionManagerMBean
public int getTcpListenersPoolSize()
TcpProxyServiceMBean
getTcpListenersPoolSize
in interface TcpProxyServiceMBean
public java.lang.String getServerAddress()
TcpProxyServiceMBean
getServerAddress
in interface TcpProxyServiceMBean
public int getFailedLoginCount()
ConnectionManagerMBean
getFailedLoginCount
in interface ConnectionManagerMBean
public int getInitiatedConnectionCount()
ConnectionManagerMBean
getInitiatedConnectionCount
in interface ConnectionManagerMBean
public int getProtocolErrorCount()
TcpProxyServiceMBean
getProtocolErrorCount
in interface TcpProxyServiceMBean
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |