public class ConnectionManager extends Object implements ConnectionManagerMBean
ConnectionManager
is started as a service in each
MOM agent server for allowing connections with external clients.Modifier and Type | Field and Description |
---|---|
private boolean |
activated
true if new connections are accepted. |
static String |
CTRLFLOW_THRESHOLD
Name of property allowing to define the threshold beyond which the flow-control
of incoming messages is activated.
|
static String |
CTRLFLOW_THROUGHPUT
Name of property allowing to define the average throughput of the server for the
calculation of flow control.
|
private static long |
ctrlFlowDelay
Definition of average delay for the implementation of flow control (it is computed
from the CTRLFLOW_THROUGHPUT parameter.
|
private static int |
ctrlFlowThreshold
Threshold beyond which the flow-control of incoming messages is activated.
|
private static ConnectionManager |
currentInstance
Unique ConnectionManager instance.
|
static String |
DIRECT_NOTIFICATION |
private static boolean |
directNotification |
static int |
inFlow
Limit of incoming messages flow (msgs/s) requested if any, default
value is -1 (no limitation).
|
static Logger |
logger
logger
|
private List |
managers
List of registered managers (tcp, ssl, local, ...)
|
private static String |
MBEAN_NAME |
static String |
MULTI_CNX_SYNC
Name of property allowing to activate the synchronization mode of multiples
connections.
|
static String |
MULTI_CNX_SYNC_DELAY
Name of property allowing to configure the synchronization mode of multiples
connections.
|
private static boolean |
multiCnxSync
True if the synchronization mode is activated.
|
private static Hashtable |
multiCnxSyncTable |
private static long |
multiThreadSyncDelay
Duration in ms of instant to pack the commands.
|
static String |
version |
Constructor and Description |
---|
ConnectionManager() |
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates the connection manager.
|
void |
addManager(ConnectionManagerMBean manager)
Registers a new manager.
|
boolean |
checkCredentials(String userName,
String password)
Checks the validity of the given name and password.
|
void |
closeAllConnections()
Closes all opened connections.
|
private static CountDownCallback |
createCallback(AbstractJmsRequest req,
ConnectionContext ctx) |
private static Identity |
createIdentity(String adminName,
String adminPassword,
String identityClassName)
Create an admin Identity.
|
void |
deactivate()
Deactivates the connection manager.
|
private static void |
flowControl() |
static ConnectionManager |
getCurrentInstance() |
int |
getFailedLoginCount()
Gets the number of connections rejected due to a failed authentication.
|
int |
getInitiatedConnectionCount()
Gets the number of initiated connections since server start.
|
String |
getMBeanName()
Gets the name of the MBean.
|
static MultiCnxSync |
getMultiCnxSync(AgentId proxyId) |
static long |
getMultiThreadSyncDelay() |
int |
getRunningConnectionsCount()
Gets the number of living connections.
|
String |
getVersion()
Gets the name of the MBean.
|
static void |
init(String args,
boolean firstTime)
Initializes the connection manager as a service.
|
boolean |
isActivated()
Tells if the ConnectionManager is active.
|
private void |
removeAllManagers() |
void |
removeManager(ConnectionManagerMBean manager)
Removes a registered manager.
|
static void |
sendToProxy(AgentId proxyId,
int cnxKey,
AbstractJmsRequest req,
Object msg,
ConnectionContext ctx) |
static void |
setActivate(boolean activate)
Activates/deactivates the connection manager.
|
static void |
stopService()
Stops the
ConnectionManager service. |
public static Logger logger
public static final String MULTI_CNX_SYNC
This mode allows to pack commands that occurs in a same time in order to minimize the number of transactions.
This property can be fixed either from java
launching command or
a3servers.xml configuration file.
private static boolean multiCnxSync
public static final String MULTI_CNX_SYNC_DELAY
This property allows to define the duration of instant to pack the commands.
This property can be fixed either from java
launching command or
a3servers.xml configuration file.
private static long multiThreadSyncDelay
public static final String CTRLFLOW_THRESHOLD
This property can be fixed either from java
launching command or
a3servers.xml configuration file.
private static int ctrlFlowThreshold
public static final String CTRLFLOW_THROUGHPUT
This property can be fixed either from java
launching command or
a3servers.xml configuration file.
private static long ctrlFlowDelay
public static final String DIRECT_NOTIFICATION
private static boolean directNotification
private static final String MBEAN_NAME
private boolean activated
true
if new connections are accepted.private List managers
private static ConnectionManager currentInstance
private static Hashtable multiCnxSyncTable
public static int inFlow
java
launching command, or in a3servers.xml
configuration file.public static final String version
private static CountDownCallback createCallback(AbstractJmsRequest req, ConnectionContext ctx)
private static void flowControl()
public static final void sendToProxy(AgentId proxyId, int cnxKey, AbstractJmsRequest req, Object msg, ConnectionContext ctx)
public static final long getMultiThreadSyncDelay()
public static MultiCnxSync getMultiCnxSync(AgentId proxyId)
public String getVersion()
ConnectionManagerMBean
getVersion
in interface ConnectionManagerMBean
public static void init(String args, boolean firstTime) throws Exception
args
- name and password of the administrator (optional).firstTime
- true
when the agent server starts.Exception
- Thrown when processing the String argument
or in case of a problem when deploying the ConnectionFactory.private static Identity createIdentity(String adminName, String adminPassword, String identityClassName) throws Exception
adminName
- Name of the admin.adminPassword
- Password of the admin.identityClassName
- identity class name.Exception
public static void stopService()
ConnectionManager
service.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 int getRunningConnectionsCount()
ConnectionManagerMBean
getRunningConnectionsCount
in interface ConnectionManagerMBean
public boolean isActivated()
ConnectionManagerMBean
isActivated
in interface ConnectionManagerMBean
public static ConnectionManager getCurrentInstance()
public void addManager(ConnectionManagerMBean manager)
public void removeManager(ConnectionManagerMBean manager)
private void removeAllManagers()
public String getMBeanName()
ConnectionManagerMBean
getMBeanName
in interface ConnectionManagerMBean
public int getFailedLoginCount()
ConnectionManagerMBean
getFailedLoginCount
in interface ConnectionManagerMBean
public int getInitiatedConnectionCount()
ConnectionManagerMBean
getInitiatedConnectionCount
in interface ConnectionManagerMBean
public boolean checkCredentials(String userName, String password)
userName
- the name of the userpassword
- the password of the usertrue
if the name and password match an existing user.public static void setActivate(boolean activate)
activate
- true, activates the connection manager.Copyright © 2022 ScalAgent D.T.. All rights reserved.