public class EnvHelp extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BUFFER_SIZE_PROPERTY
Name of the attribute that specifies the size of a notification
buffer for a connector server.
|
static String |
CLIENT_CONNECTION_CHECK_PERIOD
Name of the attribute that specifies the period in
millisecond for a client to check its connection.
|
static String |
DEFAULT_HIDDEN_ATTRIBUTES
Default list of attributes not to show.
|
static String |
DEFAULT_ORB |
static String |
FETCH_TIMEOUT
Name of the attribute that specifies the timeout for a
client to fetch notifications from its server.
|
static String |
HIDDEN_ATTRIBUTES
The value of this attribute, if present, is a string specifying
what other attributes should not appear in
JMXConnectorServer.getAttributes().
|
static String |
MAX_FETCH_NOTIFS
Name of the attribute that specifies the maximum number of
notifications that a client will fetch from its server..
|
static String |
SERVER_CONNECTION_TIMEOUT
Name of the attribute that specifies the timeout to keep a
server side connection after answering last client request.
|
| Constructor and Description |
|---|
EnvHelp() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkAttributes(Map attributes) |
static Map |
filterAttributes(Map attributes) |
static Throwable |
getCause(Throwable t)
Returns the cause field of a Throwable object.
|
static long |
getConnectionCheckPeriod(Map env)
Returns the client connection check oeriod.
|
static long |
getFetchTimeout(Map env)
Returns the timeout for a client to fetch notifications.
|
static long |
getIntegerAttribute(Map env,
String name,
long defaultValue,
long minValue,
long maxValue)
Get an integer-valued attribute with name
name
from env. |
static int |
getMaxFetchNotifNumber(Map env)
Returns the maximum notification number which a client will
fetch every time.
|
static int |
getNotifBufferSize(Map env)
Returns the size of a notification buffer for a connector server.
|
static long |
getServerConnectionTimeout(Map env)
Returns the server side connection timeout.
|
static Throwable |
initCause(Throwable t,
Throwable cause)
Init the cause field of a Throwable object.
|
static Hashtable |
mapToHashtable(Map map)
Converts a map into a valid hash table, i.e.
|
static ClassLoader |
resolveClientClassLoader(Map env)
Get the Connector Client default class loader.
|
static ClassLoader |
resolveServerClassLoader(Map env,
MBeanServer mbs)
Get the Connector Server default class loader.
|
public static final String BUFFER_SIZE_PROPERTY
Name of the attribute that specifies the size of a notification buffer for a connector server. The default value is 1000.
public static final String MAX_FETCH_NOTIFS
Name of the attribute that specifies the maximum number of
notifications that a client will fetch from its server.. The
value associated with this attribute should be an
Integer object. The default value is 1000.
public static final String FETCH_TIMEOUT
Name of the attribute that specifies the timeout for a
client to fetch notifications from its server. The value
associated with this attribute should be a Long
object. The default value is 60000 milleseconds.
public static final String DEFAULT_ORB
public static final String HIDDEN_ATTRIBUTES
DEFAULT_HIDDEN_ATTRIBUTES (which
uses the same format). If the value of this attribute begins
with an "=", then the remainder of the string defines the
complete list of attribute patterns.public static final String DEFAULT_HIDDEN_ATTRIBUTES
HIDDEN_ATTRIBUTES,
Constant Field Valuespublic static final String SERVER_CONNECTION_TIMEOUT
Name of the attribute that specifies the timeout to keep a server side connection after answering last client request. The default value is 120000 milliseconds.
public static final String CLIENT_CONNECTION_CHECK_PERIOD
Name of the attribute that specifies the period in millisecond for a client to check its connection. The default value is 60000 milliseconds.
public static ClassLoader resolveServerClassLoader(Map env, MBeanServer mbs) throws InstanceNotFoundException
Returns:
env - Environment attributes.mbs - The MBeanServer for which the connector server provides
remote access.IllegalArgumentException - if one of the following is true:
ClassLoader,
ObjectName,
InstanceNotFoundException - if
jmx.remote.default.class.loader.name is specified
and the ClassLoader MBean is not found in mbs.public static ClassLoader resolveClientClassLoader(Map env)
Returns:
Usually a Connector Client will call
ClassLoader dcl = EnvHelp.resolveClientClassLoader(env);in its connect(Map env) method.
IllegalArgumentException - if
jmx.remote.default.class.loader is specified
and is not an instance of ClassLoader.public static Throwable initCause(Throwable t, Throwable cause)
Throwable.initCause(Throwable) method (JDK Version >= 1.4)t - Throwable on which the cause must be set.cause - The cause to set on t.public static Throwable getCause(Throwable t)
Throwable.getCause() method (JDK Version >= 1.4)t - Throwable on which the cause must be set.public static int getNotifBufferSize(Map env)
public static int getMaxFetchNotifNumber(Map env)
public static long getFetchTimeout(Map env)
public static long getIntegerAttribute(Map env, String name, long defaultValue, long minValue, long maxValue)
name
from env. If env is null, or does
not contain an entry for name, return
defaultValue. The value may be a Number, or it
may be a String that is parsable as a long. It must be at
least minValue and at mostmaxValue.IllegalArgumentException - if env contains
an entry for name but it does not meet the
constraints above.public static void checkAttributes(Map attributes)
public static long getServerConnectionTimeout(Map env)
public static long getConnectionCheckPeriod(Map env)
Copyright © 2019 Terracotta, Inc.. All rights reserved.