id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
120,100 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/request/JmxReadRequest.java | JmxReadRequest.getAttributeName | public String getAttributeName() {
if (attributeNames == null) {
return null;
}
if (isMultiAttributeMode()) {
throw new IllegalStateException("Request contains more than one attribute (attrs = " +
"" + attributeNames + "). Use ge... | java | public String getAttributeName() {
if (attributeNames == null) {
return null;
}
if (isMultiAttributeMode()) {
throw new IllegalStateException("Request contains more than one attribute (attrs = " +
"" + attributeNames + "). Use ge... | [
"public",
"String",
"getAttributeName",
"(",
")",
"{",
"if",
"(",
"attributeNames",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"isMultiAttributeMode",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Request contains mor... | Get a single attribute name. If this request was initialized with more than one attribute this
methods throws an exception.
@return the attribute's name or null
@throws IllegalStateException if this request was initialized with more than one attribute. | [
"Get",
"a",
"single",
"attribute",
"name",
".",
"If",
"this",
"request",
"was",
"initialized",
"with",
"more",
"than",
"one",
"attribute",
"this",
"methods",
"throws",
"an",
"exception",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxReadRequest.java#L78-L87 |
120,101 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/request/JmxReadRequest.java | JmxReadRequest.initAttribute | private void initAttribute(Object pAttrval) {
if (pAttrval instanceof String) {
attributeNames = EscapeUtil.split((String) pAttrval,EscapeUtil.CSV_ESCAPE,",");
multiAttributeMode = attributeNames.size() > 1;
} else if (pAttrval instanceof Collection) {
Collection<Stri... | java | private void initAttribute(Object pAttrval) {
if (pAttrval instanceof String) {
attributeNames = EscapeUtil.split((String) pAttrval,EscapeUtil.CSV_ESCAPE,",");
multiAttributeMode = attributeNames.size() > 1;
} else if (pAttrval instanceof Collection) {
Collection<Stri... | [
"private",
"void",
"initAttribute",
"(",
"Object",
"pAttrval",
")",
"{",
"if",
"(",
"pAttrval",
"instanceof",
"String",
")",
"{",
"attributeNames",
"=",
"EscapeUtil",
".",
"split",
"(",
"(",
"String",
")",
"pAttrval",
",",
"EscapeUtil",
".",
"CSV_ESCAPE",
",... | initialize and detect multi attribute mode | [
"initialize",
"and",
"detect",
"multi",
"attribute",
"mode"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxReadRequest.java#L187-L206 |
120,102 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/EscapeUtil.java | EscapeUtil.combineToPath | public static String combineToPath(List<String> pParts) {
if (pParts != null && pParts.size() > 0) {
StringBuilder buf = new StringBuilder();
Iterator<String> it = pParts.iterator();
while (it.hasNext()) {
String part = it.next();
buf.append(es... | java | public static String combineToPath(List<String> pParts) {
if (pParts != null && pParts.size() > 0) {
StringBuilder buf = new StringBuilder();
Iterator<String> it = pParts.iterator();
while (it.hasNext()) {
String part = it.next();
buf.append(es... | [
"public",
"static",
"String",
"combineToPath",
"(",
"List",
"<",
"String",
">",
"pParts",
")",
"{",
"if",
"(",
"pParts",
"!=",
"null",
"&&",
"pParts",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
... | Combine a list of strings to a single path with proper escaping.
@param pParts parts to combine
@return the combined path | [
"Combine",
"a",
"list",
"of",
"strings",
"to",
"a",
"single",
"path",
"with",
"proper",
"escaping",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/EscapeUtil.java#L65-L80 |
120,103 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/EscapeUtil.java | EscapeUtil.parsePath | public static List<String> parsePath(String pPath) {
// Special cases which simply implies 'no path'
if (pPath == null || pPath.equals("") || pPath.equals("/")) {
return null;
}
return replaceWildcardsWithNull(split(pPath, PATH_ESCAPE, "/"));
} | java | public static List<String> parsePath(String pPath) {
// Special cases which simply implies 'no path'
if (pPath == null || pPath.equals("") || pPath.equals("/")) {
return null;
}
return replaceWildcardsWithNull(split(pPath, PATH_ESCAPE, "/"));
} | [
"public",
"static",
"List",
"<",
"String",
">",
"parsePath",
"(",
"String",
"pPath",
")",
"{",
"// Special cases which simply implies 'no path'",
"if",
"(",
"pPath",
"==",
"null",
"||",
"pPath",
".",
"equals",
"(",
"\"\"",
")",
"||",
"pPath",
".",
"equals",
... | Parse a string path and return a list of split up parts.
@param pPath the path to parse. Can be null
@return list of path elements or null if the initial path is null. | [
"Parse",
"a",
"string",
"path",
"and",
"return",
"a",
"list",
"of",
"split",
"up",
"parts",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/EscapeUtil.java#L88-L94 |
120,104 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/EscapeUtil.java | EscapeUtil.reversePath | public static Stack<String> reversePath(List<String> pathParts) {
Stack<String> pathStack = new Stack<String>();
if (pathParts != null) {
// Needs first extra argument at top of the stack
for (int i = pathParts.size() - 1;i >=0;i--) {
pathStack.push(pathParts.get(... | java | public static Stack<String> reversePath(List<String> pathParts) {
Stack<String> pathStack = new Stack<String>();
if (pathParts != null) {
// Needs first extra argument at top of the stack
for (int i = pathParts.size() - 1;i >=0;i--) {
pathStack.push(pathParts.get(... | [
"public",
"static",
"Stack",
"<",
"String",
">",
"reversePath",
"(",
"List",
"<",
"String",
">",
"pathParts",
")",
"{",
"Stack",
"<",
"String",
">",
"pathStack",
"=",
"new",
"Stack",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"pathParts",
"!=",
"n... | Reverse path and return as a stack. First path element is on top
of the stack.
@param pathParts path to reverse
@return reversed path or an empty stack if no path parts are given. Never return null. | [
"Reverse",
"path",
"and",
"return",
"as",
"a",
"stack",
".",
"First",
"path",
"element",
"is",
"on",
"top",
"of",
"the",
"stack",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/EscapeUtil.java#L113-L122 |
120,105 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/EscapeUtil.java | EscapeUtil.escape | public static String escape(String pArg, String pEscape, String pDelimiter) {
return pArg.replaceAll(pEscape, pEscape + pEscape).replaceAll(pDelimiter, pEscape + pDelimiter);
} | java | public static String escape(String pArg, String pEscape, String pDelimiter) {
return pArg.replaceAll(pEscape, pEscape + pEscape).replaceAll(pDelimiter, pEscape + pDelimiter);
} | [
"public",
"static",
"String",
"escape",
"(",
"String",
"pArg",
",",
"String",
"pEscape",
",",
"String",
"pDelimiter",
")",
"{",
"return",
"pArg",
".",
"replaceAll",
"(",
"pEscape",
",",
"pEscape",
"+",
"pEscape",
")",
".",
"replaceAll",
"(",
"pDelimiter",
... | Escape the delimiter in an argument with the given escape char.
@param pArg string to add escapes to
@param pEscape the escape character (e.g. '\')
@param pDelimiter the delimiter to escape (e.g. ',')
@return the escaped char | [
"Escape",
"the",
"delimiter",
"in",
"an",
"argument",
"with",
"the",
"given",
"escape",
"char",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/EscapeUtil.java#L191-L193 |
120,106 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/EscapeUtil.java | EscapeUtil.createSplitPatterns | private static Pattern[] createSplitPatterns(String pEscape, String pDel) {
return new Pattern[] {
// Escape ($1: Everything before the delimiter, $2: Trailing escaped values (optional)
Pattern.compile("(.*?)" + // Any chars
"(?:" +
... | java | private static Pattern[] createSplitPatterns(String pEscape, String pDel) {
return new Pattern[] {
// Escape ($1: Everything before the delimiter, $2: Trailing escaped values (optional)
Pattern.compile("(.*?)" + // Any chars
"(?:" +
... | [
"private",
"static",
"Pattern",
"[",
"]",
"createSplitPatterns",
"(",
"String",
"pEscape",
",",
"String",
"pDel",
")",
"{",
"return",
"new",
"Pattern",
"[",
"]",
"{",
"// Escape ($1: Everything before the delimiter, $2: Trailing escaped values (optional)",
"Pattern",
".",... | Create a split pattern for a given delimiter | [
"Create",
"a",
"split",
"pattern",
"for",
"a",
"given",
"delimiter"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/EscapeUtil.java#L198-L213 |
120,107 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/AgentLauncher.java | AgentLauncher.main | @SuppressWarnings("PMD.ExceptionAsFlowControl")
public static void main(String... args) {
OptionsAndArgs options;
try {
options = new OptionsAndArgs(CommandDispatcher.getAvailableCommands(),args);
VirtualMachineHandler vmHandler = new VirtualMachineHandler(options);
... | java | @SuppressWarnings("PMD.ExceptionAsFlowControl")
public static void main(String... args) {
OptionsAndArgs options;
try {
options = new OptionsAndArgs(CommandDispatcher.getAvailableCommands(),args);
VirtualMachineHandler vmHandler = new VirtualMachineHandler(options);
... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.ExceptionAsFlowControl\"",
")",
"public",
"static",
"void",
"main",
"(",
"String",
"...",
"args",
")",
"{",
"OptionsAndArgs",
"options",
";",
"try",
"{",
"options",
"=",
"new",
"OptionsAndArgs",
"(",
"CommandDispatcher",
".",
... | We use processing exception thrown here for better error reporting, not flow control. | [
"We",
"use",
"processing",
"exception",
"thrown",
"here",
"for",
"better",
"error",
"reporting",
"not",
"flow",
"control",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/AgentLauncher.java#L48-L84 |
120,108 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java | StringToObjectConverter.prepareValue | public Object prepareValue(String pExpectedClassName, Object pValue) {
if (pValue == null) {
return null;
} else {
Class expectedClass = ClassUtil.classForName(pExpectedClassName);
Object param = null;
if (expectedClass != null) {
param = p... | java | public Object prepareValue(String pExpectedClassName, Object pValue) {
if (pValue == null) {
return null;
} else {
Class expectedClass = ClassUtil.classForName(pExpectedClassName);
Object param = null;
if (expectedClass != null) {
param = p... | [
"public",
"Object",
"prepareValue",
"(",
"String",
"pExpectedClassName",
",",
"Object",
"pValue",
")",
"{",
"if",
"(",
"pValue",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"Class",
"expectedClass",
"=",
"ClassUtil",
".",
"classForName",... | Prepare a value from a either a given object or its string representation.
If the value is already assignable to the given class name it is returned directly.
@param pExpectedClassName type name of the expected type
@param pValue value to either take directly or to convert from its string representation.
@return the p... | [
"Prepare",
"a",
"value",
"from",
"a",
"either",
"a",
"given",
"object",
"or",
"its",
"string",
"representation",
".",
"If",
"the",
"value",
"is",
"already",
"assignable",
"to",
"the",
"given",
"class",
"name",
"it",
"is",
"returned",
"directly",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java#L98-L118 |
120,109 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java | StringToObjectConverter.prepareForDirectUsage | private Object prepareForDirectUsage(Class expectedClass, Object pArgument) {
Class givenClass = pArgument.getClass();
if (expectedClass.isArray() && List.class.isAssignableFrom(givenClass)) {
return convertListToArray(expectedClass, (List) pArgument);
} else {
return expect... | java | private Object prepareForDirectUsage(Class expectedClass, Object pArgument) {
Class givenClass = pArgument.getClass();
if (expectedClass.isArray() && List.class.isAssignableFrom(givenClass)) {
return convertListToArray(expectedClass, (List) pArgument);
} else {
return expect... | [
"private",
"Object",
"prepareForDirectUsage",
"(",
"Class",
"expectedClass",
",",
"Object",
"pArgument",
")",
"{",
"Class",
"givenClass",
"=",
"pArgument",
".",
"getClass",
"(",
")",
";",
"if",
"(",
"expectedClass",
".",
"isArray",
"(",
")",
"&&",
"List",
".... | Returns null if a string conversion should happen | [
"Returns",
"null",
"if",
"a",
"string",
"conversion",
"should",
"happen"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java#L170-L177 |
120,110 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java | StringToObjectConverter.convertFromString | public Object convertFromString(String pType, String pValue) {
String value = convertSpecialStringTags(pValue);
if (value == null) {
return null;
}
if (pType.startsWith("[") && pType.length() >= 2) {
return convertToArray(pType, value);
}
Parser ... | java | public Object convertFromString(String pType, String pValue) {
String value = convertSpecialStringTags(pValue);
if (value == null) {
return null;
}
if (pType.startsWith("[") && pType.length() >= 2) {
return convertToArray(pType, value);
}
Parser ... | [
"public",
"Object",
"convertFromString",
"(",
"String",
"pType",
",",
"String",
"pValue",
")",
"{",
"String",
"value",
"=",
"convertSpecialStringTags",
"(",
"pValue",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
... | Deserialize a string representation to an object for a given type
@param pType type to convert to
@param pValue the value to convert from
@return the converted value | [
"Deserialize",
"a",
"string",
"representation",
"to",
"an",
"object",
"for",
"a",
"given",
"type"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java#L203-L226 |
120,111 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java | StringToObjectConverter.convertToArray | private Object convertToArray(String pType, String pValue) {
// It's an array
String t = pType.substring(1,2);
Class valueType;
if (t.equals("L")) {
// It's an object-type
String oType = pType.substring(2,pType.length()-1).replace('/','.');
valueType =... | java | private Object convertToArray(String pType, String pValue) {
// It's an array
String t = pType.substring(1,2);
Class valueType;
if (t.equals("L")) {
// It's an object-type
String oType = pType.substring(2,pType.length()-1).replace('/','.');
valueType =... | [
"private",
"Object",
"convertToArray",
"(",
"String",
"pType",
",",
"String",
"pValue",
")",
"{",
"// It's an array",
"String",
"t",
"=",
"pType",
".",
"substring",
"(",
"1",
",",
"2",
")",
";",
"Class",
"valueType",
";",
"if",
"(",
"t",
".",
"equals",
... | Convert an array | [
"Convert",
"an",
"array"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java#L229-L253 |
120,112 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java | StringToObjectConverter.convertListToArray | private Object convertListToArray(Class pType, List pList) {
Class valueType = pType.getComponentType();
Object ret = Array.newInstance(valueType, pList.size());
int i = 0;
for (Object value : pList) {
if (value == null) {
if (!valueType.isPrimitive()) {
... | java | private Object convertListToArray(Class pType, List pList) {
Class valueType = pType.getComponentType();
Object ret = Array.newInstance(valueType, pList.size());
int i = 0;
for (Object value : pList) {
if (value == null) {
if (!valueType.isPrimitive()) {
... | [
"private",
"Object",
"convertListToArray",
"(",
"Class",
"pType",
",",
"List",
"pList",
")",
"{",
"Class",
"valueType",
"=",
"pType",
".",
"getComponentType",
"(",
")",
";",
"Object",
"ret",
"=",
"Array",
".",
"newInstance",
"(",
"valueType",
",",
"pList",
... | Convert a list to an array of the given type | [
"Convert",
"a",
"list",
"to",
"an",
"array",
"of",
"the",
"given",
"type"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java#L256-L278 |
120,113 | rhuss/jolokia | agent/jsr160/src/main/java/org/jolokia/jsr160/Jsr160RequestDispatcher.java | Jsr160RequestDispatcher.dispatchRequest | public Object dispatchRequest(JmxRequest pJmxReq)
throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException, NotChangedException {
JsonRequestHandler handler = requestHandlerManager.getRequestHandler(pJmxReq.getType());
JMXConnector conne... | java | public Object dispatchRequest(JmxRequest pJmxReq)
throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException, NotChangedException {
JsonRequestHandler handler = requestHandlerManager.getRequestHandler(pJmxReq.getType());
JMXConnector conne... | [
"public",
"Object",
"dispatchRequest",
"(",
"JmxRequest",
"pJmxReq",
")",
"throws",
"InstanceNotFoundException",
",",
"AttributeNotFoundException",
",",
"ReflectionException",
",",
"MBeanException",
",",
"IOException",
",",
"NotChangedException",
"{",
"JsonRequestHandler",
... | Call a remote connector based on the connection information contained in
the request.
@param pJmxReq the request to dispatch
@return result object
@throws InstanceNotFoundException
@throws AttributeNotFoundException
@throws ReflectionException
@throws MBeanException
@throws IOException | [
"Call",
"a",
"remote",
"connector",
"based",
"on",
"the",
"connection",
"information",
"contained",
"in",
"the",
"request",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jsr160/src/main/java/org/jolokia/jsr160/Jsr160RequestDispatcher.java#L95-L114 |
120,114 | rhuss/jolokia | agent/jsr160/src/main/java/org/jolokia/jsr160/Jsr160RequestDispatcher.java | Jsr160RequestDispatcher.prepareEnv | protected Map<String,Object> prepareEnv(Map<String, String> pTargetConfig) {
if (pTargetConfig == null || pTargetConfig.size() == 0) {
return null;
}
Map<String,Object> ret = new HashMap<String, Object>(pTargetConfig);
String user = (String) ret.remove("user");
String... | java | protected Map<String,Object> prepareEnv(Map<String, String> pTargetConfig) {
if (pTargetConfig == null || pTargetConfig.size() == 0) {
return null;
}
Map<String,Object> ret = new HashMap<String, Object>(pTargetConfig);
String user = (String) ret.remove("user");
String... | [
"protected",
"Map",
"<",
"String",
",",
"Object",
">",
"prepareEnv",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"pTargetConfig",
")",
"{",
"if",
"(",
"pTargetConfig",
"==",
"null",
"||",
"pTargetConfig",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
... | Override this if a special environment setup is required for JSR-160 connection
@param pTargetConfig the target configuration as obtained from the request
@return the prepared environment | [
"Override",
"this",
"if",
"a",
"special",
"environment",
"setup",
"is",
"required",
"for",
"JSR",
"-",
"160",
"connection"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jsr160/src/main/java/org/jolokia/jsr160/Jsr160RequestDispatcher.java#L145-L158 |
120,115 | rhuss/jolokia | agent/jsr160/src/main/java/org/jolokia/jsr160/Jsr160RequestDispatcher.java | Jsr160RequestDispatcher.acceptTargetUrl | private boolean acceptTargetUrl(String urlS) {
// Whitelist has precedence. Only patterns on the white list are allowed
if (whiteList != null) {
return checkPattern(whiteList, urlS, true);
}
// Then blacklist: Everything on this list is forbidden
if (blackList != nul... | java | private boolean acceptTargetUrl(String urlS) {
// Whitelist has precedence. Only patterns on the white list are allowed
if (whiteList != null) {
return checkPattern(whiteList, urlS, true);
}
// Then blacklist: Everything on this list is forbidden
if (blackList != nul... | [
"private",
"boolean",
"acceptTargetUrl",
"(",
"String",
"urlS",
")",
"{",
"// Whitelist has precedence. Only patterns on the white list are allowed",
"if",
"(",
"whiteList",
"!=",
"null",
")",
"{",
"return",
"checkPattern",
"(",
"whiteList",
",",
"urlS",
",",
"true",
... | Whether a given JMX Service URL is acceptable | [
"Whether",
"a",
"given",
"JMX",
"Service",
"URL",
"is",
"acceptable"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jsr160/src/main/java/org/jolokia/jsr160/Jsr160RequestDispatcher.java#L176-L189 |
120,116 | rhuss/jolokia | client/java/src/main/java/org/jolokia/client/exception/J4pBulkRemoteException.java | J4pBulkRemoteException.getResponses | public <T extends J4pResponse> List<T> getResponses() {
List<T> ret = new ArrayList<T>();
for (Object entry : results) {
if (entry instanceof J4pResponse) {
ret.add((T) entry);
}
}
return ret;
} | java | public <T extends J4pResponse> List<T> getResponses() {
List<T> ret = new ArrayList<T>();
for (Object entry : results) {
if (entry instanceof J4pResponse) {
ret.add((T) entry);
}
}
return ret;
} | [
"public",
"<",
"T",
"extends",
"J4pResponse",
">",
"List",
"<",
"T",
">",
"getResponses",
"(",
")",
"{",
"List",
"<",
"T",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
")",
";",
"for",
"(",
"Object",
"entry",
":",
"results",
")",
"{",... | Get the a list of responses for successful requests.
@param <T> response type
@return list of successful responses. | [
"Get",
"the",
"a",
"list",
"of",
"responses",
"for",
"successful",
"requests",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/exception/J4pBulkRemoteException.java#L61-L69 |
120,117 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/detector/JBossDetector.java | JBossDetector.addMBeanServers | @Override
/** {@inheritDoc} */
public void addMBeanServers(Set<MBeanServerConnection> servers) {
try {
Class locatorClass = Class.forName("org.jboss.mx.util.MBeanServerLocator");
Method method = locatorClass.getMethod("locateJBoss");
servers.add((MBeanServer) method.i... | java | @Override
/** {@inheritDoc} */
public void addMBeanServers(Set<MBeanServerConnection> servers) {
try {
Class locatorClass = Class.forName("org.jboss.mx.util.MBeanServerLocator");
Method method = locatorClass.getMethod("locateJBoss");
servers.add((MBeanServer) method.i... | [
"@",
"Override",
"/** {@inheritDoc} */",
"public",
"void",
"addMBeanServers",
"(",
"Set",
"<",
"MBeanServerConnection",
">",
"servers",
")",
"{",
"try",
"{",
"Class",
"locatorClass",
"=",
"Class",
".",
"forName",
"(",
"\"org.jboss.mx.util.MBeanServerLocator\"",
")",
... | Special handling for JBoss | [
"Special",
"handling",
"for",
"JBoss"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/JBossDetector.java#L177-L188 |
120,118 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/Base64Util.java | Base64Util.decodeBytes | private static byte[] decodeBytes(byte[] pInBytes) {
byte[] decodabet = DECODABET;
int len34 = pInBytes.length * 3 / 4; // Estimate on array size
byte[] outBuff = new byte[ len34 ]; // Upper limit on size of output
int outBuffPosn = 0; // Keep track of where we... | java | private static byte[] decodeBytes(byte[] pInBytes) {
byte[] decodabet = DECODABET;
int len34 = pInBytes.length * 3 / 4; // Estimate on array size
byte[] outBuff = new byte[ len34 ]; // Upper limit on size of output
int outBuffPosn = 0; // Keep track of where we... | [
"private",
"static",
"byte",
"[",
"]",
"decodeBytes",
"(",
"byte",
"[",
"]",
"pInBytes",
")",
"{",
"byte",
"[",
"]",
"decodabet",
"=",
"DECODABET",
";",
"int",
"len34",
"=",
"pInBytes",
".",
"length",
"*",
"3",
"/",
"4",
";",
"// Estimate on array size",... | Do the conversion to bytes | [
"Do",
"the",
"conversion",
"to",
"bytes"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/Base64Util.java#L80-L125 |
120,119 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/Base64Util.java | Base64Util.verifyArguments | private static void verifyArguments(byte[] source, int srcOffset, byte[] destination, int destOffset) {
// Lots of error checking and exception throwing
if( source == null ){
throw new IllegalArgumentException( "Source array was null." );
} // end if
if( destination == null... | java | private static void verifyArguments(byte[] source, int srcOffset, byte[] destination, int destOffset) {
// Lots of error checking and exception throwing
if( source == null ){
throw new IllegalArgumentException( "Source array was null." );
} // end if
if( destination == null... | [
"private",
"static",
"void",
"verifyArguments",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"srcOffset",
",",
"byte",
"[",
"]",
"destination",
",",
"int",
"destOffset",
")",
"{",
"// Lots of error checking and exception throwing",
"if",
"(",
"source",
"==",
"nu... | Check for argument validity | [
"Check",
"for",
"argument",
"validity"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/Base64Util.java#L168-L184 |
120,120 | rhuss/jolokia | agent/osgi/src/main/java/org/jolokia/osgi/security/ServiceAuthenticationHttpContext.java | ServiceAuthenticationHttpContext.shouldBeUsed | public static boolean shouldBeUsed(String authMode) {
return authMode != null &&
(authMode.equalsIgnoreCase(AUTHMODE_SERVICE_ALL) || authMode.equalsIgnoreCase(AUTHMODE_SERVICE_ANY));
} | java | public static boolean shouldBeUsed(String authMode) {
return authMode != null &&
(authMode.equalsIgnoreCase(AUTHMODE_SERVICE_ALL) || authMode.equalsIgnoreCase(AUTHMODE_SERVICE_ANY));
} | [
"public",
"static",
"boolean",
"shouldBeUsed",
"(",
"String",
"authMode",
")",
"{",
"return",
"authMode",
"!=",
"null",
"&&",
"(",
"authMode",
".",
"equalsIgnoreCase",
"(",
"AUTHMODE_SERVICE_ALL",
")",
"||",
"authMode",
".",
"equalsIgnoreCase",
"(",
"AUTHMODE_SERV... | Check whether for the given authmode an instance of this context should be used (i.e. when the
auth-mode is "service-any" or "service-all"
@param authMode authmode to check
@return true if this context should be used for the agent, false otherwise | [
"Check",
"whether",
"for",
"the",
"given",
"authmode",
"an",
"instance",
"of",
"this",
"context",
"should",
"be",
"used",
"(",
"i",
".",
"e",
".",
"when",
"the",
"auth",
"-",
"mode",
"is",
"service",
"-",
"any",
"or",
"service",
"-",
"all"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/osgi/src/main/java/org/jolokia/osgi/security/ServiceAuthenticationHttpContext.java#L102-L105 |
120,121 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/object/TabularDataConverter.java | TabularDataConverter.checkForMapKey | private boolean checkForMapKey(TabularType pType) {
List<String> indexNames = pType.getIndexNames();
return
// Single index named "key"
indexNames.size() == 1 && indexNames.contains(TD_KEY_KEY) &&
// Only convert to map for simple types for all others use ... | java | private boolean checkForMapKey(TabularType pType) {
List<String> indexNames = pType.getIndexNames();
return
// Single index named "key"
indexNames.size() == 1 && indexNames.contains(TD_KEY_KEY) &&
// Only convert to map for simple types for all others use ... | [
"private",
"boolean",
"checkForMapKey",
"(",
"TabularType",
"pType",
")",
"{",
"List",
"<",
"String",
">",
"indexNames",
"=",
"pType",
".",
"getIndexNames",
"(",
")",
";",
"return",
"// Single index named \"key\"",
"indexNames",
".",
"size",
"(",
")",
"==",
"1... | The tabular data representing a map must have a single index named "key" which must be a simple type | [
"The",
"tabular",
"data",
"representing",
"a",
"map",
"must",
"have",
"a",
"single",
"index",
"named",
"key",
"which",
"must",
"be",
"a",
"simple",
"type"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/object/TabularDataConverter.java#L99-L106 |
120,122 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/object/TabularDataConverter.java | TabularDataConverter.checkForFullTabularDataRepresentation | private boolean checkForFullTabularDataRepresentation(JSONObject pValue, TabularType pType) {
if (pValue.containsKey("indexNames") && pValue.containsKey("values") && pValue.size() == 2) {
Object jsonVal = pValue.get("indexNames");
if (!(jsonVal instanceof JSONArray)) {
th... | java | private boolean checkForFullTabularDataRepresentation(JSONObject pValue, TabularType pType) {
if (pValue.containsKey("indexNames") && pValue.containsKey("values") && pValue.size() == 2) {
Object jsonVal = pValue.get("indexNames");
if (!(jsonVal instanceof JSONArray)) {
th... | [
"private",
"boolean",
"checkForFullTabularDataRepresentation",
"(",
"JSONObject",
"pValue",
",",
"TabularType",
"pType",
")",
"{",
"if",
"(",
"pValue",
".",
"containsKey",
"(",
"\"indexNames\"",
")",
"&&",
"pValue",
".",
"containsKey",
"(",
"\"values\"",
")",
"&&"... | Check for a full table data representation and do some sanity checks | [
"Check",
"for",
"a",
"full",
"table",
"data",
"representation",
"and",
"do",
"some",
"sanity",
"checks"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/object/TabularDataConverter.java#L109-L130 |
120,123 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/object/TabularDataConverter.java | TabularDataConverter.convertTabularDataFromFullRepresentation | private TabularData convertTabularDataFromFullRepresentation(JSONObject pValue, TabularType pType) {
JSONAware jsonVal;
jsonVal = (JSONAware) pValue.get("values");
if (!(jsonVal instanceof JSONArray)) {
throw new IllegalArgumentException("Values for tabular data of type " +
... | java | private TabularData convertTabularDataFromFullRepresentation(JSONObject pValue, TabularType pType) {
JSONAware jsonVal;
jsonVal = (JSONAware) pValue.get("values");
if (!(jsonVal instanceof JSONArray)) {
throw new IllegalArgumentException("Values for tabular data of type " +
... | [
"private",
"TabularData",
"convertTabularDataFromFullRepresentation",
"(",
"JSONObject",
"pValue",
",",
"TabularType",
"pType",
")",
"{",
"JSONAware",
"jsonVal",
";",
"jsonVal",
"=",
"(",
"JSONAware",
")",
"pValue",
".",
"get",
"(",
"\"values\"",
")",
";",
"if",
... | Convert complex representation containing "indexNames" and "values" | [
"Convert",
"complex",
"representation",
"containing",
"indexNames",
"and",
"values"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/object/TabularDataConverter.java#L159-L175 |
120,124 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.getLocalAddress | public static InetAddress getLocalAddress() throws UnknownHostException, SocketException {
InetAddress addr = InetAddress.getLocalHost();
NetworkInterface nif = NetworkInterface.getByInetAddress(addr);
if (addr.isLoopbackAddress() || addr instanceof Inet6Address || nif == null) {
// ... | java | public static InetAddress getLocalAddress() throws UnknownHostException, SocketException {
InetAddress addr = InetAddress.getLocalHost();
NetworkInterface nif = NetworkInterface.getByInetAddress(addr);
if (addr.isLoopbackAddress() || addr instanceof Inet6Address || nif == null) {
// ... | [
"public",
"static",
"InetAddress",
"getLocalAddress",
"(",
")",
"throws",
"UnknownHostException",
",",
"SocketException",
"{",
"InetAddress",
"addr",
"=",
"InetAddress",
".",
"getLocalHost",
"(",
")",
";",
"NetworkInterface",
"nif",
"=",
"NetworkInterface",
".",
"ge... | Get a local, IP4 Address, preferable a non-loopback address which is bound to an interface.
@return
@throws UnknownHostException
@throws SocketException | [
"Get",
"a",
"local",
"IP4",
"Address",
"preferable",
"a",
"non",
"-",
"loopback",
"address",
"which",
"is",
"bound",
"to",
"an",
"interface",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L51-L62 |
120,125 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.findLocalAddressViaNetworkInterface | public static InetAddress findLocalAddressViaNetworkInterface() {
Enumeration<NetworkInterface> networkInterfaces;
try {
networkInterfaces = NetworkInterface.getNetworkInterfaces();
} catch (SocketException e) {
return null;
}
while (networkInterfaces.has... | java | public static InetAddress findLocalAddressViaNetworkInterface() {
Enumeration<NetworkInterface> networkInterfaces;
try {
networkInterfaces = NetworkInterface.getNetworkInterfaces();
} catch (SocketException e) {
return null;
}
while (networkInterfaces.has... | [
"public",
"static",
"InetAddress",
"findLocalAddressViaNetworkInterface",
"(",
")",
"{",
"Enumeration",
"<",
"NetworkInterface",
">",
"networkInterfaces",
";",
"try",
"{",
"networkInterfaces",
"=",
"NetworkInterface",
".",
"getNetworkInterfaces",
"(",
")",
";",
"}",
"... | returns null if none has been found | [
"returns",
"null",
"if",
"none",
"has",
"been",
"found"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L93-L111 |
120,126 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.isMulticastSupported | public static boolean isMulticastSupported(NetworkInterface pNif) {
return pNif != null && checkMethod(pNif, isUp) && checkMethod(pNif, supportsMulticast);
} | java | public static boolean isMulticastSupported(NetworkInterface pNif) {
return pNif != null && checkMethod(pNif, isUp) && checkMethod(pNif, supportsMulticast);
} | [
"public",
"static",
"boolean",
"isMulticastSupported",
"(",
"NetworkInterface",
"pNif",
")",
"{",
"return",
"pNif",
"!=",
"null",
"&&",
"checkMethod",
"(",
"pNif",
",",
"isUp",
")",
"&&",
"checkMethod",
"(",
"pNif",
",",
"supportsMulticast",
")",
";",
"}"
] | Check whether the given interface supports multicast and is up
@param pNif check whether the given interface supports multicast
@return true if multicast is supported and the interface is up | [
"Check",
"whether",
"the",
"given",
"interface",
"supports",
"multicast",
"and",
"is",
"up"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L129-L131 |
120,127 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.getMulticastAddresses | public static List<InetAddress> getMulticastAddresses() throws SocketException {
Enumeration<NetworkInterface> nifs = NetworkInterface.getNetworkInterfaces();
List<InetAddress> ret = new ArrayList<InetAddress>();
while (nifs.hasMoreElements()) {
NetworkInterface nif = nifs.nextElemen... | java | public static List<InetAddress> getMulticastAddresses() throws SocketException {
Enumeration<NetworkInterface> nifs = NetworkInterface.getNetworkInterfaces();
List<InetAddress> ret = new ArrayList<InetAddress>();
while (nifs.hasMoreElements()) {
NetworkInterface nif = nifs.nextElemen... | [
"public",
"static",
"List",
"<",
"InetAddress",
">",
"getMulticastAddresses",
"(",
")",
"throws",
"SocketException",
"{",
"Enumeration",
"<",
"NetworkInterface",
">",
"nifs",
"=",
"NetworkInterface",
".",
"getNetworkInterfaces",
"(",
")",
";",
"List",
"<",
"InetAd... | Get all local addresses on which a multicast can be send
@return list of all multi cast capable addresses | [
"Get",
"all",
"local",
"addresses",
"on",
"which",
"a",
"multicast",
"can",
"be",
"send"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L149-L166 |
120,128 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.useInetAddress | private static boolean useInetAddress(NetworkInterface networkInterface, InetAddress interfaceAddress) {
return checkMethod(networkInterface, isUp) &&
checkMethod(networkInterface, supportsMulticast) &&
// TODO: IpV6 support
!(interfaceAddress instanceof Inet6Address... | java | private static boolean useInetAddress(NetworkInterface networkInterface, InetAddress interfaceAddress) {
return checkMethod(networkInterface, isUp) &&
checkMethod(networkInterface, supportsMulticast) &&
// TODO: IpV6 support
!(interfaceAddress instanceof Inet6Address... | [
"private",
"static",
"boolean",
"useInetAddress",
"(",
"NetworkInterface",
"networkInterface",
",",
"InetAddress",
"interfaceAddress",
")",
"{",
"return",
"checkMethod",
"(",
"networkInterface",
",",
"isUp",
")",
"&&",
"checkMethod",
"(",
"networkInterface",
",",
"sup... | Only use the given interface on the given network interface if it is up and supports multicast | [
"Only",
"use",
"the",
"given",
"interface",
"on",
"the",
"given",
"network",
"interface",
"if",
"it",
"is",
"up",
"and",
"supports",
"multicast"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L212-L218 |
120,129 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.checkMethod | private static Boolean checkMethod(NetworkInterface iface, Method toCheck) {
if (toCheck != null) {
try {
return (Boolean) toCheck.invoke(iface, (Object[]) null);
} catch (IllegalAccessException e) {
return false;
} catch (InvocationTargetExcep... | java | private static Boolean checkMethod(NetworkInterface iface, Method toCheck) {
if (toCheck != null) {
try {
return (Boolean) toCheck.invoke(iface, (Object[]) null);
} catch (IllegalAccessException e) {
return false;
} catch (InvocationTargetExcep... | [
"private",
"static",
"Boolean",
"checkMethod",
"(",
"NetworkInterface",
"iface",
",",
"Method",
"toCheck",
")",
"{",
"if",
"(",
"toCheck",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"(",
"Boolean",
")",
"toCheck",
".",
"invoke",
"(",
"iface",
",",
"("... | Call a method and return the result as boolean. In case of problems, return false. | [
"Call",
"a",
"method",
"and",
"return",
"the",
"result",
"as",
"boolean",
".",
"In",
"case",
"of",
"problems",
"return",
"false",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L221-L233 |
120,130 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.findLocalAddressListeningOnPort | private static InetAddress findLocalAddressListeningOnPort(String pHost, int pPort) throws UnknownHostException, SocketException {
InetAddress address = InetAddress.getByName(pHost);
if (address.isLoopbackAddress()) {
// First check local address
InetAddress localAddress = getLoc... | java | private static InetAddress findLocalAddressListeningOnPort(String pHost, int pPort) throws UnknownHostException, SocketException {
InetAddress address = InetAddress.getByName(pHost);
if (address.isLoopbackAddress()) {
// First check local address
InetAddress localAddress = getLoc... | [
"private",
"static",
"InetAddress",
"findLocalAddressListeningOnPort",
"(",
"String",
"pHost",
",",
"int",
"pPort",
")",
"throws",
"UnknownHostException",
",",
"SocketException",
"{",
"InetAddress",
"address",
"=",
"InetAddress",
".",
"getByName",
"(",
"pHost",
")",
... | Check for an non-loopback, local adress listening on the given port | [
"Check",
"for",
"an",
"non",
"-",
"loopback",
"local",
"adress",
"listening",
"on",
"the",
"given",
"port"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L236-L252 |
120,131 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.isPortOpen | private static boolean isPortOpen(InetAddress pAddress, int pPort) {
Socket socket = null;
try {
socket = new Socket();
socket.setReuseAddress(true);
SocketAddress sa = new InetSocketAddress(pAddress, pPort);
socket.connect(sa, 200);
return soc... | java | private static boolean isPortOpen(InetAddress pAddress, int pPort) {
Socket socket = null;
try {
socket = new Socket();
socket.setReuseAddress(true);
SocketAddress sa = new InetSocketAddress(pAddress, pPort);
socket.connect(sa, 200);
return soc... | [
"private",
"static",
"boolean",
"isPortOpen",
"(",
"InetAddress",
"pAddress",
",",
"int",
"pPort",
")",
"{",
"Socket",
"socket",
"=",
"null",
";",
"try",
"{",
"socket",
"=",
"new",
"Socket",
"(",
")",
";",
"socket",
".",
"setReuseAddress",
"(",
"true",
"... | Check a port by connecting to it. Try only 200ms. | [
"Check",
"a",
"port",
"by",
"connecting",
"to",
"it",
".",
"Try",
"only",
"200ms",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L274-L293 |
120,132 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.getProcessId | private static String getProcessId() {
// something like '<pid>@<hostname>', at least in SUN / Oracle JVMs
final String jvmName = ManagementFactory.getRuntimeMXBean().getName();
final int index = jvmName.indexOf('@');
return index < 0 ? jvmName : jvmName.substring(0, index);
} | java | private static String getProcessId() {
// something like '<pid>@<hostname>', at least in SUN / Oracle JVMs
final String jvmName = ManagementFactory.getRuntimeMXBean().getName();
final int index = jvmName.indexOf('@');
return index < 0 ? jvmName : jvmName.substring(0, index);
} | [
"private",
"static",
"String",
"getProcessId",
"(",
")",
"{",
"// something like '<pid>@<hostname>', at least in SUN / Oracle JVMs",
"final",
"String",
"jvmName",
"=",
"ManagementFactory",
".",
"getRuntimeMXBean",
"(",
")",
".",
"getName",
"(",
")",
";",
"final",
"int",... | Hack for finding the process id. Used in creating an unique agent id. | [
"Hack",
"for",
"finding",
"the",
"process",
"id",
".",
"Used",
"in",
"creating",
"an",
"unique",
"agent",
"id",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L296-L301 |
120,133 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.dumpLocalNetworkInfo | public static String dumpLocalNetworkInfo() throws UnknownHostException, SocketException {
StringBuffer buffer = new StringBuffer();
InetAddress addr = InetAddress.getLocalHost();
buffer.append("Localhost: " + getAddrInfo(addr) + "\n");
Enumeration<NetworkInterface> nifs = NetworkInterfa... | java | public static String dumpLocalNetworkInfo() throws UnknownHostException, SocketException {
StringBuffer buffer = new StringBuffer();
InetAddress addr = InetAddress.getLocalHost();
buffer.append("Localhost: " + getAddrInfo(addr) + "\n");
Enumeration<NetworkInterface> nifs = NetworkInterfa... | [
"public",
"static",
"String",
"dumpLocalNetworkInfo",
"(",
")",
"throws",
"UnknownHostException",
",",
"SocketException",
"{",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"InetAddress",
"addr",
"=",
"InetAddress",
".",
"getLocalHost",
"(",
... | Get the local network info as a string
@return return a description of the current network setup of the local host.
@throws UnknownHostException
@throws SocketException | [
"Get",
"the",
"local",
"network",
"info",
"as",
"a",
"string"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L310-L326 |
120,134 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/executor/AbstractMBeanServerExecutor.java | AbstractMBeanServerExecutor.registerForMBeanNotifications | protected void registerForMBeanNotifications() {
Set<MBeanServerConnection> servers = getMBeanServers();
Exception lastExp = null;
StringBuilder errors = new StringBuilder();
for (MBeanServerConnection server : servers) {
try {
JmxUtil.addMBeanRegistrationList... | java | protected void registerForMBeanNotifications() {
Set<MBeanServerConnection> servers = getMBeanServers();
Exception lastExp = null;
StringBuilder errors = new StringBuilder();
for (MBeanServerConnection server : servers) {
try {
JmxUtil.addMBeanRegistrationList... | [
"protected",
"void",
"registerForMBeanNotifications",
"(",
")",
"{",
"Set",
"<",
"MBeanServerConnection",
">",
"servers",
"=",
"getMBeanServers",
"(",
")",
";",
"Exception",
"lastExp",
"=",
"null",
";",
"StringBuilder",
"errors",
"=",
"new",
"StringBuilder",
"(",
... | Add this executor as listener for MBeanServer notification so that we can update
the local timestamp for when the set of registered MBeans has changed last. | [
"Add",
"this",
"executor",
"as",
"listener",
"for",
"MBeanServer",
"notification",
"so",
"that",
"we",
"can",
"update",
"the",
"local",
"timestamp",
"for",
"when",
"the",
"set",
"of",
"registered",
"MBeans",
"has",
"changed",
"last",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/executor/AbstractMBeanServerExecutor.java#L122-L136 |
120,135 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/executor/AbstractMBeanServerExecutor.java | AbstractMBeanServerExecutor.updateErrorMsg | private Exception updateErrorMsg(StringBuilder pErrors, Exception exp) {
pErrors.append(exp.getClass()).append(": ").append(exp.getMessage()).append("\n");
return exp;
} | java | private Exception updateErrorMsg(StringBuilder pErrors, Exception exp) {
pErrors.append(exp.getClass()).append(": ").append(exp.getMessage()).append("\n");
return exp;
} | [
"private",
"Exception",
"updateErrorMsg",
"(",
"StringBuilder",
"pErrors",
",",
"Exception",
"exp",
")",
"{",
"pErrors",
".",
"append",
"(",
"exp",
".",
"getClass",
"(",
")",
")",
".",
"append",
"(",
"\": \"",
")",
".",
"append",
"(",
"exp",
".",
"getMes... | Helper method for adding the exception for an appropriate error message | [
"Helper",
"method",
"for",
"adding",
"the",
"exception",
"for",
"an",
"appropriate",
"error",
"message"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/executor/AbstractMBeanServerExecutor.java#L170-L173 |
120,136 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/security/KeyStoreUtil.java | KeyStoreUtil.updateWithCaPem | public static void updateWithCaPem(KeyStore pTrustStore, File pCaCert)
throws IOException, CertificateException, KeyStoreException, NoSuchAlgorithmException {
InputStream is = new FileInputStream(pCaCert);
try {
CertificateFactory certFactory = CertificateFactory.getInstance("X50... | java | public static void updateWithCaPem(KeyStore pTrustStore, File pCaCert)
throws IOException, CertificateException, KeyStoreException, NoSuchAlgorithmException {
InputStream is = new FileInputStream(pCaCert);
try {
CertificateFactory certFactory = CertificateFactory.getInstance("X50... | [
"public",
"static",
"void",
"updateWithCaPem",
"(",
"KeyStore",
"pTrustStore",
",",
"File",
"pCaCert",
")",
"throws",
"IOException",
",",
"CertificateException",
",",
"KeyStoreException",
",",
"NoSuchAlgorithmException",
"{",
"InputStream",
"is",
"=",
"new",
"FileInpu... | Update a keystore with a CA certificate
@param pTrustStore the keystore to update
@param pCaCert CA cert as PEM used for the trust store | [
"Update",
"a",
"keystore",
"with",
"a",
"CA",
"certificate"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/security/KeyStoreUtil.java#L55-L67 |
120,137 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/security/KeyStoreUtil.java | KeyStoreUtil.updateWithServerPems | public static void updateWithServerPems(KeyStore pKeyStore, File pServerCert, File pServerKey, String pKeyAlgo, char[] pPassword)
throws IOException, CertificateException, NoSuchAlgorithmException, InvalidKeySpecException, KeyStoreException {
InputStream is = new FileInputStream(pServerCert);
... | java | public static void updateWithServerPems(KeyStore pKeyStore, File pServerCert, File pServerKey, String pKeyAlgo, char[] pPassword)
throws IOException, CertificateException, NoSuchAlgorithmException, InvalidKeySpecException, KeyStoreException {
InputStream is = new FileInputStream(pServerCert);
... | [
"public",
"static",
"void",
"updateWithServerPems",
"(",
"KeyStore",
"pKeyStore",
",",
"File",
"pServerCert",
",",
"File",
"pServerKey",
",",
"String",
"pKeyAlgo",
",",
"char",
"[",
"]",
"pPassword",
")",
"throws",
"IOException",
",",
"CertificateException",
",",
... | Update a key store with the keys found in a server PEM and its key file.
@param pKeyStore keystore to update
@param pServerCert server certificate
@param pServerKey server key
@param pKeyAlgo algorithm used in the keystore (e.g. "RSA")
@param pPassword password to use for the key file. must not be null, use <c... | [
"Update",
"a",
"key",
"store",
"with",
"the",
"keys",
"found",
"in",
"a",
"server",
"PEM",
"and",
"its",
"key",
"file",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/security/KeyStoreUtil.java#L79-L104 |
120,138 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/security/KeyStoreUtil.java | KeyStoreUtil.updateWithSelfSignedServerCertificate | public static void updateWithSelfSignedServerCertificate(KeyStore pKeyStore)
throws NoSuchProviderException, NoSuchAlgorithmException, IOException,
InvalidKeyException, CertificateException, SignatureException, KeyStoreException {
final Object x500Name;
final Object[] cer... | java | public static void updateWithSelfSignedServerCertificate(KeyStore pKeyStore)
throws NoSuchProviderException, NoSuchAlgorithmException, IOException,
InvalidKeyException, CertificateException, SignatureException, KeyStoreException {
final Object x500Name;
final Object[] cer... | [
"public",
"static",
"void",
"updateWithSelfSignedServerCertificate",
"(",
"KeyStore",
"pKeyStore",
")",
"throws",
"NoSuchProviderException",
",",
"NoSuchAlgorithmException",
",",
"IOException",
",",
"InvalidKeyException",
",",
"CertificateException",
",",
"SignatureException",
... | Update the given keystore with a self signed server certificate. This can be used if no
server certificate is provided from the outside and no SSL verification is used by the client.
@param pKeyStore keystore to update | [
"Update",
"the",
"given",
"keystore",
"with",
"a",
"self",
"signed",
"server",
"certificate",
".",
"This",
"can",
"be",
"used",
"if",
"no",
"server",
"certificate",
"is",
"provided",
"from",
"the",
"outside",
"and",
"no",
"SSL",
"verification",
"is",
"used",... | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/security/KeyStoreUtil.java#L112-L138 |
120,139 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/ListExtractor.java | ListExtractor.setObjectValue | public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pIndex, Object pValue)
throws IllegalAccessException, InvocationTargetException {
List list = (List) pInner;
int idx;
try {
idx = Integer.parseInt(pIndex);
} catch (NumberForma... | java | public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pIndex, Object pValue)
throws IllegalAccessException, InvocationTargetException {
List list = (List) pInner;
int idx;
try {
idx = Integer.parseInt(pIndex);
} catch (NumberForma... | [
"public",
"Object",
"setObjectValue",
"(",
"StringToObjectConverter",
"pConverter",
",",
"Object",
"pInner",
",",
"String",
"pIndex",
",",
"Object",
"pValue",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"List",
"list",
"=",
"(",
"... | Set a value within a list
@param pConverter the global converter in order to be able do dispatch for
serializing inner data types
@param pInner object on which to set the value (which must be a {@link List})
@param pIndex index (as string) where to set the value within the list
@param pValue the new value to set
@ret... | [
"Set",
"a",
"value",
"within",
"a",
"list"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ListExtractor.java#L82-L102 |
120,140 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/request/JmxListRequest.java | JmxListRequest.newCreator | static RequestCreator<JmxListRequest> newCreator() {
return new RequestCreator<JmxListRequest>() {
/** {@inheritDoc} */
public JmxListRequest create(Stack<String> pStack, ProcessingParameters pParams) throws MalformedObjectNameException {
return new JmxListRequest(
... | java | static RequestCreator<JmxListRequest> newCreator() {
return new RequestCreator<JmxListRequest>() {
/** {@inheritDoc} */
public JmxListRequest create(Stack<String> pStack, ProcessingParameters pParams) throws MalformedObjectNameException {
return new JmxListRequest(
... | [
"static",
"RequestCreator",
"<",
"JmxListRequest",
">",
"newCreator",
"(",
")",
"{",
"return",
"new",
"RequestCreator",
"<",
"JmxListRequest",
">",
"(",
")",
"{",
"/** {@inheritDoc} */",
"public",
"JmxListRequest",
"create",
"(",
"Stack",
"<",
"String",
">",
"pS... | Create a new creator used for creating list requests
@return creator | [
"Create",
"a",
"new",
"creator",
"used",
"for",
"creating",
"list",
"requests"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxListRequest.java#L72-L87 |
120,141 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JvmAgent.java | JvmAgent.awaitServerInitialization | private static void awaitServerInitialization(JvmAgentConfig pConfig, final Instrumentation instrumentation) {
List<ServerDetector> detectors = MBeanServerHandler.lookupDetectors();
for (ServerDetector detector : detectors) {
detector.jvmAgentStartup(instrumentation);
}
} | java | private static void awaitServerInitialization(JvmAgentConfig pConfig, final Instrumentation instrumentation) {
List<ServerDetector> detectors = MBeanServerHandler.lookupDetectors();
for (ServerDetector detector : detectors) {
detector.jvmAgentStartup(instrumentation);
}
} | [
"private",
"static",
"void",
"awaitServerInitialization",
"(",
"JvmAgentConfig",
"pConfig",
",",
"final",
"Instrumentation",
"instrumentation",
")",
"{",
"List",
"<",
"ServerDetector",
">",
"detectors",
"=",
"MBeanServerHandler",
".",
"lookupDetectors",
"(",
")",
";",... | Lookup the server detectors and notify detector about the JVM startup
@param instrumentation
@see ServerDetector#jvmAgentStartup(Instrumentation) | [
"Lookup",
"the",
"server",
"detectors",
"and",
"notify",
"detector",
"about",
"the",
"JVM",
"startup"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JvmAgent.java#L121-L126 |
120,142 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java | JolokiaHttpHandler.start | public void start(boolean pLazy) {
Restrictor restrictor = createRestrictor();
backendManager = new BackendManager(configuration, logHandler, restrictor, pLazy);
requestHandler = new HttpRequestHandler(configuration, backendManager, logHandler);
if (listenForDiscoveryMcRequests(configura... | java | public void start(boolean pLazy) {
Restrictor restrictor = createRestrictor();
backendManager = new BackendManager(configuration, logHandler, restrictor, pLazy);
requestHandler = new HttpRequestHandler(configuration, backendManager, logHandler);
if (listenForDiscoveryMcRequests(configura... | [
"public",
"void",
"start",
"(",
"boolean",
"pLazy",
")",
"{",
"Restrictor",
"restrictor",
"=",
"createRestrictor",
"(",
")",
";",
"backendManager",
"=",
"new",
"BackendManager",
"(",
"configuration",
",",
"logHandler",
",",
"restrictor",
",",
"pLazy",
")",
";"... | Start the handler
@param pLazy whether initialisation should be done lazy. | [
"Start",
"the",
"handler"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java#L105-L117 |
120,143 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java | JolokiaHttpHandler.start | public void start(boolean pLazy, String pUrl, boolean pSecured) {
start(pLazy);
AgentDetails details = backendManager.getAgentDetails();
details.setUrl(pUrl);
details.setSecured(pSecured);
} | java | public void start(boolean pLazy, String pUrl, boolean pSecured) {
start(pLazy);
AgentDetails details = backendManager.getAgentDetails();
details.setUrl(pUrl);
details.setSecured(pSecured);
} | [
"public",
"void",
"start",
"(",
"boolean",
"pLazy",
",",
"String",
"pUrl",
",",
"boolean",
"pSecured",
")",
"{",
"start",
"(",
"pLazy",
")",
";",
"AgentDetails",
"details",
"=",
"backendManager",
".",
"getAgentDetails",
"(",
")",
";",
"details",
".",
"setU... | Start the handler and remember connection details which are useful for discovery messages
@param pLazy whether initialisation should be done lazy.
@param pUrl agent URL
@param pSecured whether the communication is secured or not | [
"Start",
"the",
"handler",
"and",
"remember",
"connection",
"details",
"which",
"are",
"useful",
"for",
"discovery",
"messages"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java#L141-L147 |
120,144 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java | JolokiaHttpHandler.stop | public void stop() {
if (discoveryMulticastResponder != null) {
discoveryMulticastResponder.stop();
discoveryMulticastResponder = null;
}
backendManager.destroy();
backendManager = null;
requestHandler = null;
} | java | public void stop() {
if (discoveryMulticastResponder != null) {
discoveryMulticastResponder.stop();
discoveryMulticastResponder = null;
}
backendManager.destroy();
backendManager = null;
requestHandler = null;
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"discoveryMulticastResponder",
"!=",
"null",
")",
"{",
"discoveryMulticastResponder",
".",
"stop",
"(",
")",
";",
"discoveryMulticastResponder",
"=",
"null",
";",
"}",
"backendManager",
".",
"destroy",
"(",
"... | Stop the handler | [
"Stop",
"the",
"handler"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java#L152-L160 |
120,145 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java | JolokiaHttpHandler.handle | public void handle(final HttpExchange pHttpExchange) throws IOException {
try {
checkAuthentication(pHttpExchange);
Subject subject = (Subject) pHttpExchange.getAttribute(ConfigKey.JAAS_SUBJECT_REQUEST_ATTRIBUTE);
if (subject != null) {
doHandleAs(subject, p... | java | public void handle(final HttpExchange pHttpExchange) throws IOException {
try {
checkAuthentication(pHttpExchange);
Subject subject = (Subject) pHttpExchange.getAttribute(ConfigKey.JAAS_SUBJECT_REQUEST_ATTRIBUTE);
if (subject != null) {
doHandleAs(subject, p... | [
"public",
"void",
"handle",
"(",
"final",
"HttpExchange",
"pHttpExchange",
")",
"throws",
"IOException",
"{",
"try",
"{",
"checkAuthentication",
"(",
"pHttpExchange",
")",
";",
"Subject",
"subject",
"=",
"(",
"Subject",
")",
"pHttpExchange",
".",
"getAttribute",
... | Handle a request. If the handler is not yet started, an exception is thrown. If running with JAAS
security enabled it will run as the given subject.
@param pHttpExchange the request/response object
@throws IOException if something fails during handling
@throws IllegalStateException if the handler has not yet been star... | [
"Handle",
"a",
"request",
".",
"If",
"the",
"handler",
"is",
"not",
"yet",
"started",
"an",
"exception",
"is",
"thrown",
".",
"If",
"running",
"with",
"JAAS",
"security",
"enabled",
"it",
"will",
"run",
"as",
"the",
"given",
"subject",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java#L170-L183 |
120,146 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java | JolokiaHttpHandler.doHandleAs | private void doHandleAs(Subject subject, final HttpExchange pHttpExchange) {
try {
Subject.doAs(subject, new PrivilegedExceptionAction<Void>() {
public Void run() throws IOException {
doHandle(pHttpExchange);
return null;
}
});
... | java | private void doHandleAs(Subject subject, final HttpExchange pHttpExchange) {
try {
Subject.doAs(subject, new PrivilegedExceptionAction<Void>() {
public Void run() throws IOException {
doHandle(pHttpExchange);
return null;
}
});
... | [
"private",
"void",
"doHandleAs",
"(",
"Subject",
"subject",
",",
"final",
"HttpExchange",
"pHttpExchange",
")",
"{",
"try",
"{",
"Subject",
".",
"doAs",
"(",
"subject",
",",
"new",
"PrivilegedExceptionAction",
"<",
"Void",
">",
"(",
")",
"{",
"public",
"Void... | run as priviledged action | [
"run",
"as",
"priviledged",
"action"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java#L186-L197 |
120,147 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java | JolokiaHttpHandler.extractOriginOrReferer | private String extractOriginOrReferer(HttpExchange pExchange) {
Headers headers = pExchange.getRequestHeaders();
String origin = headers.getFirst("Origin");
if (origin == null) {
origin = headers.getFirst("Referer");
}
return origin != null ? origin.replaceAll("[\\n\\... | java | private String extractOriginOrReferer(HttpExchange pExchange) {
Headers headers = pExchange.getRequestHeaders();
String origin = headers.getFirst("Origin");
if (origin == null) {
origin = headers.getFirst("Referer");
}
return origin != null ? origin.replaceAll("[\\n\\... | [
"private",
"String",
"extractOriginOrReferer",
"(",
"HttpExchange",
"pExchange",
")",
"{",
"Headers",
"headers",
"=",
"pExchange",
".",
"getRequestHeaders",
"(",
")",
";",
"String",
"origin",
"=",
"headers",
".",
"getFirst",
"(",
"\"Origin\"",
")",
";",
"if",
... | Used for checking origin or referer is an origin policy is enabled | [
"Used",
"for",
"checking",
"origin",
"or",
"referer",
"is",
"an",
"origin",
"policy",
"is",
"enabled"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java#L261-L268 |
120,148 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java | JolokiaHttpHandler.getHostName | private String getHostName(InetSocketAddress address) {
return configuration.getAsBoolean(ConfigKey.ALLOW_DNS_REVERSE_LOOKUP) ? address.getHostName() : null;
} | java | private String getHostName(InetSocketAddress address) {
return configuration.getAsBoolean(ConfigKey.ALLOW_DNS_REVERSE_LOOKUP) ? address.getHostName() : null;
} | [
"private",
"String",
"getHostName",
"(",
"InetSocketAddress",
"address",
")",
"{",
"return",
"configuration",
".",
"getAsBoolean",
"(",
"ConfigKey",
".",
"ALLOW_DNS_REVERSE_LOOKUP",
")",
"?",
"address",
".",
"getHostName",
"(",
")",
":",
"null",
";",
"}"
] | Return hostnmae of given address, but only when reverse DNS lookups are allowed | [
"Return",
"hostnmae",
"of",
"given",
"address",
"but",
"only",
"when",
"reverse",
"DNS",
"lookups",
"are",
"allowed"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java#L271-L273 |
120,149 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java | JolokiaHttpHandler.getMimeType | private String getMimeType(ParsedUri pParsedUri) {
return MimeTypeUtil.getResponseMimeType(
pParsedUri.getParameter(ConfigKey.MIME_TYPE.getKeyValue()),
configuration.get(ConfigKey.MIME_TYPE),
pParsedUri.getParameter(ConfigKey.CALLBACK.getKeyValue()));
} | java | private String getMimeType(ParsedUri pParsedUri) {
return MimeTypeUtil.getResponseMimeType(
pParsedUri.getParameter(ConfigKey.MIME_TYPE.getKeyValue()),
configuration.get(ConfigKey.MIME_TYPE),
pParsedUri.getParameter(ConfigKey.CALLBACK.getKeyValue()));
} | [
"private",
"String",
"getMimeType",
"(",
"ParsedUri",
"pParsedUri",
")",
"{",
"return",
"MimeTypeUtil",
".",
"getResponseMimeType",
"(",
"pParsedUri",
".",
"getParameter",
"(",
"ConfigKey",
".",
"MIME_TYPE",
".",
"getKeyValue",
"(",
")",
")",
",",
"configuration",... | Get the proper mime type according to configuration | [
"Get",
"the",
"proper",
"mime",
"type",
"according",
"to",
"configuration"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java#L394-L399 |
120,150 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java | JolokiaHttpHandler.createLogHandler | private LogHandler createLogHandler(String pLogHandlerClass, String pDebug) {
if (pLogHandlerClass != null) {
return ClassUtil.newInstance(pLogHandlerClass);
} else {
final boolean debug = Boolean.valueOf(pDebug);
return new LogHandler.StdoutLogHandler(debug);
... | java | private LogHandler createLogHandler(String pLogHandlerClass, String pDebug) {
if (pLogHandlerClass != null) {
return ClassUtil.newInstance(pLogHandlerClass);
} else {
final boolean debug = Boolean.valueOf(pDebug);
return new LogHandler.StdoutLogHandler(debug);
... | [
"private",
"LogHandler",
"createLogHandler",
"(",
"String",
"pLogHandlerClass",
",",
"String",
"pDebug",
")",
"{",
"if",
"(",
"pLogHandlerClass",
"!=",
"null",
")",
"{",
"return",
"ClassUtil",
".",
"newInstance",
"(",
"pLogHandlerClass",
")",
";",
"}",
"else",
... | out to stderr | [
"out",
"to",
"stderr"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java#L403-L410 |
120,151 | rhuss/jolokia | agent/mule/src/main/java/org/jolokia/mule/MuleAgentHttpServerFactory.java | MuleAgentHttpServerFactory.create | public static MuleAgentHttpServer create(Agent pParent, MuleAgentConfig pConfig) {
if (ClassUtil.checkForClass("org.mortbay.jetty.Server")) {
return new MortbayMuleAgentHttpServer(pParent, pConfig);
} else if (ClassUtil.checkForClass("org.eclipse.jetty.server.ServerConnector")) {
... | java | public static MuleAgentHttpServer create(Agent pParent, MuleAgentConfig pConfig) {
if (ClassUtil.checkForClass("org.mortbay.jetty.Server")) {
return new MortbayMuleAgentHttpServer(pParent, pConfig);
} else if (ClassUtil.checkForClass("org.eclipse.jetty.server.ServerConnector")) {
... | [
"public",
"static",
"MuleAgentHttpServer",
"create",
"(",
"Agent",
"pParent",
",",
"MuleAgentConfig",
"pConfig",
")",
"{",
"if",
"(",
"ClassUtil",
".",
"checkForClass",
"(",
"\"org.mortbay.jetty.Server\"",
")",
")",
"{",
"return",
"new",
"MortbayMuleAgentHttpServer",
... | Create the internal HTTP server.
Create the Jetty Server of Mortbay packages or Eclipse Foundation packages.
@param pParent parent for creating proper exceptions
@param pConfig configuration of the server
@return internal HTTP server | [
"Create",
"the",
"internal",
"HTTP",
"server",
".",
"Create",
"the",
"Jetty",
"Server",
"of",
"Mortbay",
"packages",
"or",
"Eclipse",
"Foundation",
"packages",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/mule/src/main/java/org/jolokia/mule/MuleAgentHttpServerFactory.java#L42-L51 |
120,152 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/ServersInfo.java | ServersInfo.dump | public static String dump(Set<MBeanServerConnection> servers) {
StringBuffer ret = new StringBuffer();
ret.append("Found ").append(servers.size()).append(" MBeanServers\n");
for (MBeanServerConnection c : servers) {
MBeanServer s = (MBeanServer) c;
ret... | java | public static String dump(Set<MBeanServerConnection> servers) {
StringBuffer ret = new StringBuffer();
ret.append("Found ").append(servers.size()).append(" MBeanServers\n");
for (MBeanServerConnection c : servers) {
MBeanServer s = (MBeanServer) c;
ret... | [
"public",
"static",
"String",
"dump",
"(",
"Set",
"<",
"MBeanServerConnection",
">",
"servers",
")",
"{",
"StringBuffer",
"ret",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"ret",
".",
"append",
"(",
"\"Found \"",
")",
".",
"append",
"(",
"servers",
".",
... | Dump out a list of MBeanServer with some statistics.
@param servers server to dump
@return statistics as strings | [
"Dump",
"out",
"a",
"list",
"of",
"MBeanServer",
"with",
"some",
"statistics",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/ServersInfo.java#L40-L64 |
120,153 | rhuss/jolokia | agent/jmx/src/main/java/org/jolokia/jmx/JsonDynamicMBeanImpl.java | JsonDynamicMBeanImpl.mapAndInvoke | private Object mapAndInvoke(String pOperation, Object[] pParams, String[] pSignature, OperationMapInfo pOpMapInfo)
throws InstanceNotFoundException, MBeanException, ReflectionException {
// Map parameters
Object realParams[] = new Object[pSignature.length];
String realSignature[] = n... | java | private Object mapAndInvoke(String pOperation, Object[] pParams, String[] pSignature, OperationMapInfo pOpMapInfo)
throws InstanceNotFoundException, MBeanException, ReflectionException {
// Map parameters
Object realParams[] = new Object[pSignature.length];
String realSignature[] = n... | [
"private",
"Object",
"mapAndInvoke",
"(",
"String",
"pOperation",
",",
"Object",
"[",
"]",
"pParams",
",",
"String",
"[",
"]",
"pSignature",
",",
"OperationMapInfo",
"pOpMapInfo",
")",
"throws",
"InstanceNotFoundException",
",",
"MBeanException",
",",
"ReflectionExc... | Map the parameters and the return value if required | [
"Map",
"the",
"parameters",
"and",
"the",
"return",
"value",
"if",
"required"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/JsonDynamicMBeanImpl.java#L184-L206 |
120,154 | rhuss/jolokia | agent/jmx/src/main/java/org/jolokia/jmx/JsonDynamicMBeanImpl.java | JsonDynamicMBeanImpl.getOperationMapInfo | private OperationMapInfo getOperationMapInfo(String pOperation, String[] pSignature) {
List<OperationMapInfo> opMapInfoList = operationInfoMap.get(pOperation);
OperationMapInfo opMapInfo = null;
if (opMapInfoList != null) {
for (OperationMapInfo i : opMapInfoList) {
i... | java | private OperationMapInfo getOperationMapInfo(String pOperation, String[] pSignature) {
List<OperationMapInfo> opMapInfoList = operationInfoMap.get(pOperation);
OperationMapInfo opMapInfo = null;
if (opMapInfoList != null) {
for (OperationMapInfo i : opMapInfoList) {
i... | [
"private",
"OperationMapInfo",
"getOperationMapInfo",
"(",
"String",
"pOperation",
",",
"String",
"[",
"]",
"pSignature",
")",
"{",
"List",
"<",
"OperationMapInfo",
">",
"opMapInfoList",
"=",
"operationInfoMap",
".",
"get",
"(",
"pOperation",
")",
";",
"OperationM... | Lookup, whether a mapping is required for this call | [
"Lookup",
"whether",
"a",
"mapping",
"is",
"required",
"for",
"this",
"call"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/JsonDynamicMBeanImpl.java#L209-L221 |
120,155 | rhuss/jolokia | agent/jmx/src/main/java/org/jolokia/jmx/JsonDynamicMBeanImpl.java | JsonDynamicMBeanImpl.getWrappedInfo | private MBeanInfo getWrappedInfo(MBeanInfo pMBeanInfo) {
MBeanAttributeInfo[] attrInfo = getWrappedAttributeInfo(pMBeanInfo);
MBeanOperationInfo[] opInfo = getWrappedOperationInfo(pMBeanInfo);
return new MBeanInfo(pMBeanInfo.getClassName(),
pMBeanInfo.getDescription... | java | private MBeanInfo getWrappedInfo(MBeanInfo pMBeanInfo) {
MBeanAttributeInfo[] attrInfo = getWrappedAttributeInfo(pMBeanInfo);
MBeanOperationInfo[] opInfo = getWrappedOperationInfo(pMBeanInfo);
return new MBeanInfo(pMBeanInfo.getClassName(),
pMBeanInfo.getDescription... | [
"private",
"MBeanInfo",
"getWrappedInfo",
"(",
"MBeanInfo",
"pMBeanInfo",
")",
"{",
"MBeanAttributeInfo",
"[",
"]",
"attrInfo",
"=",
"getWrappedAttributeInfo",
"(",
"pMBeanInfo",
")",
";",
"MBeanOperationInfo",
"[",
"]",
"opInfo",
"=",
"getWrappedOperationInfo",
"(",
... | Wrap the given MBeanInfo, modified for translated signatures | [
"Wrap",
"the",
"given",
"MBeanInfo",
"modified",
"for",
"translated",
"signatures"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/JsonDynamicMBeanImpl.java#L229-L240 |
120,156 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/BeanExtractor.java | BeanExtractor.extractBeanAttributes | private List<String> extractBeanAttributes(Object pValue) {
List<String> attrs = new ArrayList<String>();
for (Method method : pValue.getClass().getMethods()) {
if (!Modifier.isStatic(method.getModifiers()) &&
!IGNORE_METHODS.contains(method.getName()) &&
!isI... | java | private List<String> extractBeanAttributes(Object pValue) {
List<String> attrs = new ArrayList<String>();
for (Method method : pValue.getClass().getMethods()) {
if (!Modifier.isStatic(method.getModifiers()) &&
!IGNORE_METHODS.contains(method.getName()) &&
!isI... | [
"private",
"List",
"<",
"String",
">",
"extractBeanAttributes",
"(",
"Object",
"pValue",
")",
"{",
"List",
"<",
"String",
">",
"attrs",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"Method",
"method",
":",
"pValue",
".",
"get... | Extract all attributes from a given bean | [
"Extract",
"all",
"attributes",
"from",
"a",
"given",
"bean"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/BeanExtractor.java#L205-L216 |
120,157 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/BeanExtractor.java | BeanExtractor.addAttributes | @SuppressWarnings("PMD.UnnecessaryCaseChange")
private void addAttributes(List<String> pAttrs, Method pMethod) {
String name = pMethod.getName();
for (String pref : GETTER_PREFIX) {
if (name.startsWith(pref) && name.length() > pref.length()
&& pMethod.getParameterType... | java | @SuppressWarnings("PMD.UnnecessaryCaseChange")
private void addAttributes(List<String> pAttrs, Method pMethod) {
String name = pMethod.getName();
for (String pref : GETTER_PREFIX) {
if (name.startsWith(pref) && name.length() > pref.length()
&& pMethod.getParameterType... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.UnnecessaryCaseChange\"",
")",
"private",
"void",
"addAttributes",
"(",
"List",
"<",
"String",
">",
"pAttrs",
",",
"Method",
"pMethod",
")",
"{",
"String",
"name",
"=",
"pMethod",
".",
"getName",
"(",
")",
";",
"for",
"("... | Add attributes, which are taken from get methods to the given list | [
"Add",
"attributes",
"which",
"are",
"taken",
"from",
"get",
"methods",
"to",
"the",
"given",
"list"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/BeanExtractor.java#L228-L245 |
120,158 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/BeanExtractor.java | BeanExtractor.isIgnoredType | private boolean isIgnoredType(Class<?> pReturnType) {
for (Class<?> type : IGNORED_RETURN_TYPES) {
if (type.isAssignableFrom(pReturnType)) {
return true;
}
}
return false;
} | java | private boolean isIgnoredType(Class<?> pReturnType) {
for (Class<?> type : IGNORED_RETURN_TYPES) {
if (type.isAssignableFrom(pReturnType)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"isIgnoredType",
"(",
"Class",
"<",
"?",
">",
"pReturnType",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"type",
":",
"IGNORED_RETURN_TYPES",
")",
"{",
"if",
"(",
"type",
".",
"isAssignableFrom",
"(",
"pReturnType",
")",
")",
"{",... | as safety net. I messed up my complete local Maven repository only be serializing a Jetty ServletContext | [
"as",
"safety",
"net",
".",
"I",
"messed",
"up",
"my",
"complete",
"local",
"Maven",
"repository",
"only",
"be",
"serializing",
"a",
"Jetty",
"ServletContext"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/BeanExtractor.java#L316-L323 |
120,159 | rhuss/jolokia | agent/jvm-spring/src/main/java/org/jolokia/jvmagent/spring/SpringJolokiaAgent.java | SpringJolokiaAgent.afterPropertiesSet | public void afterPropertiesSet() throws IOException {
Map<String, String> finalConfig = new HashMap<String, String>();
if (systemPropertyMode == SystemPropertyMode.MODE_FALLBACK) {
finalConfig.putAll(lookupSystemProperties());
}
if (config != null) {
finalConfig.p... | java | public void afterPropertiesSet() throws IOException {
Map<String, String> finalConfig = new HashMap<String, String>();
if (systemPropertyMode == SystemPropertyMode.MODE_FALLBACK) {
finalConfig.putAll(lookupSystemProperties());
}
if (config != null) {
finalConfig.p... | [
"public",
"void",
"afterPropertiesSet",
"(",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"finalConfig",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"if",
"(",
"systemPropertyMode",
"==",
"System... | Callback used for initializing and optionally starting up the server | [
"Callback",
"used",
"for",
"initializing",
"and",
"optionally",
"starting",
"up",
"the",
"server"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm-spring/src/main/java/org/jolokia/jvmagent/spring/SpringJolokiaAgent.java#L53-L84 |
120,160 | rhuss/jolokia | agent/jvm-spring/src/main/java/org/jolokia/jvmagent/spring/SpringJolokiaAgent.java | SpringJolokiaAgent.lookupSystemProperties | private Map<String, String> lookupSystemProperties() {
Map<String,String> ret = new HashMap<String, String>();
Enumeration propEnum = System.getProperties().propertyNames();
while (propEnum.hasMoreElements()) {
String prop = (String) propEnum.nextElement();
if (prop.start... | java | private Map<String, String> lookupSystemProperties() {
Map<String,String> ret = new HashMap<String, String>();
Enumeration propEnum = System.getProperties().propertyNames();
while (propEnum.hasMoreElements()) {
String prop = (String) propEnum.nextElement();
if (prop.start... | [
"private",
"Map",
"<",
"String",
",",
"String",
">",
"lookupSystemProperties",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"ret",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"Enumeration",
"propEnum",
"=",
"Sys... | Lookup system properties for all configurations possible | [
"Lookup",
"system",
"properties",
"for",
"all",
"configurations",
"possible"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm-spring/src/main/java/org/jolokia/jvmagent/spring/SpringJolokiaAgent.java#L87-L98 |
120,161 | rhuss/jolokia | agent/jvm-spring/src/main/java/org/jolokia/jvmagent/spring/SpringJolokiaAgent.java | SpringJolokiaAgent.setSystemPropertiesMode | public void setSystemPropertiesMode(String pMode) {
systemPropertyMode = SystemPropertyMode.fromMode(pMode);
if (systemPropertyMode == null) {
systemPropertyMode = SystemPropertyMode.MODE_NEVER;
}
} | java | public void setSystemPropertiesMode(String pMode) {
systemPropertyMode = SystemPropertyMode.fromMode(pMode);
if (systemPropertyMode == null) {
systemPropertyMode = SystemPropertyMode.MODE_NEVER;
}
} | [
"public",
"void",
"setSystemPropertiesMode",
"(",
"String",
"pMode",
")",
"{",
"systemPropertyMode",
"=",
"SystemPropertyMode",
".",
"fromMode",
"(",
"pMode",
")",
";",
"if",
"(",
"systemPropertyMode",
"==",
"null",
")",
"{",
"systemPropertyMode",
"=",
"SystemProp... | Set the system propert mode for how to deal with configuration coming from system properties | [
"Set",
"the",
"system",
"propert",
"mode",
"for",
"how",
"to",
"deal",
"with",
"configuration",
"coming",
"from",
"system",
"properties"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm-spring/src/main/java/org/jolokia/jvmagent/spring/SpringJolokiaAgent.java#L143-L148 |
120,162 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/request/JmxExecRequest.java | JmxExecRequest.toJSON | public JSONObject toJSON() {
JSONObject ret = super.toJSON();
if (arguments != null && arguments.size() > 0) {
ret.put("arguments", arguments);
}
ret.put("operation", operation);
return ret;
} | java | public JSONObject toJSON() {
JSONObject ret = super.toJSON();
if (arguments != null && arguments.size() > 0) {
ret.put("arguments", arguments);
}
ret.put("operation", operation);
return ret;
} | [
"public",
"JSONObject",
"toJSON",
"(",
")",
"{",
"JSONObject",
"ret",
"=",
"super",
".",
"toJSON",
"(",
")",
";",
"if",
"(",
"arguments",
"!=",
"null",
"&&",
"arguments",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"ret",
".",
"put",
"(",
"\"argumen... | Return this request in a proper JSON representation
@return this object in a JSON representation | [
"Return",
"this",
"request",
"in",
"a",
"proper",
"JSON",
"representation"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxExecRequest.java#L95-L102 |
120,163 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/request/JmxExecRequest.java | JmxExecRequest.convertSpecialStringTags | private static List<String> convertSpecialStringTags(List<String> extraArgs) {
if (extraArgs == null) {
return null;
}
List<String> args = new ArrayList<String>();
for (String arg : extraArgs) {
args.add(StringToObjectConverter.convertSpecialStringTags(arg));
... | java | private static List<String> convertSpecialStringTags(List<String> extraArgs) {
if (extraArgs == null) {
return null;
}
List<String> args = new ArrayList<String>();
for (String arg : extraArgs) {
args.add(StringToObjectConverter.convertSpecialStringTags(arg));
... | [
"private",
"static",
"List",
"<",
"String",
">",
"convertSpecialStringTags",
"(",
"List",
"<",
"String",
">",
"extraArgs",
")",
"{",
"if",
"(",
"extraArgs",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"String",
">",
"args",
"=",
"n... | Conver string tags if required | [
"Conver",
"string",
"tags",
"if",
"required"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxExecRequest.java#L131-L140 |
120,164 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/RequestHandlerManager.java | RequestHandlerManager.getRequestHandler | public JsonRequestHandler getRequestHandler(RequestType pType) {
JsonRequestHandler handler = requestHandlerMap.get(pType);
if (handler == null) {
throw new UnsupportedOperationException("Unsupported operation '" + pType + "'");
}
return handler;
} | java | public JsonRequestHandler getRequestHandler(RequestType pType) {
JsonRequestHandler handler = requestHandlerMap.get(pType);
if (handler == null) {
throw new UnsupportedOperationException("Unsupported operation '" + pType + "'");
}
return handler;
} | [
"public",
"JsonRequestHandler",
"getRequestHandler",
"(",
"RequestType",
"pType",
")",
"{",
"JsonRequestHandler",
"handler",
"=",
"requestHandlerMap",
".",
"get",
"(",
"pType",
")",
";",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"throw",
"new",
"UnsupportedO... | Get the request handler for the given type
@param pType type of request
@return handler which can handle requests of the given type | [
"Get",
"the",
"request",
"handler",
"for",
"the",
"given",
"type"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/RequestHandlerManager.java#L79-L85 |
120,165 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | AgentServlet.addJsr160DispatcherIfExternallyConfigured | private void addJsr160DispatcherIfExternallyConfigured(Configuration pConfig) {
String dispatchers = pConfig.get(ConfigKey.DISPATCHER_CLASSES);
String jsr160DispatcherClass = "org.jolokia.jsr160.Jsr160RequestDispatcher";
if (dispatchers == null || !dispatchers.contains(jsr160DispatcherClass)) {... | java | private void addJsr160DispatcherIfExternallyConfigured(Configuration pConfig) {
String dispatchers = pConfig.get(ConfigKey.DISPATCHER_CLASSES);
String jsr160DispatcherClass = "org.jolokia.jsr160.Jsr160RequestDispatcher";
if (dispatchers == null || !dispatchers.contains(jsr160DispatcherClass)) {... | [
"private",
"void",
"addJsr160DispatcherIfExternallyConfigured",
"(",
"Configuration",
"pConfig",
")",
"{",
"String",
"dispatchers",
"=",
"pConfig",
".",
"get",
"(",
"ConfigKey",
".",
"DISPATCHER_CLASSES",
")",
";",
"String",
"jsr160DispatcherClass",
"=",
"\"org.jolokia.... | Add the JsrRequestDispatcher if configured via a system property or env variable.
The JSR160 dispatcher is disabled by default, but this allows to enable it again
without reconfiguring the servlet
@param pConfig configuration to update | [
"Add",
"the",
"JsrRequestDispatcher",
"if",
"configured",
"via",
"a",
"system",
"property",
"or",
"env",
"variable",
".",
"The",
"JSR160",
"dispatcher",
"is",
"disabled",
"by",
"default",
"but",
"this",
"allows",
"to",
"enable",
"it",
"again",
"without",
"reco... | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/AgentServlet.java#L159-L186 |
120,166 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | AgentServlet.findAgentUrl | private String findAgentUrl(Configuration pConfig) {
// System property has precedence
String url = System.getProperty("jolokia." + ConfigKey.DISCOVERY_AGENT_URL.getKeyValue());
if (url == null) {
url = System.getenv("JOLOKIA_DISCOVERY_AGENT_URL");
if (url == null) {
... | java | private String findAgentUrl(Configuration pConfig) {
// System property has precedence
String url = System.getProperty("jolokia." + ConfigKey.DISCOVERY_AGENT_URL.getKeyValue());
if (url == null) {
url = System.getenv("JOLOKIA_DISCOVERY_AGENT_URL");
if (url == null) {
... | [
"private",
"String",
"findAgentUrl",
"(",
"Configuration",
"pConfig",
")",
"{",
"// System property has precedence",
"String",
"url",
"=",
"System",
".",
"getProperty",
"(",
"\"jolokia.\"",
"+",
"ConfigKey",
".",
"DISCOVERY_AGENT_URL",
".",
"getKeyValue",
"(",
")",
... | Try to find an URL for system props or config | [
"Try",
"to",
"find",
"an",
"URL",
"for",
"system",
"props",
"or",
"config"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/AgentServlet.java#L212-L222 |
120,167 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | AgentServlet.listenForDiscoveryMcRequests | private boolean listenForDiscoveryMcRequests(Configuration pConfig) {
// Check for system props, system env and agent config
boolean sysProp = System.getProperty("jolokia." + ConfigKey.DISCOVERY_ENABLED.getKeyValue()) != null;
boolean env = System.getenv("JOLOKIA_DISCOVERY") != null;
... | java | private boolean listenForDiscoveryMcRequests(Configuration pConfig) {
// Check for system props, system env and agent config
boolean sysProp = System.getProperty("jolokia." + ConfigKey.DISCOVERY_ENABLED.getKeyValue()) != null;
boolean env = System.getenv("JOLOKIA_DISCOVERY") != null;
... | [
"private",
"boolean",
"listenForDiscoveryMcRequests",
"(",
"Configuration",
"pConfig",
")",
"{",
"// Check for system props, system env and agent config",
"boolean",
"sysProp",
"=",
"System",
".",
"getProperty",
"(",
"\"jolokia.\"",
"+",
"ConfigKey",
".",
"DISCOVERY_ENABLED",... | For war agent needs to be switched on | [
"For",
"war",
"agent",
"needs",
"to",
"be",
"switched",
"on"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/AgentServlet.java#L225-L231 |
120,168 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | AgentServlet.doOptions | @Override
protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
Map<String,String> responseHeaders =
requestHandler.handleCorsPreflightRequest(
getOriginOrReferer(req),
req.getHeader("... | java | @Override
protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
Map<String,String> responseHeaders =
requestHandler.handleCorsPreflightRequest(
getOriginOrReferer(req),
req.getHeader("... | [
"@",
"Override",
"protected",
"void",
"doOptions",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"responseHeaders",
"=",
"requestHandler",
... | OPTION requests are treated as CORS preflight requests
@param req the original request
@param resp the response the answer are written to | [
"OPTION",
"requests",
"are",
"treated",
"as",
"CORS",
"preflight",
"requests"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/AgentServlet.java#L293-L302 |
120,169 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | AgentServlet.updateAgentDetailsIfNeeded | private void updateAgentDetailsIfNeeded(HttpServletRequest pReq) {
// Lookup the Agent URL if needed
AgentDetails details = backendManager.getAgentDetails();
if (details.isInitRequired()) {
synchronized (details) {
if (details.isInitRequired()) {
i... | java | private void updateAgentDetailsIfNeeded(HttpServletRequest pReq) {
// Lookup the Agent URL if needed
AgentDetails details = backendManager.getAgentDetails();
if (details.isInitRequired()) {
synchronized (details) {
if (details.isInitRequired()) {
i... | [
"private",
"void",
"updateAgentDetailsIfNeeded",
"(",
"HttpServletRequest",
"pReq",
")",
"{",
"// Lookup the Agent URL if needed",
"AgentDetails",
"details",
"=",
"backendManager",
".",
"getAgentDetails",
"(",
")",
";",
"if",
"(",
"details",
".",
"isInitRequired",
"(",
... | Update the agent URL in the agent details if not already done | [
"Update",
"the",
"agent",
"URL",
"in",
"the",
"agent",
"details",
"if",
"not",
"already",
"done"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/AgentServlet.java#L364-L382 |
120,170 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | AgentServlet.getBaseUrl | private String getBaseUrl(String pUrl, String pServletPath) {
String sUrl;
try {
URL url = new URL(pUrl);
String host = getIpIfPossible(url.getHost());
sUrl = new URL(url.getProtocol(),host,url.getPort(),pServletPath).toExternalForm();
} catch (MalformedURLExc... | java | private String getBaseUrl(String pUrl, String pServletPath) {
String sUrl;
try {
URL url = new URL(pUrl);
String host = getIpIfPossible(url.getHost());
sUrl = new URL(url.getProtocol(),host,url.getPort(),pServletPath).toExternalForm();
} catch (MalformedURLExc... | [
"private",
"String",
"getBaseUrl",
"(",
"String",
"pUrl",
",",
"String",
"pServletPath",
")",
"{",
"String",
"sUrl",
";",
"try",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"pUrl",
")",
";",
"String",
"host",
"=",
"getIpIfPossible",
"(",
"url",
".",
"ge... | Strip off everything unneeded | [
"Strip",
"off",
"everything",
"unneeded"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/AgentServlet.java#L389-L399 |
120,171 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | AgentServlet.getIpIfPossible | private String getIpIfPossible(String pHost) {
try {
InetAddress address = InetAddress.getByName(pHost);
return address.getHostAddress();
} catch (UnknownHostException e) {
return pHost;
}
} | java | private String getIpIfPossible(String pHost) {
try {
InetAddress address = InetAddress.getByName(pHost);
return address.getHostAddress();
} catch (UnknownHostException e) {
return pHost;
}
} | [
"private",
"String",
"getIpIfPossible",
"(",
"String",
"pHost",
")",
"{",
"try",
"{",
"InetAddress",
"address",
"=",
"InetAddress",
".",
"getByName",
"(",
"pHost",
")",
";",
"return",
"address",
".",
"getHostAddress",
"(",
")",
";",
"}",
"catch",
"(",
"Unk... | Check for an IP, since this seems to be safer to return then a plain name | [
"Check",
"for",
"an",
"IP",
"since",
"this",
"seems",
"to",
"be",
"safer",
"to",
"return",
"then",
"a",
"plain",
"name"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/AgentServlet.java#L402-L409 |
120,172 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | AgentServlet.plainReplacement | private String plainReplacement(String pUrl, String pServletPath) {
int idx = pUrl.lastIndexOf(pServletPath);
String url;
if (idx != -1) {
url = pUrl.substring(0,idx) + pServletPath;
} else {
url = pUrl;
}
return url;
} | java | private String plainReplacement(String pUrl, String pServletPath) {
int idx = pUrl.lastIndexOf(pServletPath);
String url;
if (idx != -1) {
url = pUrl.substring(0,idx) + pServletPath;
} else {
url = pUrl;
}
return url;
} | [
"private",
"String",
"plainReplacement",
"(",
"String",
"pUrl",
",",
"String",
"pServletPath",
")",
"{",
"int",
"idx",
"=",
"pUrl",
".",
"lastIndexOf",
"(",
"pServletPath",
")",
";",
"String",
"url",
";",
"if",
"(",
"idx",
"!=",
"-",
"1",
")",
"{",
"ur... | Fallback used if URL creation didnt work | [
"Fallback",
"used",
"if",
"URL",
"creation",
"didnt",
"work"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/AgentServlet.java#L412-L421 |
120,173 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | AgentServlet.setCorsHeader | private void setCorsHeader(HttpServletRequest pReq, HttpServletResponse pResp) {
String origin = requestHandler.extractCorsOrigin(pReq.getHeader("Origin"));
if (origin != null) {
pResp.setHeader("Access-Control-Allow-Origin", origin);
pResp.setHeader("Access-Control-Allow-Credent... | java | private void setCorsHeader(HttpServletRequest pReq, HttpServletResponse pResp) {
String origin = requestHandler.extractCorsOrigin(pReq.getHeader("Origin"));
if (origin != null) {
pResp.setHeader("Access-Control-Allow-Origin", origin);
pResp.setHeader("Access-Control-Allow-Credent... | [
"private",
"void",
"setCorsHeader",
"(",
"HttpServletRequest",
"pReq",
",",
"HttpServletResponse",
"pResp",
")",
"{",
"String",
"origin",
"=",
"requestHandler",
".",
"extractCorsOrigin",
"(",
"pReq",
".",
"getHeader",
"(",
"\"Origin\"",
")",
")",
";",
"if",
"(",... | Set an appropriate CORS header if requested and if allowed | [
"Set",
"an",
"appropriate",
"CORS",
"header",
"if",
"requested",
"and",
"if",
"allowed"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/AgentServlet.java#L424-L430 |
120,174 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | AgentServlet.newPostHttpRequestHandler | private ServletRequestHandler newPostHttpRequestHandler() {
return new ServletRequestHandler() {
/** {@inheritDoc} */
public JSONAware handleRequest(HttpServletRequest pReq, HttpServletResponse pResp)
throws IOException {
String encoding = pReq.getCh... | java | private ServletRequestHandler newPostHttpRequestHandler() {
return new ServletRequestHandler() {
/** {@inheritDoc} */
public JSONAware handleRequest(HttpServletRequest pReq, HttpServletResponse pResp)
throws IOException {
String encoding = pReq.getCh... | [
"private",
"ServletRequestHandler",
"newPostHttpRequestHandler",
"(",
")",
"{",
"return",
"new",
"ServletRequestHandler",
"(",
")",
"{",
"/** {@inheritDoc} */",
"public",
"JSONAware",
"handleRequest",
"(",
"HttpServletRequest",
"pReq",
",",
"HttpServletResponse",
"pResp",
... | factory method for POST request handler | [
"factory",
"method",
"for",
"POST",
"request",
"handler"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/AgentServlet.java#L453-L463 |
120,175 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | AgentServlet.newGetHttpRequestHandler | private ServletRequestHandler newGetHttpRequestHandler() {
return new ServletRequestHandler() {
/** {@inheritDoc} */
public JSONAware handleRequest(HttpServletRequest pReq, HttpServletResponse pResp) {
return requestHandler.handleGetRequest(pReq.getRequestURI(),pReq.getPa... | java | private ServletRequestHandler newGetHttpRequestHandler() {
return new ServletRequestHandler() {
/** {@inheritDoc} */
public JSONAware handleRequest(HttpServletRequest pReq, HttpServletResponse pResp) {
return requestHandler.handleGetRequest(pReq.getRequestURI(),pReq.getPa... | [
"private",
"ServletRequestHandler",
"newGetHttpRequestHandler",
"(",
")",
"{",
"return",
"new",
"ServletRequestHandler",
"(",
")",
"{",
"/** {@inheritDoc} */",
"public",
"JSONAware",
"handleRequest",
"(",
"HttpServletRequest",
"pReq",
",",
"HttpServletResponse",
"pResp",
... | factory method for GET request handler | [
"factory",
"method",
"for",
"GET",
"request",
"handler"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/AgentServlet.java#L466-L473 |
120,176 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | AgentServlet.initConfig | Configuration initConfig(ServletConfig pConfig) {
Configuration config = new Configuration(
ConfigKey.AGENT_ID, NetworkUtil.getAgentId(hashCode(),"servlet"));
// From ServletContext ....
config.updateGlobalConfiguration(new ServletConfigFacade(pConfig));
// ... and Servle... | java | Configuration initConfig(ServletConfig pConfig) {
Configuration config = new Configuration(
ConfigKey.AGENT_ID, NetworkUtil.getAgentId(hashCode(),"servlet"));
// From ServletContext ....
config.updateGlobalConfiguration(new ServletConfigFacade(pConfig));
// ... and Servle... | [
"Configuration",
"initConfig",
"(",
"ServletConfig",
"pConfig",
")",
"{",
"Configuration",
"config",
"=",
"new",
"Configuration",
"(",
"ConfigKey",
".",
"AGENT_ID",
",",
"NetworkUtil",
".",
"getAgentId",
"(",
"hashCode",
"(",
")",
",",
"\"servlet\"",
")",
")",
... | Configuration from the servlet context overrides servlet parameters defined in web.xml | [
"Configuration",
"from",
"the",
"servlet",
"context",
"overrides",
"servlet",
"parameters",
"defined",
"in",
"web",
".",
"xml"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/AgentServlet.java#L498-L509 |
120,177 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/ArrayExtractor.java | ArrayExtractor.setObjectValue | public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pIndex, Object pValue)
throws IllegalAccessException, InvocationTargetException {
Class clazz = pInner.getClass();
if (!clazz.isArray()) {
throw new IllegalArgumentException("Not an array to s... | java | public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pIndex, Object pValue)
throws IllegalAccessException, InvocationTargetException {
Class clazz = pInner.getClass();
if (!clazz.isArray()) {
throw new IllegalArgumentException("Not an array to s... | [
"public",
"Object",
"setObjectValue",
"(",
"StringToObjectConverter",
"pConverter",
",",
"Object",
"pInner",
",",
"String",
"pIndex",
",",
"Object",
"pValue",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"Class",
"clazz",
"=",
"pInne... | Set a value in an array
@param pConverter the global converter in order to be able do dispatch for
serializing inner data types
@param pInner object on which to set the value (which must be a {@link List})
@param pIndex index (as string) where to set the value within the array
@param pValue the new value to set
@retu... | [
"Set",
"a",
"value",
"in",
"an",
"array"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ArrayExtractor.java#L82-L101 |
120,178 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/VirtualMachineHandler.java | VirtualMachineHandler.detachAgent | public void detachAgent(Object pVm) {
try {
if (pVm != null) {
Class clazz = pVm.getClass();
Method method = clazz.getMethod("detach");
method.setAccessible(true); // on J9 you get IllegalAccessException otherwise.
method.invoke(pVm);
... | java | public void detachAgent(Object pVm) {
try {
if (pVm != null) {
Class clazz = pVm.getClass();
Method method = clazz.getMethod("detach");
method.setAccessible(true); // on J9 you get IllegalAccessException otherwise.
method.invoke(pVm);
... | [
"public",
"void",
"detachAgent",
"(",
"Object",
"pVm",
")",
"{",
"try",
"{",
"if",
"(",
"pVm",
"!=",
"null",
")",
"{",
"Class",
"clazz",
"=",
"pVm",
".",
"getClass",
"(",
")",
";",
"Method",
"method",
"=",
"clazz",
".",
"getMethod",
"(",
"\"detach\""... | Detach from the virtual machine
@param pVm the virtual machine to detach from | [
"Detach",
"from",
"the",
"virtual",
"machine"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/VirtualMachineHandler.java#L92-L107 |
120,179 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/VirtualMachineHandler.java | VirtualMachineHandler.listProcesses | public List<ProcessDescription> listProcesses() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
List<ProcessDescription> ret = new ArrayList<ProcessDescription>();
Class vmClass = lookupVirtualMachineClass();
Method method = vmClass.getMethod("list");
Li... | java | public List<ProcessDescription> listProcesses() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
List<ProcessDescription> ret = new ArrayList<ProcessDescription>();
Class vmClass = lookupVirtualMachineClass();
Method method = vmClass.getMethod("list");
Li... | [
"public",
"List",
"<",
"ProcessDescription",
">",
"listProcesses",
"(",
")",
"throws",
"NoSuchMethodException",
",",
"InvocationTargetException",
",",
"IllegalAccessException",
"{",
"List",
"<",
"ProcessDescription",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"ProcessD... | Return a list of all Java processes
@return list of java processes
@throws NoSuchMethodException reflection error
@throws InvocationTargetException reflection error
@throws IllegalAccessException reflection error | [
"Return",
"a",
"list",
"of",
"all",
"Java",
"processes"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/VirtualMachineHandler.java#L116-L129 |
120,180 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/VirtualMachineHandler.java | VirtualMachineHandler.findProcess | public ProcessDescription findProcess(Pattern pPattern)
throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
List<ProcessDescription> ret = new ArrayList<ProcessDescription>();
String ownId = getOwnProcessId();
for (ProcessDescription desc : listProcesse... | java | public ProcessDescription findProcess(Pattern pPattern)
throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
List<ProcessDescription> ret = new ArrayList<ProcessDescription>();
String ownId = getOwnProcessId();
for (ProcessDescription desc : listProcesse... | [
"public",
"ProcessDescription",
"findProcess",
"(",
"Pattern",
"pPattern",
")",
"throws",
"InvocationTargetException",
",",
"NoSuchMethodException",
",",
"IllegalAccessException",
"{",
"List",
"<",
"ProcessDescription",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"Process... | Filter the process list for a regular expression and returns the description. The process this
JVM is running in is ignored. If more than one process or no process is found, an exception
is raised.
@param pPattern regular expression to match
@return a process description of the one process found but never null
@throws... | [
"Filter",
"the",
"process",
"list",
"for",
"a",
"regular",
"expression",
"and",
"returns",
"the",
"description",
".",
"The",
"process",
"this",
"JVM",
"is",
"running",
"in",
"is",
"ignored",
".",
"If",
"more",
"than",
"one",
"process",
"or",
"no",
"process... | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/VirtualMachineHandler.java#L140-L163 |
120,181 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/VirtualMachineHandler.java | VirtualMachineHandler.getOwnProcessId | private String getOwnProcessId() {
// Format of name is : <pid>@<host>
String name = ManagementFactory.getRuntimeMXBean().getName();
int endIdx = name.indexOf('@');
return endIdx != -1 ? name.substring(0,endIdx) : name;
} | java | private String getOwnProcessId() {
// Format of name is : <pid>@<host>
String name = ManagementFactory.getRuntimeMXBean().getName();
int endIdx = name.indexOf('@');
return endIdx != -1 ? name.substring(0,endIdx) : name;
} | [
"private",
"String",
"getOwnProcessId",
"(",
")",
"{",
"// Format of name is : <pid>@<host>",
"String",
"name",
"=",
"ManagementFactory",
".",
"getRuntimeMXBean",
"(",
")",
".",
"getName",
"(",
")",
";",
"int",
"endIdx",
"=",
"name",
".",
"indexOf",
"(",
"'",
... | whole agent, so it should be safe | [
"whole",
"agent",
"so",
"it",
"should",
"be",
"safe"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/VirtualMachineHandler.java#L188-L193 |
120,182 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/VirtualMachineHandler.java | VirtualMachineHandler.lookupVirtualMachineClass | private Class lookupVirtualMachineClass() {
try {
return ToolsClassFinder.lookupClass("com.sun.tools.attach.VirtualMachine");
} catch (ClassNotFoundException exp) {
throw new ProcessingException(
"Cannot find classes from tools.jar. The heuristics for loading ... | java | private Class lookupVirtualMachineClass() {
try {
return ToolsClassFinder.lookupClass("com.sun.tools.attach.VirtualMachine");
} catch (ClassNotFoundException exp) {
throw new ProcessingException(
"Cannot find classes from tools.jar. The heuristics for loading ... | [
"private",
"Class",
"lookupVirtualMachineClass",
"(",
")",
"{",
"try",
"{",
"return",
"ToolsClassFinder",
".",
"lookupClass",
"(",
"\"com.sun.tools.attach.VirtualMachine\"",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"exp",
")",
"{",
"throw",
"new",
"Pro... | lookup virtual machine class | [
"lookup",
"virtual",
"machine",
"class"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/VirtualMachineHandler.java#L196-L210 |
120,183 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/MBeanServers.java | MBeanServers.handleNotification | public synchronized void handleNotification(Notification notification, Object handback) {
String type = notification.getType();
if (REGISTRATION_NOTIFICATION.equals(type)) {
jolokiaMBeanServer = lookupJolokiaMBeanServer();
// We need to add the listener provided during constructi... | java | public synchronized void handleNotification(Notification notification, Object handback) {
String type = notification.getType();
if (REGISTRATION_NOTIFICATION.equals(type)) {
jolokiaMBeanServer = lookupJolokiaMBeanServer();
// We need to add the listener provided during constructi... | [
"public",
"synchronized",
"void",
"handleNotification",
"(",
"Notification",
"notification",
",",
"Object",
"handback",
")",
"{",
"String",
"type",
"=",
"notification",
".",
"getType",
"(",
")",
";",
"if",
"(",
"REGISTRATION_NOTIFICATION",
".",
"equals",
"(",
"t... | Fetch Jolokia MBeanServer when it gets registered, remove it if being unregistered
@param notification notification emitted
@param handback not used here | [
"Fetch",
"Jolokia",
"MBeanServer",
"when",
"it",
"gets",
"registered",
"remove",
"it",
"if",
"being",
"unregistered"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/MBeanServers.java#L77-L95 |
120,184 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/MBeanServers.java | MBeanServers.lookupJolokiaMBeanServer | private MBeanServer lookupJolokiaMBeanServer() {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
try {
return server.isRegistered(JOLOKIA_MBEAN_SERVER_ONAME) ?
(MBeanServer) server.getAttribute(JOLOKIA_MBEAN_SERVER_ONAME, "JolokiaMBeanServer") :
... | java | private MBeanServer lookupJolokiaMBeanServer() {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
try {
return server.isRegistered(JOLOKIA_MBEAN_SERVER_ONAME) ?
(MBeanServer) server.getAttribute(JOLOKIA_MBEAN_SERVER_ONAME, "JolokiaMBeanServer") :
... | [
"private",
"MBeanServer",
"lookupJolokiaMBeanServer",
"(",
")",
"{",
"MBeanServer",
"server",
"=",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
";",
"try",
"{",
"return",
"server",
".",
"isRegistered",
"(",
"JOLOKIA_MBEAN_SERVER_ONAME",
")",
"?",
"(... | Check, whether the Jolokia MBean Server is available and return it. | [
"Check",
"whether",
"the",
"Jolokia",
"MBean",
"Server",
"is",
"available",
"and",
"return",
"it",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/MBeanServers.java#L133-L142 |
120,185 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/restrictor/policy/AbstractChecker.java | AbstractChecker.assertNodeName | protected void assertNodeName(Node pNode, String ... pExpected) {
for (String expected : pExpected) {
if (pNode.getNodeName().equals(expected)) {
return;
}
}
StringBuilder buffer = new StringBuilder();
for (int i=0; i < pExpected.length; i++) {
... | java | protected void assertNodeName(Node pNode, String ... pExpected) {
for (String expected : pExpected) {
if (pNode.getNodeName().equals(expected)) {
return;
}
}
StringBuilder buffer = new StringBuilder();
for (int i=0; i < pExpected.length; i++) {
... | [
"protected",
"void",
"assertNodeName",
"(",
"Node",
"pNode",
",",
"String",
"...",
"pExpected",
")",
"{",
"for",
"(",
"String",
"expected",
":",
"pExpected",
")",
"{",
"if",
"(",
"pNode",
".",
"getNodeName",
"(",
")",
".",
"equals",
"(",
"expected",
")",... | Verify that a given node has one of a set of expected node names
@param pNode node to check
@param pExpected list of expected node names
@throws SecurityException if the node has none of the expected names | [
"Verify",
"that",
"a",
"given",
"node",
"has",
"one",
"of",
"a",
"set",
"of",
"expected",
"node",
"names"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/restrictor/policy/AbstractChecker.java#L38-L53 |
120,186 | rhuss/jolokia | agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServer.java | JolokiaMBeanServer.extractJsonMBeanAnnotation | private JsonMBean extractJsonMBeanAnnotation(Object object) {
// Try directly
Class<?> clazz = object.getClass();
JsonMBean anno = clazz.getAnnotation(JsonMBean.class);
if (anno == null && ModelMBean.class.isAssignableFrom(object.getClass())) {
// For ModelMBean we try some ... | java | private JsonMBean extractJsonMBeanAnnotation(Object object) {
// Try directly
Class<?> clazz = object.getClass();
JsonMBean anno = clazz.getAnnotation(JsonMBean.class);
if (anno == null && ModelMBean.class.isAssignableFrom(object.getClass())) {
// For ModelMBean we try some ... | [
"private",
"JsonMBean",
"extractJsonMBeanAnnotation",
"(",
"Object",
"object",
")",
"{",
"// Try directly",
"Class",
"<",
"?",
">",
"clazz",
"=",
"object",
".",
"getClass",
"(",
")",
";",
"JsonMBean",
"anno",
"=",
"clazz",
".",
"getAnnotation",
"(",
"JsonMBean... | Lookup a JsonMBean annotation | [
"Lookup",
"a",
"JsonMBean",
"annotation"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServer.java#L91-L118 |
120,187 | rhuss/jolokia | agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServer.java | JolokiaMBeanServer.findField | private Field findField(Class<?> pClazz, String pField) {
Class c = pClazz;
do {
try {
return c.getDeclaredField(pField);
} catch (NoSuchFieldException e) {
c = pClazz.getSuperclass();
}
} while (c != null);
return null;... | java | private Field findField(Class<?> pClazz, String pField) {
Class c = pClazz;
do {
try {
return c.getDeclaredField(pField);
} catch (NoSuchFieldException e) {
c = pClazz.getSuperclass();
}
} while (c != null);
return null;... | [
"private",
"Field",
"findField",
"(",
"Class",
"<",
"?",
">",
"pClazz",
",",
"String",
"pField",
")",
"{",
"Class",
"c",
"=",
"pClazz",
";",
"do",
"{",
"try",
"{",
"return",
"c",
".",
"getDeclaredField",
"(",
"pField",
")",
";",
"}",
"catch",
"(",
... | Find a field in an inheritance hierarchy | [
"Find",
"a",
"field",
"in",
"an",
"inheritance",
"hierarchy"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServer.java#L121-L131 |
120,188 | rhuss/jolokia | agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServer.java | JolokiaMBeanServer.toJson | String toJson(Object object, JsonConvertOptions pConvertOptions) {
try {
Object ret = converters.getToJsonConverter().convertToJson(object,null,pConvertOptions);
return ret.toString();
} catch (AttributeNotFoundException exp) {
// Cannot happen, since we dont use a pa... | java | String toJson(Object object, JsonConvertOptions pConvertOptions) {
try {
Object ret = converters.getToJsonConverter().convertToJson(object,null,pConvertOptions);
return ret.toString();
} catch (AttributeNotFoundException exp) {
// Cannot happen, since we dont use a pa... | [
"String",
"toJson",
"(",
"Object",
"object",
",",
"JsonConvertOptions",
"pConvertOptions",
")",
"{",
"try",
"{",
"Object",
"ret",
"=",
"converters",
".",
"getToJsonConverter",
"(",
")",
".",
"convertToJson",
"(",
"object",
",",
"null",
",",
"pConvertOptions",
... | Converter used by JsonMBean for converting from Object to JSON representation
@param object object to serialize
@param pConvertOptions options used for conversion
@return serialized object | [
"Converter",
"used",
"by",
"JsonMBean",
"for",
"converting",
"from",
"Object",
"to",
"JSON",
"representation"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServer.java#L149-L157 |
120,189 | rhuss/jolokia | agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServer.java | JolokiaMBeanServer.getJsonConverterOptions | private JsonConvertOptions getJsonConverterOptions(JsonMBean pAnno) {
// Extract conversion options from the annotation
if (pAnno == null) {
return JsonConvertOptions.DEFAULT;
} else {
ValueFaultHandler faultHandler =
pAnno.faultHandling() == JsonMBean... | java | private JsonConvertOptions getJsonConverterOptions(JsonMBean pAnno) {
// Extract conversion options from the annotation
if (pAnno == null) {
return JsonConvertOptions.DEFAULT;
} else {
ValueFaultHandler faultHandler =
pAnno.faultHandling() == JsonMBean... | [
"private",
"JsonConvertOptions",
"getJsonConverterOptions",
"(",
"JsonMBean",
"pAnno",
")",
"{",
"// Extract conversion options from the annotation",
"if",
"(",
"pAnno",
"==",
"null",
")",
"{",
"return",
"JsonConvertOptions",
".",
"DEFAULT",
";",
"}",
"else",
"{",
"Va... | Extract convert options from annotation | [
"Extract",
"convert",
"options",
"from",
"annotation"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServer.java#L183-L199 |
120,190 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServerConfig.java | JolokiaServerConfig.init | protected void init(Map<String, String> pConfig) {
Map<String, String> finalCfg = getDefaultConfig(pConfig);
finalCfg.putAll(pConfig);
prepareDetectorOptions(finalCfg);
addJolokiaId(finalCfg);
jolokiaConfig = new Configuration();
jolokiaConfig.updateGlobalConfiguration(... | java | protected void init(Map<String, String> pConfig) {
Map<String, String> finalCfg = getDefaultConfig(pConfig);
finalCfg.putAll(pConfig);
prepareDetectorOptions(finalCfg);
addJolokiaId(finalCfg);
jolokiaConfig = new Configuration();
jolokiaConfig.updateGlobalConfiguration(... | [
"protected",
"void",
"init",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"pConfig",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"finalCfg",
"=",
"getDefaultConfig",
"(",
"pConfig",
")",
";",
"finalCfg",
".",
"putAll",
"(",
"pConfig",
")",
";... | Initialize the configuration with the given map
@param pConfig map holding the configuration in string representation. A reference to the map will be kept | [
"Initialize",
"the",
"configuration",
"with",
"the",
"given",
"map"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServerConfig.java#L102-L112 |
120,191 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServerConfig.java | JolokiaServerConfig.addJolokiaId | private void addJolokiaId(Map<String, String> pFinalCfg) {
if (!pFinalCfg.containsKey(ConfigKey.AGENT_ID.getKeyValue())) {
pFinalCfg.put(ConfigKey.AGENT_ID.getKeyValue(), NetworkUtil.getAgentId(hashCode(),"jvm"));
}
pFinalCfg.put(ConfigKey.AGENT_TYPE.getKeyValue(), "jvm");
} | java | private void addJolokiaId(Map<String, String> pFinalCfg) {
if (!pFinalCfg.containsKey(ConfigKey.AGENT_ID.getKeyValue())) {
pFinalCfg.put(ConfigKey.AGENT_ID.getKeyValue(), NetworkUtil.getAgentId(hashCode(),"jvm"));
}
pFinalCfg.put(ConfigKey.AGENT_TYPE.getKeyValue(), "jvm");
} | [
"private",
"void",
"addJolokiaId",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"pFinalCfg",
")",
"{",
"if",
"(",
"!",
"pFinalCfg",
".",
"containsKey",
"(",
"ConfigKey",
".",
"AGENT_ID",
".",
"getKeyValue",
"(",
")",
")",
")",
"{",
"pFinalCfg",
".",
... | Add a unique jolokia id for this agent | [
"Add",
"a",
"unique",
"jolokia",
"id",
"for",
"this",
"agent"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServerConfig.java#L115-L120 |
120,192 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServerConfig.java | JolokiaServerConfig.updateHTTPSSettingsFromContext | public void updateHTTPSSettingsFromContext(SSLContext sslContext) {
SSLParameters parameters = sslContext.getSupportedSSLParameters();
// Protocols
if (sslProtocols == null) {
sslProtocols = parameters.getProtocols();
} else {
List<String> supportedProtocols = Ar... | java | public void updateHTTPSSettingsFromContext(SSLContext sslContext) {
SSLParameters parameters = sslContext.getSupportedSSLParameters();
// Protocols
if (sslProtocols == null) {
sslProtocols = parameters.getProtocols();
} else {
List<String> supportedProtocols = Ar... | [
"public",
"void",
"updateHTTPSSettingsFromContext",
"(",
"SSLContext",
"sslContext",
")",
"{",
"SSLParameters",
"parameters",
"=",
"sslContext",
".",
"getSupportedSSLParameters",
"(",
")",
";",
"// Protocols",
"if",
"(",
"sslProtocols",
"==",
"null",
")",
"{",
"sslP... | Filter the list of protocols and ciphers to those supported by the given SSLContext
@param sslContext the SSLContext to pull information from | [
"Filter",
"the",
"list",
"of",
"protocols",
"and",
"ciphers",
"to",
"those",
"supported",
"by",
"the",
"given",
"SSLContext"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServerConfig.java#L313-L351 |
120,193 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServerConfig.java | JolokiaServerConfig.initConfigAndValidate | protected void initConfigAndValidate(Map<String,String> agentConfig) {
initContext();
initProtocol(agentConfig);
initAddress(agentConfig);
port = Integer.parseInt(agentConfig.get("port"));
backlog = Integer.parseInt(agentConfig.get("backlog"));
initExecutor(agentConfig);
... | java | protected void initConfigAndValidate(Map<String,String> agentConfig) {
initContext();
initProtocol(agentConfig);
initAddress(agentConfig);
port = Integer.parseInt(agentConfig.get("port"));
backlog = Integer.parseInt(agentConfig.get("backlog"));
initExecutor(agentConfig);
... | [
"protected",
"void",
"initConfigAndValidate",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"agentConfig",
")",
"{",
"initContext",
"(",
")",
";",
"initProtocol",
"(",
"agentConfig",
")",
";",
"initAddress",
"(",
"agentConfig",
")",
";",
"port",
"=",
"Integ... | Initialise and validate early in order to fail fast in case of an configuration error | [
"Initialise",
"and",
"validate",
"early",
"in",
"order",
"to",
"fail",
"fast",
"in",
"case",
"of",
"an",
"configuration",
"error"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServerConfig.java#L354-L365 |
120,194 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServerConfig.java | JolokiaServerConfig.extractList | private List<String> extractList(Map<String, String> pAgentConfig, String pKey) {
List<String> ret = new ArrayList<String>();
if (pAgentConfig.containsKey(pKey)) {
ret.add(pAgentConfig.get(pKey));
}
int idx = 1;
String keyIdx = pKey + "." + idx;
while (pAgentC... | java | private List<String> extractList(Map<String, String> pAgentConfig, String pKey) {
List<String> ret = new ArrayList<String>();
if (pAgentConfig.containsKey(pKey)) {
ret.add(pAgentConfig.get(pKey));
}
int idx = 1;
String keyIdx = pKey + "." + idx;
while (pAgentC... | [
"private",
"List",
"<",
"String",
">",
"extractList",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"pAgentConfig",
",",
"String",
"pKey",
")",
"{",
"List",
"<",
"String",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"if",... | More elements can be given with ".1", ".2", ... added. | [
"More",
"elements",
"can",
"be",
"given",
"with",
".",
"1",
".",
"2",
"...",
"added",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServerConfig.java#L536-L548 |
120,195 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServerConfig.java | JolokiaServerConfig.prepareDetectorOptions | protected void prepareDetectorOptions(Map<String, String> pConfig) {
StringBuffer detectorOpts = new StringBuffer("{");
if (pConfig.containsKey("bootAmx") && Boolean.parseBoolean(pConfig.get("bootAmx"))) {
detectorOpts.append("\"glassfish\" : { \"bootAmx\" : true }");
}
if (d... | java | protected void prepareDetectorOptions(Map<String, String> pConfig) {
StringBuffer detectorOpts = new StringBuffer("{");
if (pConfig.containsKey("bootAmx") && Boolean.parseBoolean(pConfig.get("bootAmx"))) {
detectorOpts.append("\"glassfish\" : { \"bootAmx\" : true }");
}
if (d... | [
"protected",
"void",
"prepareDetectorOptions",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"pConfig",
")",
"{",
"StringBuffer",
"detectorOpts",
"=",
"new",
"StringBuffer",
"(",
"\"{\"",
")",
";",
"if",
"(",
"pConfig",
".",
"containsKey",
"(",
"\"bootAmx\"",... | Add detector specific options if given on the command line | [
"Add",
"detector",
"specific",
"options",
"if",
"given",
"on",
"the",
"command",
"line"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServerConfig.java#L604-L613 |
120,196 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/detector/ServerHandle.java | ServerHandle.registerMBeanAtServer | public ObjectName registerMBeanAtServer(MBeanServer pServer, Object pMBean, String pName)
throws MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException, MalformedObjectNameException {
if (pName != null) {
ObjectName oName = new ObjectName(pName);
... | java | public ObjectName registerMBeanAtServer(MBeanServer pServer, Object pMBean, String pName)
throws MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException, MalformedObjectNameException {
if (pName != null) {
ObjectName oName = new ObjectName(pName);
... | [
"public",
"ObjectName",
"registerMBeanAtServer",
"(",
"MBeanServer",
"pServer",
",",
"Object",
"pMBean",
",",
"String",
"pName",
")",
"throws",
"MBeanRegistrationException",
",",
"InstanceAlreadyExistsException",
",",
"NotCompliantMBeanException",
",",
"MalformedObjectNameExc... | Register a MBean at the dedicated server. This method can be overridden if
something special registration procedure is required, like for using the
specific name for the registration or deligating the namin to MBean to register.
@param pServer server an MBean should be registered
@param pMBean the MBean to register
@p... | [
"Register",
"a",
"MBean",
"at",
"the",
"dedicated",
"server",
".",
"This",
"method",
"can",
"be",
"overridden",
"if",
"something",
"special",
"registration",
"procedure",
"is",
"required",
"like",
"for",
"using",
"the",
"specific",
"name",
"for",
"the",
"regis... | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/ServerHandle.java#L144-L153 |
120,197 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/detector/ServerHandle.java | ServerHandle.toJSONObject | public JSONObject toJSONObject(MBeanServerExecutor pServerManager) {
JSONObject ret = new JSONObject();
addNullSafe(ret, "vendor", vendor);
addNullSafe(ret, "product", product);
addNullSafe(ret, "version", version);
Map<String,String> extra = getExtraInfo(pServerManager);
... | java | public JSONObject toJSONObject(MBeanServerExecutor pServerManager) {
JSONObject ret = new JSONObject();
addNullSafe(ret, "vendor", vendor);
addNullSafe(ret, "product", product);
addNullSafe(ret, "version", version);
Map<String,String> extra = getExtraInfo(pServerManager);
... | [
"public",
"JSONObject",
"toJSONObject",
"(",
"MBeanServerExecutor",
"pServerManager",
")",
"{",
"JSONObject",
"ret",
"=",
"new",
"JSONObject",
"(",
")",
";",
"addNullSafe",
"(",
"ret",
",",
"\"vendor\"",
",",
"vendor",
")",
";",
"addNullSafe",
"(",
"ret",
",",... | Return this info as an JSONObject
@param pServerManager servers, for which dynamic part might be queried
@return this object in JSON representation | [
"Return",
"this",
"info",
"as",
"an",
"JSONObject"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/ServerHandle.java#L163-L177 |
120,198 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/detector/ServerHandle.java | ServerHandle.getDetectorOptions | protected JSONObject getDetectorOptions(Configuration pConfig, LogHandler pLogHandler) {
String options = pConfig.get(ConfigKey.DETECTOR_OPTIONS);
try {
if (options != null) {
JSONObject opts = (JSONObject) new JSONParser().parse(options);
return (JSON... | java | protected JSONObject getDetectorOptions(Configuration pConfig, LogHandler pLogHandler) {
String options = pConfig.get(ConfigKey.DETECTOR_OPTIONS);
try {
if (options != null) {
JSONObject opts = (JSONObject) new JSONParser().parse(options);
return (JSON... | [
"protected",
"JSONObject",
"getDetectorOptions",
"(",
"Configuration",
"pConfig",
",",
"LogHandler",
"pLogHandler",
")",
"{",
"String",
"options",
"=",
"pConfig",
".",
"get",
"(",
"ConfigKey",
".",
"DETECTOR_OPTIONS",
")",
";",
"try",
"{",
"if",
"(",
"options",
... | Get the optional options used for detectors. This should be a JSON string specifying all options
for all detectors. Keys are the name of the detector's product, the values are JSON object containing
specific parameters for this agent. E.g.
<pre>
{
"glassfish" : { "bootAmx": true }
}
</pre>
@param pConfig the agent ... | [
"Get",
"the",
"optional",
"options",
"used",
"for",
"detectors",
".",
"This",
"should",
"be",
"a",
"JSON",
"string",
"specifying",
"all",
"options",
"for",
"all",
"detectors",
".",
"Keys",
"are",
"the",
"name",
"of",
"the",
"detector",
"s",
"product",
"the... | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/ServerHandle.java#L201-L213 |
120,199 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JvmAgentConfig.java | JvmAgentConfig.getDefaultConfig | @Override
protected Map<String, String> getDefaultConfig(Map<String,String> pConfig) {
Map<String,String> config = super.getDefaultConfig(pConfig);
if (pConfig.containsKey("config")) {
config.putAll(readConfig(pConfig.get("config")));
}
return config;
} | java | @Override
protected Map<String, String> getDefaultConfig(Map<String,String> pConfig) {
Map<String,String> config = super.getDefaultConfig(pConfig);
if (pConfig.containsKey("config")) {
config.putAll(readConfig(pConfig.get("config")));
}
return config;
} | [
"@",
"Override",
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"getDefaultConfig",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"pConfig",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"config",
"=",
"super",
".",
"getDefaultConfig",
"("... | Beside reading the default configuration from an internal property file,
also add extra configuration given in an external properties where the path
to this property file is given under the key "config"
@param pConfig the configuration provided during construction
@return the default configuration used as fallback | [
"Beside",
"reading",
"the",
"default",
"configuration",
"from",
"an",
"internal",
"property",
"file",
"also",
"add",
"extra",
"configuration",
"given",
"in",
"an",
"external",
"properties",
"where",
"the",
"path",
"to",
"this",
"property",
"file",
"is",
"given",... | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JvmAgentConfig.java#L93-L100 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.