Skip to content

Commit

Permalink
Enabling additional configuration parameters for "Attaching a Jolokia…
Browse files Browse the repository at this point in the history
… agent on the fly" related to HTTPS: secureSocketProtocol, keyStoreType, keyManagerAlgorithm, trustManagerAlgorithm

Default values:
secureSocketProtocol=TLS
keyStoreType=JKS
keyManagerAlgorithm=SunX509
trustManagerAlgorithm=SunX509
  • Loading branch information
nevenr committed Oct 20, 2014
1 parent 8a2c787 commit b09f4b6
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 48 deletions.
Expand Up @@ -65,41 +65,45 @@ static void printUsage() {
"\n" +
"[options] are used for providing runtime information for attaching the agent:\n" +
"\n" +
" --host <host> Hostname or IP address to which to bind on\n" +
" (default: InetAddress.getLocalHost())\n" +
" --port <port> Port to listen on (default: 8778)\n" +
" --agentContext <context> HTTP Context under which the agent is reachable (default: " + ConfigKey.AGENT_CONTEXT.getDefaultValue() + ")\n" +
" --agentId <agent-id> VM unique identifier used by this agent (default: autogenerated)\n" +
" --agentDescription <desc> Agent description\n" +
" --user <user> User used for Basic-Authentication\n" +
" --password <password> Password used for Basic-Authentication\n" +
" --quiet No output. \"status\" will exit with code 0 if the agent is running, 1 otherwise\n" +
" --verbose Verbose output\n" +
" --executor <executor> Executor policy for HTTP Threads to use (default: single)\n" +
" \"fixed\" -- Thread pool with a fixed number of threads (default: 5)\n" +
" \"cached\" -- Cached Thread Pool, creates threads on demand\n" +
" \"single\" -- Single Thread\n" +
" --threadNr <nr threads> Number of fixed threads if \"fixed\" is used as executor\n" +
" --backlog <backlog> How many request to keep in the backlog (default: 10)\n" +
" --protocol <http|https> Protocol which must be either \"http\" or \"https\" (default: http)\n" +
" --keystore <keystore> Path to keystore (https only)\n" +
" --keystorePassword <pwd> Password to the keystore (https only)\n" +
" --useSslClientAuthentication Use client certificate authentication (https only)\n" +
" --discoveryEnabled <t|f> Enable/Disable discovery multicast responses (default: true)\n" +
" --discoveryAgentUrl <url> The URL to use for answering discovery requests. Will be autodetected if not given.\n" +
" --debug Switch on agent debugging\n" +
" --debugMaxEntries <nr> Number of debug entries to keep in memory which can be fetched from the Jolokia MBean\n" +
" --maxDepth <depth> Maximum number of levels for serialization of beans (default: " + ConfigKey.MAX_DEPTH.getDefaultValue() + ")\n" +
" --maxCollectionSize <size> Maximum number of element in collections to keep when serializing the response (default: " + ConfigKey.MAX_COLLECTION_SIZE.getDefaultValue() + ")\n" +
" --maxObjects <nr> Maximum number of objects to consider for serialization (default: " + ConfigKey.MAX_OBJECTS + ")\n" +
" --policyLocation <url> Location of a Jolokia policy file\n" +
" --mbeanQualifier <qualifier> Qualifier to use when registering Jolokia internal MBeans\n" +
" --canonicalNaming <t|f> whether to use canonicalName for ObjectNames in 'list' or 'search' (default: true)\n" +
" --includeStackTrace <t|f> whether to include StackTraces for error messages (default: true)\n" +
" --serializeException <t|f> whether to add a serialized version of the exception in the Jolokia response (default: false)\n" +
" --config <configfile> Path to a property file from where to read the configuration\n" +
" --help This help documentation\n" +
" --version Version of this agent (it's " + Version.getAgentVersion() + " btw :)\n" +
" --host <host> Hostname or IP address to which to bind on\n" +
" (default: InetAddress.getLocalHost())\n" +
" --port <port> Port to listen on (default: 8778)\n" +
" --agentContext <context> HTTP Context under which the agent is reachable (default: " + ConfigKey.AGENT_CONTEXT.getDefaultValue() + ")\n" +
" --agentId <agent-id> VM unique identifier used by this agent (default: autogenerated)\n" +
" --agentDescription <desc> Agent description\n" +
" --user <user> User used for Basic-Authentication\n" +
" --password <password> Password used for Basic-Authentication\n" +
" --quiet No output. \"status\" will exit with code 0 if the agent is running, 1 otherwise\n" +
" --verbose Verbose output\n" +
" --executor <executor> Executor policy for HTTP Threads to use (default: single)\n" +
" \"fixed\" -- Thread pool with a fixed number of threads (default: 5)\n" +
" \"cached\" -- Cached Thread Pool, creates threads on demand\n" +
" \"single\" -- Single Thread\n" +
" --threadNr <nr threads> Number of fixed threads if \"fixed\" is used as executor\n" +
" --backlog <backlog> How many request to keep in the backlog (default: 10)\n" +
" --protocol <http|https> Protocol which must be either \"http\" or \"https\" (default: http)\n" +
" --keystore <keystore> Path to keystore (https only)\n" +
" --keystorePassword <pwd> Password to the keystore (https only)\n" +
" --useSslClientAuthentication Use client certificate authentication (https only)\n" +
" --secureSocketProtocol <name> Secure protocol (https only, default: TLS)\n" +
" --keyStoreType <name> Keystore type (https only, default: JKS)\n" +
" --keyManagerAlgorithm <name> Key manager algorithm (https only, default: SunX509)\n" +
" --trustManagerAlgorithm <name> Trust manager algorithm (https only, default: SunX509)\n" +
" --discoveryEnabled <t|f> Enable/Disable discovery multicast responses (default: true)\n" +
" --discoveryAgentUrl <url> The URL to use for answering discovery requests. Will be autodetected if not given.\n" +
" --debug Switch on agent debugging\n" +
" --debugMaxEntries <nr> Number of debug entries to keep in memory which can be fetched from the Jolokia MBean\n" +
" --maxDepth <depth> Maximum number of levels for serialization of beans (default: " + ConfigKey.MAX_DEPTH.getDefaultValue() + ")\n" +
" --maxCollectionSize <size> Maximum number of element in collections to keep when serializing the response (default: " + ConfigKey.MAX_COLLECTION_SIZE.getDefaultValue() + ")\n" +
" --maxObjects <nr> Maximum number of objects to consider for serialization (default: " + ConfigKey.MAX_OBJECTS + ")\n" +
" --policyLocation <url> Location of a Jolokia policy file\n" +
" --mbeanQualifier <qualifier> Qualifier to use when registering Jolokia internal MBeans\n" +
" --canonicalNaming <t|f> whether to use canonicalName for ObjectNames in 'list' or 'search' (default: true)\n" +
" --includeStackTrace <t|f> whether to include StackTraces for error messages (default: true)\n" +
" --serializeException <t|f> whether to add a serialized version of the exception in the Jolokia response (default: false)\n" +
" --config <configfile> Path to a property file from where to read the configuration\n" +
" --help This help documentation\n" +
" --version Version of this agent (it's " + Version.getAgentVersion() + " btw :)\n" +
"\n" +
"<pid/regexp> can be either a numeric process id or a regular expression. A regular expression is matched\n" +
"against the processes' names (ignoring case) and must be specific enough to select exactly one process.\n" +
Expand Down
Expand Up @@ -36,19 +36,21 @@ public final class OptionsAndArgs {

private static final Map<String,String> SHORT_OPTS = new HashMap<String, String>();
private static final Set<String> OPTIONS = new HashSet<String>(Arrays.asList(
// JVM Agent options:
"host", "port", "agentContext", "user", "password",
"quiet!", "verbose!", "version!", "executor", "threadNr",
"backlog", "protocol", "keystore", "keystorePassword",
"useSslClientAuthentication!","hide!",
// Jolokia options:
"historyMaxEntries","debug!","debugMaxEntries",
"dispatcherClasses", "maxDepth", "maxCollectionSize",
"maxObjects", "policyLocation", "mbeanQualifier",
"canonicalNaming","includeStackTrace","serializeException",
"discoveryEnabled","discoveryAgentUrl","agentId","agentDescription",
// Others:
"config", "help!"));
// JVM Agent options:
"host", "port", "agentContext", "user", "password",
"quiet!", "verbose!", "version!", "executor", "threadNr",
"backlog", "hide!", "protocol",
//https options:
"keystore", "keystorePassword", "useSslClientAuthentication!",
"secureSocketProtocol", "keyStoreType", "keyManagerAlgorithm", "trustManagerAlgorithm",
// Jolokia options:
"historyMaxEntries", "debug!", "debugMaxEntries",
"dispatcherClasses", "maxDepth", "maxCollectionSize",
"maxObjects", "policyLocation", "mbeanQualifier",
"canonicalNaming", "includeStackTrace", "serializeException",
"discoveryEnabled", "discoveryAgentUrl", "agentId", "agentDescription",
// Others:
"config", "help!"));

static {
String shortOptsDef[] = {
Expand Down

0 comments on commit b09f4b6

Please sign in to comment.