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,200
rhuss/jolokia
agent/jvm/src/main/java/org/jolokia/jvmagent/JvmAgentConfig.java
JvmAgentConfig.split
private static Map<String, String> split(String pAgentArgs) { Map<String,String> ret = new HashMap<String, String>(); if (pAgentArgs != null && pAgentArgs.length() > 0) { for (String arg : EscapeUtil.splitAsArray(pAgentArgs, EscapeUtil.CSV_ESCAPE, ",")) { String[] prop = arg....
java
private static Map<String, String> split(String pAgentArgs) { Map<String,String> ret = new HashMap<String, String>(); if (pAgentArgs != null && pAgentArgs.length() > 0) { for (String arg : EscapeUtil.splitAsArray(pAgentArgs, EscapeUtil.CSV_ESCAPE, ",")) { String[] prop = arg....
[ "private", "static", "Map", "<", "String", ",", "String", ">", "split", "(", "String", "pAgentArgs", ")", "{", "Map", "<", "String", ",", "String", ">", "ret", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "if", "(", "pAg...
Split arguments into a map
[ "Split", "arguments", "into", "a", "map" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JvmAgentConfig.java#L106-L119
120,201
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/ServiceObjectFactory.java
ServiceObjectFactory.createServiceObjects
public static <T> List<T> createServiceObjects(String... pDescriptorPaths) { try { ServiceEntry.initDefaultOrder(); TreeMap<ServiceEntry,T> extractorMap = new TreeMap<ServiceEntry,T>(); for (String descriptor : pDescriptorPaths) { readServiceDefinitions(extrac...
java
public static <T> List<T> createServiceObjects(String... pDescriptorPaths) { try { ServiceEntry.initDefaultOrder(); TreeMap<ServiceEntry,T> extractorMap = new TreeMap<ServiceEntry,T>(); for (String descriptor : pDescriptorPaths) { readServiceDefinitions(extrac...
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "createServiceObjects", "(", "String", "...", "pDescriptorPaths", ")", "{", "try", "{", "ServiceEntry", ".", "initDefaultOrder", "(", ")", ";", "TreeMap", "<", "ServiceEntry", ",", "T", ">", "extrac...
Create a list of services ordered according to the ordering given in the service descriptor files. Note, that the descriptor will be looked up in the whole classpath space, which can result in reading in multiple descriptors with a single path. Note, that the reading order for multiple resources with the same name is n...
[ "Create", "a", "list", "of", "services", "ordered", "according", "to", "the", "ordering", "given", "in", "the", "service", "descriptor", "files", ".", "Note", "that", "the", "descriptor", "will", "be", "looked", "up", "in", "the", "whole", "classpath", "spac...
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/ServiceObjectFactory.java#L58-L73
120,202
rhuss/jolokia
client/java/src/main/java/org/jolokia/client/request/J4pReadResponse.java
J4pReadResponse.getObjectNames
public Collection<ObjectName> getObjectNames() throws MalformedObjectNameException { ObjectName mBean = getRequest().getObjectName(); if (mBean.isPattern()) { // The result value contains the list of fetched object names JSONObject values = getValue(); Set<ObjectName>...
java
public Collection<ObjectName> getObjectNames() throws MalformedObjectNameException { ObjectName mBean = getRequest().getObjectName(); if (mBean.isPattern()) { // The result value contains the list of fetched object names JSONObject values = getValue(); Set<ObjectName>...
[ "public", "Collection", "<", "ObjectName", ">", "getObjectNames", "(", ")", "throws", "MalformedObjectNameException", "{", "ObjectName", "mBean", "=", "getRequest", "(", ")", ".", "getObjectName", "(", ")", ";", "if", "(", "mBean", ".", "isPattern", "(", ")", ...
Get all MBean names for which the request fetched values. If the request contained an MBean pattern then all MBean names matching this pattern and which contained attributes of the given name are returned. If the MBean wasnt a pattern a single value collection with the single MBean name of the request is returned. @re...
[ "Get", "all", "MBean", "names", "for", "which", "the", "request", "fetched", "values", ".", "If", "the", "request", "contained", "an", "MBean", "pattern", "then", "all", "MBean", "names", "matching", "this", "pattern", "and", "which", "contained", "attributes"...
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/request/J4pReadResponse.java#L57-L70
120,203
rhuss/jolokia
client/java/src/main/java/org/jolokia/client/request/J4pTargetConfig.java
J4pTargetConfig.toJson
public JSONObject toJson() { JSONObject ret = new JSONObject(); ret.put("url",url); if (user != null) { ret.put("user",user); ret.put("password",password); } return ret; }
java
public JSONObject toJson() { JSONObject ret = new JSONObject(); ret.put("url",url); if (user != null) { ret.put("user",user); ret.put("password",password); } return ret; }
[ "public", "JSONObject", "toJson", "(", ")", "{", "JSONObject", "ret", "=", "new", "JSONObject", "(", ")", ";", "ret", ".", "put", "(", "\"url\"", ",", "url", ")", ";", "if", "(", "user", "!=", "null", ")", "{", "ret", ".", "put", "(", "\"user\"", ...
Get a JSON representation of this target configuration @return JSON representation of the target configuration
[ "Get", "a", "JSON", "representation", "of", "this", "target", "configuration" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/request/J4pTargetConfig.java#L65-L73
120,204
rhuss/jolokia
agent/core/src/main/java/org/jolokia/history/HistoryEntry.java
HistoryEntry.add
public void add(Object pObject, long pTime) { values.addFirst(new ValueEntry(pObject,pTime)); trim(); }
java
public void add(Object pObject, long pTime) { values.addFirst(new ValueEntry(pObject,pTime)); trim(); }
[ "public", "void", "add", "(", "Object", "pObject", ",", "long", "pTime", ")", "{", "values", ".", "addFirst", "(", "new", "ValueEntry", "(", "pObject", ",", "pTime", ")", ")", ";", "trim", "(", ")", ";", "}" ]
Add a new value with the given times stamp to the values list @param pObject object to add @param pTime timestamp in milliseconds
[ "Add", "a", "new", "value", "with", "the", "given", "times", "stamp", "to", "the", "values", "list" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/history/HistoryEntry.java#L96-L99
120,205
rhuss/jolokia
agent/core/src/main/java/org/jolokia/history/HistoryEntry.java
HistoryEntry.trim
private void trim() { // Trim while (values.size() > limit.getMaxEntries()) { values.removeLast(); } // Trim according to duration if (limit.getMaxDuration() > 0 && !values.isEmpty()) { long duration = limit.getMaxDuration(); long start = val...
java
private void trim() { // Trim while (values.size() > limit.getMaxEntries()) { values.removeLast(); } // Trim according to duration if (limit.getMaxDuration() > 0 && !values.isEmpty()) { long duration = limit.getMaxDuration(); long start = val...
[ "private", "void", "trim", "(", ")", "{", "// Trim", "while", "(", "values", ".", "size", "(", ")", ">", "limit", ".", "getMaxEntries", "(", ")", ")", "{", "values", ".", "removeLast", "(", ")", ";", "}", "// Trim according to duration", "if", "(", "li...
Truncate list so that no more than max entries are stored in the list
[ "Truncate", "list", "so", "that", "no", "more", "than", "max", "entries", "are", "stored", "in", "the", "list" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/history/HistoryEntry.java#L102-L117
120,206
rhuss/jolokia
agent/core/src/main/java/org/jolokia/backend/Config.java
Config.limitOrNull
private HistoryLimit limitOrNull(int pMaxEntries, long pMaxDuration) { return pMaxEntries != 0 || pMaxDuration != 0 ? new HistoryLimit(pMaxEntries, pMaxDuration) : null; }
java
private HistoryLimit limitOrNull(int pMaxEntries, long pMaxDuration) { return pMaxEntries != 0 || pMaxDuration != 0 ? new HistoryLimit(pMaxEntries, pMaxDuration) : null; }
[ "private", "HistoryLimit", "limitOrNull", "(", "int", "pMaxEntries", ",", "long", "pMaxDuration", ")", "{", "return", "pMaxEntries", "!=", "0", "||", "pMaxDuration", "!=", "0", "?", "new", "HistoryLimit", "(", "pMaxEntries", ",", "pMaxDuration", ")", ":", "nul...
The limit or null if the entry should be disabled in the history store
[ "The", "limit", "or", "null", "if", "the", "entry", "should", "be", "disabled", "in", "the", "history", "store" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/Config.java#L128-L130
120,207
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/IpChecker.java
IpChecker.matches
public static boolean matches(String pExpected, String pToCheck) { String[] parts = pExpected.split("/",2); if (parts.length == 1) { // No Net part given, check for equality ... // Check for valid ips convertToIntTuple(pExpected); convertToIntTuple(pToChec...
java
public static boolean matches(String pExpected, String pToCheck) { String[] parts = pExpected.split("/",2); if (parts.length == 1) { // No Net part given, check for equality ... // Check for valid ips convertToIntTuple(pExpected); convertToIntTuple(pToChec...
[ "public", "static", "boolean", "matches", "(", "String", "pExpected", ",", "String", "pToCheck", ")", "{", "String", "[", "]", "parts", "=", "pExpected", ".", "split", "(", "\"/\"", ",", "2", ")", ";", "if", "(", "parts", ".", "length", "==", "1", ")...
Check whether a given IP Adress falls within a subnet or is equal to @param pExpected either a simple IP adress (without "/") or a net specification including a netmask (e.g "/24" or "/255.255.255.0") @param pToCheck the ip address to check @return true if either the address to check is the same as the address expecte...
[ "Check", "whether", "a", "given", "IP", "Adress", "falls", "within", "a", "subnet", "or", "is", "equal", "to" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/IpChecker.java#L41-L67
120,208
rhuss/jolokia
agent/core/src/main/java/org/jolokia/request/ProxyTargetConfig.java
ProxyTargetConfig.toJSON
public JSONObject toJSON() { JSONObject ret = new JSONObject(); ret.put("url", url); if (env != null) { ret.put("env", env); } return ret; }
java
public JSONObject toJSON() { JSONObject ret = new JSONObject(); ret.put("url", url); if (env != null) { ret.put("env", env); } return ret; }
[ "public", "JSONObject", "toJSON", "(", ")", "{", "JSONObject", "ret", "=", "new", "JSONObject", "(", ")", ";", "ret", ".", "put", "(", "\"url\"", ",", "url", ")", ";", "if", "(", "env", "!=", "null", ")", "{", "ret", ".", "put", "(", "\"env\"", "...
As JSON representation @return JSON object representing this proxy configuration
[ "As", "JSON", "representation" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/ProxyTargetConfig.java#L82-L89
120,209
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/JmxUtil.java
JmxUtil.addMBeanRegistrationListener
public static void addMBeanRegistrationListener(MBeanServerConnection pServer, NotificationListener pListener, ObjectName pObjectNameToFilter) { MBeanServerNotificationFilter filter = new MBeanServerNotificationFilter(); if (pObjectNameToFilter == null...
java
public static void addMBeanRegistrationListener(MBeanServerConnection pServer, NotificationListener pListener, ObjectName pObjectNameToFilter) { MBeanServerNotificationFilter filter = new MBeanServerNotificationFilter(); if (pObjectNameToFilter == null...
[ "public", "static", "void", "addMBeanRegistrationListener", "(", "MBeanServerConnection", "pServer", ",", "NotificationListener", "pListener", ",", "ObjectName", "pObjectNameToFilter", ")", "{", "MBeanServerNotificationFilter", "filter", "=", "new", "MBeanServerNotificationFilt...
Register a notification listener which listens for registration and deregistration of MBeans at a certain server @param pServer server to register to @param pListener listener to register @param pObjectNameToFilter object name which should be listen for. If null, listens for any MBean registration
[ "Register", "a", "notification", "listener", "which", "listens", "for", "registration", "and", "deregistration", "of", "MBeans", "at", "a", "certain", "server" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/JmxUtil.java#L40-L55
120,210
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/JmxUtil.java
JmxUtil.removeMBeanRegistrationListener
public static void removeMBeanRegistrationListener(MBeanServerConnection pServer,NotificationListener pListener) { try { pServer.removeNotificationListener(JmxUtil.getMBeanServerDelegateName(), pListener); } catch (ListenerNotFoundException e) { // We silently ignore listeners no...
java
public static void removeMBeanRegistrationListener(MBeanServerConnection pServer,NotificationListener pListener) { try { pServer.removeNotificationListener(JmxUtil.getMBeanServerDelegateName(), pListener); } catch (ListenerNotFoundException e) { // We silently ignore listeners no...
[ "public", "static", "void", "removeMBeanRegistrationListener", "(", "MBeanServerConnection", "pServer", ",", "NotificationListener", "pListener", ")", "{", "try", "{", "pServer", ".", "removeNotificationListener", "(", "JmxUtil", ".", "getMBeanServerDelegateName", "(", ")...
Remove a notification listener from the given MBeanServer while listening for MBeanServer registration events @param pServer server from where to unregister @param pListener listener to unregister
[ "Remove", "a", "notification", "listener", "from", "the", "given", "MBeanServer", "while", "listening", "for", "MBeanServer", "registration", "events" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/JmxUtil.java#L62-L73
120,211
rhuss/jolokia
agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java
ObjectToJsonConverter.convertToJson
public Object convertToJson(Object pValue, List<String> pPathParts, JsonConvertOptions pOptions) throws AttributeNotFoundException { Stack<String> extraStack = pPathParts != null ? EscapeUtil.reversePath(pPathParts) : new Stack<String>(); return extractObjectWithContext(pValue, extraStack, p...
java
public Object convertToJson(Object pValue, List<String> pPathParts, JsonConvertOptions pOptions) throws AttributeNotFoundException { Stack<String> extraStack = pPathParts != null ? EscapeUtil.reversePath(pPathParts) : new Stack<String>(); return extractObjectWithContext(pValue, extraStack, p...
[ "public", "Object", "convertToJson", "(", "Object", "pValue", ",", "List", "<", "String", ">", "pPathParts", ",", "JsonConvertOptions", "pOptions", ")", "throws", "AttributeNotFoundException", "{", "Stack", "<", "String", ">", "extraStack", "=", "pPathParts", "!="...
Convert the return value to a JSON object. @param pValue the value to convert @param pPathParts path parts to use for extraction @param pOptions options used for parsing @return the converter object. This either a subclass of {@link org.json.simple.JSONAware} or a basic data type like String or Long. @throws Attribu...
[ "Convert", "the", "return", "value", "to", "a", "JSON", "object", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java#L108-L112
120,212
rhuss/jolokia
agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java
ObjectToJsonConverter.setObjectValue
private Object setObjectValue(Object pInner, String pAttribute, Object pValue) throws IllegalAccessException, InvocationTargetException { // Call various handlers depending on the type of the inner object, as is extract Object Class clazz = pInner.getClass(); if (clazz.isArray()) {...
java
private Object setObjectValue(Object pInner, String pAttribute, Object pValue) throws IllegalAccessException, InvocationTargetException { // Call various handlers depending on the type of the inner object, as is extract Object Class clazz = pInner.getClass(); if (clazz.isArray()) {...
[ "private", "Object", "setObjectValue", "(", "Object", "pInner", ",", "String", "pAttribute", ",", "Object", "pValue", ")", "throws", "IllegalAccessException", ",", "InvocationTargetException", "{", "// Call various handlers depending on the type of the inner object, as is extract...
Set an value of an inner object @param pInner the inner object @param pAttribute the attribute to set @param pValue the value to set @return the old value @throws IllegalAccessException if the reflection code fails during setting of the value @throws InvocationTargetException reflection error
[ "Set", "an", "value", "of", "an", "inner", "object" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java#L226-L244
120,213
rhuss/jolokia
agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java
ObjectToJsonConverter.setupContext
void setupContext(JsonConvertOptions pOpts) { ObjectSerializationContext stackContext = new ObjectSerializationContext(pOpts); stackContextLocal.set(stackContext); }
java
void setupContext(JsonConvertOptions pOpts) { ObjectSerializationContext stackContext = new ObjectSerializationContext(pOpts); stackContextLocal.set(stackContext); }
[ "void", "setupContext", "(", "JsonConvertOptions", "pOpts", ")", "{", "ObjectSerializationContext", "stackContext", "=", "new", "ObjectSerializationContext", "(", "pOpts", ")", ";", "stackContextLocal", ".", "set", "(", "stackContext", ")", ";", "}" ]
Setup the context with the limits given in the request or with the default limits if not. In all cases, hard limits as defined in the servlet configuration are never exceeded. @param pOpts options used for parsing.
[ "Setup", "the", "context", "with", "the", "limits", "given", "in", "the", "request", "or", "with", "the", "default", "limits", "if", "not", ".", "In", "all", "cases", "hard", "limits", "as", "defined", "in", "the", "servlet", "configuration", "are", "never...
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java#L290-L293
120,214
rhuss/jolokia
agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java
ObjectToJsonConverter.getExtractor
private Extractor getExtractor(Class pClazz) { for (Extractor handler : handlers) { if (handler.canSetValue() && handler.getType() != null && handler.getType().isAssignableFrom(pClazz)) { return handler; } } return null; }
java
private Extractor getExtractor(Class pClazz) { for (Extractor handler : handlers) { if (handler.canSetValue() && handler.getType() != null && handler.getType().isAssignableFrom(pClazz)) { return handler; } } return null; }
[ "private", "Extractor", "getExtractor", "(", "Class", "pClazz", ")", "{", "for", "(", "Extractor", "handler", ":", "handlers", ")", "{", "if", "(", "handler", ".", "canSetValue", "(", ")", "&&", "handler", ".", "getType", "(", ")", "!=", "null", "&&", ...
Get the extractor for a certain class
[ "Get", "the", "extractor", "for", "a", "certain", "class" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java#L298-L305
120,215
rhuss/jolokia
agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java
ObjectToJsonConverter.addSimplifiers
private void addSimplifiers(List<Extractor> pHandlers, Extractor[] pSimplifyHandlers) { if (pSimplifyHandlers != null && pSimplifyHandlers.length > 0) { pHandlers.addAll(Arrays.asList(pSimplifyHandlers)); } else { // Add all pHandlers.addAll(ServiceObjectFactory.<Extr...
java
private void addSimplifiers(List<Extractor> pHandlers, Extractor[] pSimplifyHandlers) { if (pSimplifyHandlers != null && pSimplifyHandlers.length > 0) { pHandlers.addAll(Arrays.asList(pSimplifyHandlers)); } else { // Add all pHandlers.addAll(ServiceObjectFactory.<Extr...
[ "private", "void", "addSimplifiers", "(", "List", "<", "Extractor", ">", "pHandlers", ",", "Extractor", "[", "]", "pSimplifyHandlers", ")", "{", "if", "(", "pSimplifyHandlers", "!=", "null", "&&", "pSimplifyHandlers", ".", "length", ">", "0", ")", "{", "pHan...
Simplifiers are added either explicitely or by reflection from a subpackage
[ "Simplifiers", "are", "added", "either", "explicitely", "or", "by", "reflection", "from", "a", "subpackage" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java#L345-L352
120,216
rhuss/jolokia
client/java/src/main/java/org/jolokia/client/request/J4pRequest.java
J4pRequest.toJson
JSONObject toJson() { JSONObject ret = new JSONObject(); ret.put("type",type.name()); if (targetConfig != null) { ret.put("target",targetConfig.toJson()); } return ret; }
java
JSONObject toJson() { JSONObject ret = new JSONObject(); ret.put("type",type.name()); if (targetConfig != null) { ret.put("target",targetConfig.toJson()); } return ret; }
[ "JSONObject", "toJson", "(", ")", "{", "JSONObject", "ret", "=", "new", "JSONObject", "(", ")", ";", "ret", ".", "put", "(", "\"type\"", ",", "type", ".", "name", "(", ")", ")", ";", "if", "(", "targetConfig", "!=", "null", ")", "{", "ret", ".", ...
Get a JSON representation of this request
[ "Get", "a", "JSON", "representation", "of", "this", "request" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/request/J4pRequest.java#L109-L116
120,217
rhuss/jolokia
client/java/src/main/java/org/jolokia/client/request/J4pRequest.java
J4pRequest.nullEscape
private String nullEscape(Object pArg) { if (pArg == null) { return "[null]"; } else if (pArg instanceof String && ((String) pArg).length() == 0) { return "\"\""; } else if (pArg instanceof JSONAware) { return ((JSONAware) pArg).toJSONString(); } else ...
java
private String nullEscape(Object pArg) { if (pArg == null) { return "[null]"; } else if (pArg instanceof String && ((String) pArg).length() == 0) { return "\"\""; } else if (pArg instanceof JSONAware) { return ((JSONAware) pArg).toJSONString(); } else ...
[ "private", "String", "nullEscape", "(", "Object", "pArg", ")", "{", "if", "(", "pArg", "==", "null", ")", "{", "return", "\"[null]\"", ";", "}", "else", "if", "(", "pArg", "instanceof", "String", "&&", "(", "(", "String", ")", "pArg", ")", ".", "leng...
null escape used for GET requests
[ "null", "escape", "used", "for", "GET", "requests" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/request/J4pRequest.java#L276-L286
120,218
rhuss/jolokia
agent/core/src/main/java/org/jolokia/discovery/MulticastUtil.java
MulticastUtil.sendQueryAndCollectAnswers
public static List<DiscoveryIncomingMessage> sendQueryAndCollectAnswers(DiscoveryOutgoingMessage pOutMsg, int pTimeout, LogHandler pLogHandler) throws IOException { ...
java
public static List<DiscoveryIncomingMessage> sendQueryAndCollectAnswers(DiscoveryOutgoingMessage pOutMsg, int pTimeout, LogHandler pLogHandler) throws IOException { ...
[ "public", "static", "List", "<", "DiscoveryIncomingMessage", ">", "sendQueryAndCollectAnswers", "(", "DiscoveryOutgoingMessage", "pOutMsg", ",", "int", "pTimeout", ",", "LogHandler", "pLogHandler", ")", "throws", "IOException", "{", "final", "List", "<", "Future", "<"...
Sent out a message to Jolokia's multicast group over all network interfaces supporting multicasts @param pOutMsg the message to send @param pTimeout timeout used for how long to wait for discovery messages @param pLogHandler a log handler for printing out logging information @return list of received answers, ne...
[ "Sent", "out", "a", "message", "to", "Jolokia", "s", "multicast", "group", "over", "all", "network", "interfaces", "supporting", "multicasts" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/discovery/MulticastUtil.java#L67-L72
120,219
rhuss/jolokia
agent/core/src/main/java/org/jolokia/discovery/MulticastUtil.java
MulticastUtil.sendDiscoveryRequests
private static List<Future<List<DiscoveryIncomingMessage>>> sendDiscoveryRequests(DiscoveryOutgoingMessage pOutMsg, int pTimeout, LogHandler pLogHan...
java
private static List<Future<List<DiscoveryIncomingMessage>>> sendDiscoveryRequests(DiscoveryOutgoingMessage pOutMsg, int pTimeout, LogHandler pLogHan...
[ "private", "static", "List", "<", "Future", "<", "List", "<", "DiscoveryIncomingMessage", ">", ">", ">", "sendDiscoveryRequests", "(", "DiscoveryOutgoingMessage", "pOutMsg", ",", "int", "pTimeout", ",", "LogHandler", "pLogHandler", ")", "throws", "SocketException", ...
Send requests in parallel threads, return the futures for getting the result
[ "Send", "requests", "in", "parallel", "threads", "return", "the", "futures", "for", "getting", "the", "result" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/discovery/MulticastUtil.java#L76-L92
120,220
rhuss/jolokia
agent/core/src/main/java/org/jolokia/discovery/MulticastUtil.java
MulticastUtil.getMulticastAddresses
private static List<InetAddress> getMulticastAddresses() throws SocketException, UnknownHostException { List<InetAddress> addresses = NetworkUtil.getMulticastAddresses(); if (addresses.size() == 0) { throw new UnknownHostException("Cannot find address of local host which can be used for send...
java
private static List<InetAddress> getMulticastAddresses() throws SocketException, UnknownHostException { List<InetAddress> addresses = NetworkUtil.getMulticastAddresses(); if (addresses.size() == 0) { throw new UnknownHostException("Cannot find address of local host which can be used for send...
[ "private", "static", "List", "<", "InetAddress", ">", "getMulticastAddresses", "(", ")", "throws", "SocketException", ",", "UnknownHostException", "{", "List", "<", "InetAddress", ">", "addresses", "=", "NetworkUtil", ".", "getMulticastAddresses", "(", ")", ";", "...
All addresses which can be used for sending multicast addresses
[ "All", "addresses", "which", "can", "be", "used", "for", "sending", "multicast", "addresses" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/discovery/MulticastUtil.java#L95-L101
120,221
rhuss/jolokia
agent/core/src/main/java/org/jolokia/discovery/MulticastUtil.java
MulticastUtil.collectIncomingMessages
private static List<DiscoveryIncomingMessage> collectIncomingMessages(int pTimeout, List<Future<List<DiscoveryIncomingMessage>>> pFutures, LogHandler pLogHandler) throws UnknownHostException { List<DiscoveryIncomingMessage> ret = new ArrayList<DiscoveryIncomingMessage>(); Set<String> seen = new HashSet<...
java
private static List<DiscoveryIncomingMessage> collectIncomingMessages(int pTimeout, List<Future<List<DiscoveryIncomingMessage>>> pFutures, LogHandler pLogHandler) throws UnknownHostException { List<DiscoveryIncomingMessage> ret = new ArrayList<DiscoveryIncomingMessage>(); Set<String> seen = new HashSet<...
[ "private", "static", "List", "<", "DiscoveryIncomingMessage", ">", "collectIncomingMessages", "(", "int", "pTimeout", ",", "List", "<", "Future", "<", "List", "<", "DiscoveryIncomingMessage", ">", ">", ">", "pFutures", ",", "LogHandler", "pLogHandler", ")", "throw...
Collect the incoming messages and filter out duplicates
[ "Collect", "the", "incoming", "messages", "and", "filter", "out", "duplicates" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/discovery/MulticastUtil.java#L104-L141
120,222
rhuss/jolokia
agent/core/src/main/java/org/jolokia/discovery/MulticastUtil.java
MulticastUtil.joinMcGroupsOnAllNetworkInterfaces
private static int joinMcGroupsOnAllNetworkInterfaces(MulticastSocket pSocket, InetSocketAddress pSocketAddress, LogHandler pLogHandler) throws IOException { // V6: ffx8::/16 Enumeration<NetworkInterface> nifs = NetworkInterface.getNetworkInterfaces(); int interfacesJoined = 0; while (ni...
java
private static int joinMcGroupsOnAllNetworkInterfaces(MulticastSocket pSocket, InetSocketAddress pSocketAddress, LogHandler pLogHandler) throws IOException { // V6: ffx8::/16 Enumeration<NetworkInterface> nifs = NetworkInterface.getNetworkInterfaces(); int interfacesJoined = 0; while (ni...
[ "private", "static", "int", "joinMcGroupsOnAllNetworkInterfaces", "(", "MulticastSocket", "pSocket", ",", "InetSocketAddress", "pSocketAddress", ",", "LogHandler", "pLogHandler", ")", "throws", "IOException", "{", "// V6: ffx8::/16", "Enumeration", "<", "NetworkInterface", ...
We are using all interfaces available and try to join them
[ "We", "are", "using", "all", "interfaces", "available", "and", "try", "to", "join", "them" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/discovery/MulticastUtil.java#L144-L160
120,223
rhuss/jolokia
agent/core/src/main/java/org/jolokia/restrictor/policy/NetworkChecker.java
NetworkChecker.check
@Override public boolean check(String[] pHostOrAddresses) { if (allowedHostsSet == null) { return true; } for (String addr : pHostOrAddresses) { if (allowedHostsSet.contains(addr)) { return true; } if (allowedSubnetsSet != null ...
java
@Override public boolean check(String[] pHostOrAddresses) { if (allowedHostsSet == null) { return true; } for (String addr : pHostOrAddresses) { if (allowedHostsSet.contains(addr)) { return true; } if (allowedSubnetsSet != null ...
[ "@", "Override", "public", "boolean", "check", "(", "String", "[", "]", "pHostOrAddresses", ")", "{", "if", "(", "allowedHostsSet", "==", "null", ")", "{", "return", "true", ";", "}", "for", "(", "String", "addr", ":", "pHostOrAddresses", ")", "{", "if",...
Check for one or more hosts. @param pHostOrAddresses array of host names or IP addresses @return true if one of the given name passes this checker.
[ "Check", "for", "one", "or", "more", "hosts", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/restrictor/policy/NetworkChecker.java#L97-L115
120,224
rhuss/jolokia
agent/core/src/main/java/org/jolokia/converter/json/MapExtractor.java
MapExtractor.setObjectValue
public Object setObjectValue(StringToObjectConverter pConverter, Object pMap, String pKey, Object pValue) throws IllegalAccessException, InvocationTargetException { Map<Object,Object> map = (Map<Object,Object>) pMap; Object oldValue = null; Object oldKey = pKey; for (Map.Entr...
java
public Object setObjectValue(StringToObjectConverter pConverter, Object pMap, String pKey, Object pValue) throws IllegalAccessException, InvocationTargetException { Map<Object,Object> map = (Map<Object,Object>) pMap; Object oldValue = null; Object oldKey = pKey; for (Map.Entr...
[ "public", "Object", "setObjectValue", "(", "StringToObjectConverter", "pConverter", ",", "Object", "pMap", ",", "String", "pKey", ",", "Object", "pValue", ")", "throws", "IllegalAccessException", ",", "InvocationTargetException", "{", "Map", "<", "Object", ",", "Obj...
Set the value within a map, where the attribute is taken as key into the map. @param pConverter the global converter in order to be able do dispatch for serializing inner data types @param pMap map on which to set the value @param pKey key in the map where to put the value @param pValue the new value to set @return th...
[ "Set", "the", "value", "within", "a", "map", "where", "the", "attribute", "is", "taken", "as", "key", "into", "the", "map", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/MapExtractor.java#L118-L139
120,225
rhuss/jolokia
agent/core/src/main/java/org/jolokia/config/ProcessingParameters.java
ProcessingParameters.get
public String get(ConfigKey pKey) { String value = params.get(pKey); if (value != null) { return value; } else { return pKey.getDefaultValue(); } }
java
public String get(ConfigKey pKey) { String value = params.get(pKey); if (value != null) { return value; } else { return pKey.getDefaultValue(); } }
[ "public", "String", "get", "(", "ConfigKey", "pKey", ")", "{", "String", "value", "=", "params", ".", "get", "(", "pKey", ")", ";", "if", "(", "value", "!=", "null", ")", "{", "return", "value", ";", "}", "else", "{", "return", "pKey", ".", "getDef...
Get a processing parameter @param pKey key to lookup @return the value or the default value from the key if no config value is set
[ "Get", "a", "processing", "parameter" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/config/ProcessingParameters.java#L53-L60
120,226
rhuss/jolokia
agent/core/src/main/java/org/jolokia/config/ProcessingParameters.java
ProcessingParameters.mergedParams
public ProcessingParameters mergedParams(Map<String, String> pConfig) { if (pConfig == null) { return this; } else { Map<ConfigKey,String> newParams = new HashMap<ConfigKey, String>(); newParams.putAll(params); newParams.putAll(convertToConfigMap(pConfig))...
java
public ProcessingParameters mergedParams(Map<String, String> pConfig) { if (pConfig == null) { return this; } else { Map<ConfigKey,String> newParams = new HashMap<ConfigKey, String>(); newParams.putAll(params); newParams.putAll(convertToConfigMap(pConfig))...
[ "public", "ProcessingParameters", "mergedParams", "(", "Map", "<", "String", ",", "String", ">", "pConfig", ")", "{", "if", "(", "pConfig", "==", "null", ")", "{", "return", "this", ";", "}", "else", "{", "Map", "<", "ConfigKey", ",", "String", ">", "n...
Merge in a configuration and return a ProcessingParameters object representing the merged values @param pConfig config to merge in @return a new ProcessingParameters instance if the given config is not null. Otherwise this object is returned.
[ "Merge", "in", "a", "configuration", "and", "return", "a", "ProcessingParameters", "object", "representing", "the", "merged", "values" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/config/ProcessingParameters.java#L70-L79
120,227
rhuss/jolokia
agent/core/src/main/java/org/jolokia/config/ProcessingParameters.java
ProcessingParameters.convertToConfigMap
static Map<ConfigKey, String> convertToConfigMap(Map<String, String> pParams) { Map<ConfigKey,String> config = new HashMap<ConfigKey, String>(); if (pParams != null) { for (Map.Entry<String,?> entry : pParams.entrySet()) { ConfigKey cKey = ConfigKey.getRequestConfigKey(entry....
java
static Map<ConfigKey, String> convertToConfigMap(Map<String, String> pParams) { Map<ConfigKey,String> config = new HashMap<ConfigKey, String>(); if (pParams != null) { for (Map.Entry<String,?> entry : pParams.entrySet()) { ConfigKey cKey = ConfigKey.getRequestConfigKey(entry....
[ "static", "Map", "<", "ConfigKey", ",", "String", ">", "convertToConfigMap", "(", "Map", "<", "String", ",", "String", ">", "pParams", ")", "{", "Map", "<", "ConfigKey", ",", "String", ">", "config", "=", "new", "HashMap", "<", "ConfigKey", ",", "String"...
map to a ConfigKey are filtered out
[ "map", "to", "a", "ConfigKey", "are", "filtered", "out" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/config/ProcessingParameters.java#L93-L105
120,228
rhuss/jolokia
agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
HttpRequestHandler.handleGetRequest
public JSONAware handleGetRequest(String pUri, String pPathInfo, Map<String, String[]> pParameterMap) { String pathInfo = extractPathInfo(pUri, pPathInfo); JmxRequest jmxReq = JmxRequestFactory.createGetRequest(pathInfo,getProcessingParameter(pParameterMap)); if (backendManager...
java
public JSONAware handleGetRequest(String pUri, String pPathInfo, Map<String, String[]> pParameterMap) { String pathInfo = extractPathInfo(pUri, pPathInfo); JmxRequest jmxReq = JmxRequestFactory.createGetRequest(pathInfo,getProcessingParameter(pParameterMap)); if (backendManager...
[ "public", "JSONAware", "handleGetRequest", "(", "String", "pUri", ",", "String", "pPathInfo", ",", "Map", "<", "String", ",", "String", "[", "]", ">", "pParameterMap", ")", "{", "String", "pathInfo", "=", "extractPathInfo", "(", "pUri", ",", "pPathInfo", ")"...
Handle a GET request @param pUri URI leading to this request @param pPathInfo path of the request @param pParameterMap parameters of the GET request @return the response
[ "Handle", "a", "GET", "request" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java#L75-L87
120,229
rhuss/jolokia
agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
HttpRequestHandler.handlePostRequest
public JSONAware handlePostRequest(String pUri, InputStream pInputStream, String pEncoding, Map<String, String[]> pParameterMap) throws IOException { if (backendManager.isDebug()) { logHandler.debug("URI: " + pUri); } Object jsonRequest = extractJsonRequest(pInputStream...
java
public JSONAware handlePostRequest(String pUri, InputStream pInputStream, String pEncoding, Map<String, String[]> pParameterMap) throws IOException { if (backendManager.isDebug()) { logHandler.debug("URI: " + pUri); } Object jsonRequest = extractJsonRequest(pInputStream...
[ "public", "JSONAware", "handlePostRequest", "(", "String", "pUri", ",", "InputStream", "pInputStream", ",", "String", "pEncoding", ",", "Map", "<", "String", ",", "String", "[", "]", ">", "pParameterMap", ")", "throws", "IOException", "{", "if", "(", "backendM...
Handle the input stream as given by a POST request @param pUri URI leading to this request @param pInputStream input stream of the post request @param pEncoding optional encoding for the stream. If null, the default encoding is used @param pParameterMap additional processing parameters @return the JSON object contain...
[ "Handle", "the", "input", "stream", "as", "given", "by", "a", "POST", "request" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java#L115-L141
120,230
rhuss/jolokia
agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
HttpRequestHandler.getErrorJSON
public JSONObject getErrorJSON(int pErrorCode, Throwable pExp, JmxRequest pJmxReq) { JSONObject jsonObject = new JSONObject(); jsonObject.put("status",pErrorCode); jsonObject.put("error",getExceptionMessage(pExp)); jsonObject.put("error_type", pExp.getClass().getName()); addError...
java
public JSONObject getErrorJSON(int pErrorCode, Throwable pExp, JmxRequest pJmxReq) { JSONObject jsonObject = new JSONObject(); jsonObject.put("status",pErrorCode); jsonObject.put("error",getExceptionMessage(pExp)); jsonObject.put("error_type", pExp.getClass().getName()); addError...
[ "public", "JSONObject", "getErrorJSON", "(", "int", "pErrorCode", ",", "Throwable", "pExp", ",", "JmxRequest", "pJmxReq", ")", "{", "JSONObject", "jsonObject", "=", "new", "JSONObject", "(", ")", ";", "jsonObject", ".", "put", "(", "\"status\"", ",", "pErrorCo...
Get the JSON representation for a an exception @param pErrorCode the HTTP error code to return @param pExp the exception or error occured @param pJmxReq request from where to get processing options @return the json representation
[ "Get", "the", "JSON", "representation", "for", "a", "an", "exception" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java#L258-L271
120,231
rhuss/jolokia
agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
HttpRequestHandler.extractCorsOrigin
public String extractCorsOrigin(String pOrigin) { if (pOrigin != null) { // Prevent HTTP response splitting attacks String origin = pOrigin.replaceAll("[\\n\\r]*",""); if (backendManager.isOriginAllowed(origin,false)) { return "null".equals(origin) ? "*" : or...
java
public String extractCorsOrigin(String pOrigin) { if (pOrigin != null) { // Prevent HTTP response splitting attacks String origin = pOrigin.replaceAll("[\\n\\r]*",""); if (backendManager.isOriginAllowed(origin,false)) { return "null".equals(origin) ? "*" : or...
[ "public", "String", "extractCorsOrigin", "(", "String", "pOrigin", ")", "{", "if", "(", "pOrigin", "!=", "null", ")", "{", "// Prevent HTTP response splitting attacks", "String", "origin", "=", "pOrigin", ".", "replaceAll", "(", "\"[\\\\n\\\\r]*\"", ",", "\"\"", "...
Check whether for the given host is a cross-browser request allowed. This check is delegated to the backendmanager which is responsible for the security configuration. Also, some sanity checks are applied. @param pOrigin the origin URL to check against @return the origin to put in the response header or null if none i...
[ "Check", "whether", "for", "the", "given", "host", "is", "a", "cross", "-", "browser", "request", "allowed", ".", "This", "check", "is", "delegated", "to", "the", "backendmanager", "which", "is", "responsible", "for", "the", "security", "configuration", ".", ...
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java#L299-L310
120,232
rhuss/jolokia
agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
HttpRequestHandler.getExceptionMessage
private String getExceptionMessage(Throwable pException) { String message = pException.getLocalizedMessage(); return pException.getClass().getName() + (message != null ? " : " + message : ""); }
java
private String getExceptionMessage(Throwable pException) { String message = pException.getLocalizedMessage(); return pException.getClass().getName() + (message != null ? " : " + message : ""); }
[ "private", "String", "getExceptionMessage", "(", "Throwable", "pException", ")", "{", "String", "message", "=", "pException", ".", "getLocalizedMessage", "(", ")", ";", "return", "pException", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "(", "m...
Extract class and exception message for an error message
[ "Extract", "class", "and", "exception", "message", "for", "an", "error", "message" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java#L329-L332
120,233
rhuss/jolokia
agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
HttpRequestHandler.errorForUnwrappedException
private JSONObject errorForUnwrappedException(Exception e, JmxRequest pJmxReq) { Throwable cause = e.getCause(); int code = cause instanceof IllegalArgumentException ? 400 : cause instanceof SecurityException ? 403 : 500; return getErrorJSON(code,cause, pJmxReq); }
java
private JSONObject errorForUnwrappedException(Exception e, JmxRequest pJmxReq) { Throwable cause = e.getCause(); int code = cause instanceof IllegalArgumentException ? 400 : cause instanceof SecurityException ? 403 : 500; return getErrorJSON(code,cause, pJmxReq); }
[ "private", "JSONObject", "errorForUnwrappedException", "(", "Exception", "e", ",", "JmxRequest", "pJmxReq", ")", "{", "Throwable", "cause", "=", "e", ".", "getCause", "(", ")", ";", "int", "code", "=", "cause", "instanceof", "IllegalArgumentException", "?", "400...
and extract the error code accordingly
[ "and", "extract", "the", "error", "code", "accordingly" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java#L336-L340
120,234
rhuss/jolokia
agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java
AbstractServerDetector.searchMBeans
protected Set<ObjectName> searchMBeans(MBeanServerExecutor pMBeanServerExecutor, String pMbeanPattern) { try { ObjectName oName = new ObjectName(pMbeanPattern); return pMBeanServerExecutor.queryNames(oName); } catch (MalformedObjectNameException e) { return new HashSe...
java
protected Set<ObjectName> searchMBeans(MBeanServerExecutor pMBeanServerExecutor, String pMbeanPattern) { try { ObjectName oName = new ObjectName(pMbeanPattern); return pMBeanServerExecutor.queryNames(oName); } catch (MalformedObjectNameException e) { return new HashSe...
[ "protected", "Set", "<", "ObjectName", ">", "searchMBeans", "(", "MBeanServerExecutor", "pMBeanServerExecutor", ",", "String", "pMbeanPattern", ")", "{", "try", "{", "ObjectName", "oName", "=", "new", "ObjectName", "(", "pMbeanPattern", ")", ";", "return", "pMBean...
Check for the existence of a certain MBean. All known MBeanServers are queried @param pMBeanServerExecutor mbean servers to query for @param pMbeanPattern MBean name pattern for MBeans to check for @return set of {@link ObjectName}s if the pattern matches, or an empty set if not mbean has been found
[ "Check", "for", "the", "existence", "of", "a", "certain", "MBean", ".", "All", "known", "MBeanServers", "are", "queried" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java#L43-L52
120,235
rhuss/jolokia
agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java
AbstractServerDetector.getSingleStringAttribute
protected String getSingleStringAttribute(MBeanServerExecutor pMBeanServerExecutor, String pMBeanName, String pAttribute) { Set<ObjectName> serverMBeanNames = searchMBeans(pMBeanServerExecutor, pMBeanName); if (serverMBeanNames.size() == 0) { return null; } Set<String> attrib...
java
protected String getSingleStringAttribute(MBeanServerExecutor pMBeanServerExecutor, String pMBeanName, String pAttribute) { Set<ObjectName> serverMBeanNames = searchMBeans(pMBeanServerExecutor, pMBeanName); if (serverMBeanNames.size() == 0) { return null; } Set<String> attrib...
[ "protected", "String", "getSingleStringAttribute", "(", "MBeanServerExecutor", "pMBeanServerExecutor", ",", "String", "pMBeanName", ",", "String", "pAttribute", ")", "{", "Set", "<", "ObjectName", ">", "serverMBeanNames", "=", "searchMBeans", "(", "pMBeanServerExecutor", ...
Get a single attribute for a given MBeanName pattern. @param pMBeanServerExecutor MBeanServer manager to query @param pMBeanName a MBean name or pattern. If multiple MBeans are found, each is queried for the attribute @param pAttribute the attribute to lookup @return the string value of the attribute or null if either...
[ "Get", "a", "single", "attribute", "for", "a", "given", "MBeanName", "pattern", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java#L123-L139
120,236
rhuss/jolokia
agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java
AbstractServerDetector.getVersionFromJsr77
protected String getVersionFromJsr77(MBeanServerExecutor pMbeanServers) { Set<ObjectName> names = searchMBeans(pMbeanServers, "*:j2eeType=J2EEServer,*"); // Take the first one if (names.size() > 0) { return getAttributeValue(pMbeanServers, names.iterator().next(), "serverVersion"); ...
java
protected String getVersionFromJsr77(MBeanServerExecutor pMbeanServers) { Set<ObjectName> names = searchMBeans(pMbeanServers, "*:j2eeType=J2EEServer,*"); // Take the first one if (names.size() > 0) { return getAttributeValue(pMbeanServers, names.iterator().next(), "serverVersion"); ...
[ "protected", "String", "getVersionFromJsr77", "(", "MBeanServerExecutor", "pMbeanServers", ")", "{", "Set", "<", "ObjectName", ">", "names", "=", "searchMBeans", "(", "pMbeanServers", ",", "\"*:j2eeType=J2EEServer,*\"", ")", ";", "// Take the first one", "if", "(", "n...
Get the version number from a JSR-77 compliant server @param pMbeanServers servers to query @return version number or null if not found.
[ "Get", "the", "version", "number", "from", "a", "JSR", "-", "77", "compliant", "server" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java#L148-L155
120,237
rhuss/jolokia
agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java
AbstractServerDetector.isClassLoaded
protected boolean isClassLoaded(String className, Instrumentation instrumentation) { if (instrumentation == null || className == null) { throw new IllegalArgumentException("instrumentation and className must not be null"); } Class<?>[] classes = instrumentation.getAllLoadedClasses();...
java
protected boolean isClassLoaded(String className, Instrumentation instrumentation) { if (instrumentation == null || className == null) { throw new IllegalArgumentException("instrumentation and className must not be null"); } Class<?>[] classes = instrumentation.getAllLoadedClasses();...
[ "protected", "boolean", "isClassLoaded", "(", "String", "className", ",", "Instrumentation", "instrumentation", ")", "{", "if", "(", "instrumentation", "==", "null", "||", "className", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"ins...
Tests if the given class name has been loaded by the JVM. Don't use this method in case you have access to the class loader which will be loading the class because the used approach is not very efficient. @param className the name of the class to check @param instrumentation @return true if the class has been loaded by...
[ "Tests", "if", "the", "given", "class", "name", "has", "been", "loaded", "by", "the", "JVM", ".", "Don", "t", "use", "this", "method", "in", "case", "you", "have", "access", "to", "the", "class", "loader", "which", "will", "be", "loading", "the", "clas...
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java#L183-L194
120,238
rhuss/jolokia
client/java/src/main/java/org/jolokia/client/J4pClientBuilder.java
J4pClientBuilder.proxy
public final J4pClientBuilder proxy(String pProxyHost, int pProxyPort, String pProxyUser, String pProxyPass) { httpProxy = new Proxy(pProxyHost,pProxyPort, pProxyUser,pProxyPass); return this; }
java
public final J4pClientBuilder proxy(String pProxyHost, int pProxyPort, String pProxyUser, String pProxyPass) { httpProxy = new Proxy(pProxyHost,pProxyPort, pProxyUser,pProxyPass); return this; }
[ "public", "final", "J4pClientBuilder", "proxy", "(", "String", "pProxyHost", ",", "int", "pProxyPort", ",", "String", "pProxyUser", ",", "String", "pProxyPass", ")", "{", "httpProxy", "=", "new", "Proxy", "(", "pProxyHost", ",", "pProxyPort", ",", "pProxyUser", ...
Set the proxy for this client @param pProxyHost proxy hostname @param pProxyPort proxy port number @param pProxyUser proxy authentication username @param pProxyPass proxy authentication password
[ "Set", "the", "proxy", "for", "this", "client" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/J4pClientBuilder.java#L363-L366
120,239
rhuss/jolokia
client/java/src/main/java/org/jolokia/client/J4pClientBuilder.java
J4pClientBuilder.useProxyFromEnvironment
public final J4pClientBuilder useProxyFromEnvironment(){ Map<String, String> env = System.getenv(); for (String key : env.keySet()) { if (key.equalsIgnoreCase("http_proxy")){ httpProxy = parseProxySettings(env.get(key)); break; } } ...
java
public final J4pClientBuilder useProxyFromEnvironment(){ Map<String, String> env = System.getenv(); for (String key : env.keySet()) { if (key.equalsIgnoreCase("http_proxy")){ httpProxy = parseProxySettings(env.get(key)); break; } } ...
[ "public", "final", "J4pClientBuilder", "useProxyFromEnvironment", "(", ")", "{", "Map", "<", "String", ",", "String", ">", "env", "=", "System", ".", "getenv", "(", ")", ";", "for", "(", "String", "key", ":", "env", ".", "keySet", "(", ")", ")", "{", ...
Set the proxy for this client based on http_proxy system environment variable
[ "Set", "the", "proxy", "for", "this", "client", "based", "on", "http_proxy", "system", "environment", "variable" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/J4pClientBuilder.java#L371-L380
120,240
rhuss/jolokia
client/java/src/main/java/org/jolokia/client/J4pClientBuilder.java
J4pClientBuilder.build
public J4pClient build() { return new J4pClient(url,createHttpClient(), targetUrl != null ? new J4pTargetConfig(targetUrl,targetUser,targetPassword) : null, responseExtractor); }
java
public J4pClient build() { return new J4pClient(url,createHttpClient(), targetUrl != null ? new J4pTargetConfig(targetUrl,targetUser,targetPassword) : null, responseExtractor); }
[ "public", "J4pClient", "build", "(", ")", "{", "return", "new", "J4pClient", "(", "url", ",", "createHttpClient", "(", ")", ",", "targetUrl", "!=", "null", "?", "new", "J4pTargetConfig", "(", "targetUrl", ",", "targetUser", ",", "targetPassword", ")", ":", ...
Build the agent with the information given before @return a new J4pClient
[ "Build", "the", "agent", "with", "the", "information", "given", "before" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/J4pClientBuilder.java#L414-L418
120,241
rhuss/jolokia
client/java/src/main/java/org/jolokia/client/J4pClientBuilder.java
J4pClientBuilder.parseProxySettings
static Proxy parseProxySettings(String spec) { try { if (spec == null || spec.length() == 0) { return null; } return new Proxy(spec); } catch (URISyntaxException e) { return null; } }
java
static Proxy parseProxySettings(String spec) { try { if (spec == null || spec.length() == 0) { return null; } return new Proxy(spec); } catch (URISyntaxException e) { return null; } }
[ "static", "Proxy", "parseProxySettings", "(", "String", "spec", ")", "{", "try", "{", "if", "(", "spec", "==", "null", "||", "spec", ".", "length", "(", ")", "==", "0", ")", "{", "return", "null", ";", "}", "return", "new", "Proxy", "(", "spec", ")...
Parse proxy specification and return a proxy object representing the proxy configuration. @param spec specification of for a proxy @return proxy object or null if none is set
[ "Parse", "proxy", "specification", "and", "return", "a", "proxy", "object", "representing", "the", "proxy", "configuration", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/J4pClientBuilder.java#L444-L454
120,242
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/ClassUtil.java
ClassUtil.newInstance
public static <T> T newInstance(String pClassName, Object ... pArguments) { Class<T> clazz = classForName(pClassName); if (clazz == null) { throw new IllegalArgumentException("Cannot find " + pClassName); } return newInstance(clazz, pArguments); }
java
public static <T> T newInstance(String pClassName, Object ... pArguments) { Class<T> clazz = classForName(pClassName); if (clazz == null) { throw new IllegalArgumentException("Cannot find " + pClassName); } return newInstance(clazz, pArguments); }
[ "public", "static", "<", "T", ">", "T", "newInstance", "(", "String", "pClassName", ",", "Object", "...", "pArguments", ")", "{", "Class", "<", "T", ">", "clazz", "=", "classForName", "(", "pClassName", ")", ";", "if", "(", "clazz", "==", "null", ")", ...
Instantiate an instance of the given class with its default constructor. The context class loader is used to lookup the class @param pClassName name of class to instantiate @param pArguments optional constructor arguments. Works only for objects with the same class as declared in the constructor types (no subclasses) ...
[ "Instantiate", "an", "instance", "of", "the", "given", "class", "with", "its", "default", "constructor", ".", "The", "context", "class", "loader", "is", "used", "to", "lookup", "the", "class" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/ClassUtil.java#L131-L137
120,243
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/ClassUtil.java
ClassUtil.newInstance
public static <T> T newInstance(Class<T> pClass, Object ... pArguments) { try { if (pClass != null) { if (pArguments.length == 0) { return pClass.newInstance(); } else { Constructor<T> ctr = lookupConstructor(pClass, pArguments)...
java
public static <T> T newInstance(Class<T> pClass, Object ... pArguments) { try { if (pClass != null) { if (pArguments.length == 0) { return pClass.newInstance(); } else { Constructor<T> ctr = lookupConstructor(pClass, pArguments)...
[ "public", "static", "<", "T", ">", "T", "newInstance", "(", "Class", "<", "T", ">", "pClass", ",", "Object", "...", "pArguments", ")", "{", "try", "{", "if", "(", "pClass", "!=", "null", ")", "{", "if", "(", "pArguments", ".", "length", "==", "0", ...
Instantiate an instance of the given class with its default constructor @param pClass class to instantiate @param pArguments optional constructor arguments. Works only for objects with the same class as declared in the constructor types (no subclasses) @param <T> type object type @return instantiated object @throws Il...
[ "Instantiate", "an", "instance", "of", "the", "given", "class", "with", "its", "default", "constructor" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/ClassUtil.java#L149-L170
120,244
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/ClassUtil.java
ClassUtil.applyMethod
public static Object applyMethod(Object pObject, String pMethod, Object ... pArgs) { Class<?> clazz = pObject.getClass(); try { Method method = extractMethod(pMethod, clazz, pArgs); return method.invoke(pObject,pArgs); } catch (NoSuchMethodException e) { throw...
java
public static Object applyMethod(Object pObject, String pMethod, Object ... pArgs) { Class<?> clazz = pObject.getClass(); try { Method method = extractMethod(pMethod, clazz, pArgs); return method.invoke(pObject,pArgs); } catch (NoSuchMethodException e) { throw...
[ "public", "static", "Object", "applyMethod", "(", "Object", "pObject", ",", "String", "pMethod", ",", "Object", "...", "pArgs", ")", "{", "Class", "<", "?", ">", "clazz", "=", "pObject", ".", "getClass", "(", ")", ";", "try", "{", "Method", "method", "...
Apply a method to a given object with optional arguments. The method is looked up the whole class hierarchy. @param pObject object on which to apply the method @param pMethod the method name @param pArgs optional arguments @return return value (if any)
[ "Apply", "a", "method", "to", "a", "given", "object", "with", "optional", "arguments", ".", "The", "method", "is", "looked", "up", "the", "whole", "class", "hierarchy", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/ClassUtil.java#L181-L193
120,245
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/ClassUtil.java
ClassUtil.getResources
public static Set<String> getResources(String pResource) throws IOException { List<ClassLoader> clls = findClassLoaders(); if (clls.size() != 0) { Set<String> ret = new HashSet<String>(); for (ClassLoader cll : clls) { Enumeration<URL> urlEnum = cll.getResources(p...
java
public static Set<String> getResources(String pResource) throws IOException { List<ClassLoader> clls = findClassLoaders(); if (clls.size() != 0) { Set<String> ret = new HashSet<String>(); for (ClassLoader cll : clls) { Enumeration<URL> urlEnum = cll.getResources(p...
[ "public", "static", "Set", "<", "String", ">", "getResources", "(", "String", "pResource", ")", "throws", "IOException", "{", "List", "<", "ClassLoader", ">", "clls", "=", "findClassLoaders", "(", ")", ";", "if", "(", "clls", ".", "size", "(", ")", "!=",...
Get all resources from the classpath which are specified by the given path. @param pResource resource specification to use for lookup @return the list or URLs to loookup
[ "Get", "all", "resources", "from", "the", "classpath", "which", "are", "specified", "by", "the", "given", "path", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/ClassUtil.java#L201-L213
120,246
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/ClassUtil.java
ClassUtil.lookupConstructor
private static <T> Constructor<T> lookupConstructor(Class<T> clazz, Object[] pArguments) throws NoSuchMethodException { Class[] argTypes = extractArgumentTypes(pArguments); return clazz.getConstructor(argTypes); }
java
private static <T> Constructor<T> lookupConstructor(Class<T> clazz, Object[] pArguments) throws NoSuchMethodException { Class[] argTypes = extractArgumentTypes(pArguments); return clazz.getConstructor(argTypes); }
[ "private", "static", "<", "T", ">", "Constructor", "<", "T", ">", "lookupConstructor", "(", "Class", "<", "T", ">", "clazz", ",", "Object", "[", "]", "pArguments", ")", "throws", "NoSuchMethodException", "{", "Class", "[", "]", "argTypes", "=", "extractArg...
Lookup appropriate constructor
[ "Lookup", "appropriate", "constructor" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/ClassUtil.java#L224-L227
120,247
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/DateUtil.java
DateUtil.fromISO8601
public static Date fromISO8601(String pDateString) { if (datatypeFactory != null) { return datatypeFactory.newXMLGregorianCalendar(pDateString.trim()).toGregorianCalendar().getTime(); } else { try { // Try on our own, works for most cases String da...
java
public static Date fromISO8601(String pDateString) { if (datatypeFactory != null) { return datatypeFactory.newXMLGregorianCalendar(pDateString.trim()).toGregorianCalendar().getTime(); } else { try { // Try on our own, works for most cases String da...
[ "public", "static", "Date", "fromISO8601", "(", "String", "pDateString", ")", "{", "if", "(", "datatypeFactory", "!=", "null", ")", "{", "return", "datatypeFactory", ".", "newXMLGregorianCalendar", "(", "pDateString", ".", "trim", "(", ")", ")", ".", "toGregor...
Parse an ISO-8601 string into an date object @param pDateString date string to parse @return the parse date @throws IllegalArgumentException if the provided string does not conform to ISO-8601
[ "Parse", "an", "ISO", "-", "8601", "string", "into", "an", "date", "object" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/DateUtil.java#L55-L69
120,248
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/DateUtil.java
DateUtil.toISO8601
public static String toISO8601(Date pDate,TimeZone pTimeZone) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); dateFormat.setTimeZone(pTimeZone); String ret = dateFormat.format(pDate); ret = ret.replaceAll("\\+0000$", "Z"); return ret.replaceAll("(\...
java
public static String toISO8601(Date pDate,TimeZone pTimeZone) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); dateFormat.setTimeZone(pTimeZone); String ret = dateFormat.format(pDate); ret = ret.replaceAll("\\+0000$", "Z"); return ret.replaceAll("(\...
[ "public", "static", "String", "toISO8601", "(", "Date", "pDate", ",", "TimeZone", "pTimeZone", ")", "{", "SimpleDateFormat", "dateFormat", "=", "new", "SimpleDateFormat", "(", "\"yyyy-MM-dd'T'HH:mm:ssZ\"", ")", ";", "dateFormat", ".", "setTimeZone", "(", "pTimeZone"...
Convert a given date to an ISO-8601 compliant string representation for a given timezone @param pDate date to convert @param pTimeZone timezone to use @return the ISO-8601 representation of the date
[ "Convert", "a", "given", "date", "to", "an", "ISO", "-", "8601", "compliant", "string", "representation", "for", "a", "given", "timezone" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/DateUtil.java#L90-L96
120,249
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/IoUtil.java
IoUtil.streamResponseAndClose
public static void streamResponseAndClose(Writer pWriter, JSONStreamAware pJson, String callback) throws IOException { try { if (callback == null) { pJson.writeJSONString(pWriter); } else { pWriter.write(callback); pWriter.write("("...
java
public static void streamResponseAndClose(Writer pWriter, JSONStreamAware pJson, String callback) throws IOException { try { if (callback == null) { pJson.writeJSONString(pWriter); } else { pWriter.write(callback); pWriter.write("("...
[ "public", "static", "void", "streamResponseAndClose", "(", "Writer", "pWriter", ",", "JSONStreamAware", "pJson", ",", "String", "callback", ")", "throws", "IOException", "{", "try", "{", "if", "(", "callback", "==", "null", ")", "{", "pJson", ".", "writeJSONSt...
Stream a JSON stream to a given writer, potentiall wrap it in a callback for a JSONP response and then flush & close the writer. The writer is closed in any case, also when an exception occurs @param pWriter writer to write to. Must be not null. @param pJson JSON response to stream @param callback the name of the call...
[ "Stream", "a", "JSON", "stream", "to", "a", "given", "writer", "potentiall", "wrap", "it", "in", "a", "callback", "for", "a", "JSONP", "response", "and", "then", "flush", "&", "close", "the", "writer", ".", "The", "writer", "is", "closed", "in", "any", ...
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/IoUtil.java#L30-L48
120,250
rhuss/jolokia
agent/core/src/main/java/org/jolokia/request/JmxRequest.java
JmxRequest.getParameterAsInt
public int getParameterAsInt(ConfigKey pConfigKey) { String intValueS = processingConfig.get(pConfigKey); if (intValueS != null) { return Integer.parseInt(intValueS); } else { return 0; } }
java
public int getParameterAsInt(ConfigKey pConfigKey) { String intValueS = processingConfig.get(pConfigKey); if (intValueS != null) { return Integer.parseInt(intValueS); } else { return 0; } }
[ "public", "int", "getParameterAsInt", "(", "ConfigKey", "pConfigKey", ")", "{", "String", "intValueS", "=", "processingConfig", ".", "get", "(", "pConfigKey", ")", ";", "if", "(", "intValueS", "!=", "null", ")", "{", "return", "Integer", ".", "parseInt", "("...
Get a processing configuration as integer or null if not set @param pConfigKey configuration to lookup @return integer value of configuration or 0 if not set.
[ "Get", "a", "processing", "configuration", "as", "integer", "or", "null", "if", "not", "set" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxRequest.java#L121-L128
120,251
rhuss/jolokia
agent/core/src/main/java/org/jolokia/request/JmxRequest.java
JmxRequest.getParameterAsBool
public Boolean getParameterAsBool(ConfigKey pConfigKey) { String booleanS = getParameter(pConfigKey); return Boolean.parseBoolean(booleanS != null ? booleanS : pConfigKey.getDefaultValue()); }
java
public Boolean getParameterAsBool(ConfigKey pConfigKey) { String booleanS = getParameter(pConfigKey); return Boolean.parseBoolean(booleanS != null ? booleanS : pConfigKey.getDefaultValue()); }
[ "public", "Boolean", "getParameterAsBool", "(", "ConfigKey", "pConfigKey", ")", "{", "String", "booleanS", "=", "getParameter", "(", "pConfigKey", ")", ";", "return", "Boolean", ".", "parseBoolean", "(", "booleanS", "!=", "null", "?", "booleanS", ":", "pConfigKe...
Get a processing configuration as a boolean value @param pConfigKey configuration to lookup @return boolean value of the configuration, the default value or false if the default value is null
[ "Get", "a", "processing", "configuration", "as", "a", "boolean", "value" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxRequest.java#L136-L139
120,252
rhuss/jolokia
agent/core/src/main/java/org/jolokia/request/JmxRequest.java
JmxRequest.toJSON
public JSONObject toJSON() { JSONObject ret = new JSONObject(); ret.put("type",type.getName()); if (targetConfig != null) { ret.put("target", targetConfig.toJSON()); } if (pathParts != null) { try { ret.put("path",getPath()); }...
java
public JSONObject toJSON() { JSONObject ret = new JSONObject(); ret.put("type",type.getName()); if (targetConfig != null) { ret.put("target", targetConfig.toJSON()); } if (pathParts != null) { try { ret.put("path",getPath()); }...
[ "public", "JSONObject", "toJSON", "(", ")", "{", "JSONObject", "ret", "=", "new", "JSONObject", "(", ")", ";", "ret", ".", "put", "(", "\"type\"", ",", "type", ".", "getName", "(", ")", ")", ";", "if", "(", "targetConfig", "!=", "null", ")", "{", "...
Convert this request to a JSON object, which can be used as a part of a return value. @return JSON object representing this base request object
[ "Convert", "this", "request", "to", "a", "JSON", "object", "which", "can", "be", "used", "as", "a", "part", "of", "a", "return", "value", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxRequest.java#L209-L224
120,253
rhuss/jolokia
agent/core/src/main/java/org/jolokia/request/JmxRequest.java
JmxRequest.initParameters
private void initParameters(ProcessingParameters pParams) { processingConfig = pParams; String ignoreErrors = processingConfig.get(ConfigKey.IGNORE_ERRORS); if (ignoreErrors != null && ignoreErrors.matches("^(true|yes|on|1)$")) { valueFaultHandler = ValueFaultHandler.IGNORING_VALUE_F...
java
private void initParameters(ProcessingParameters pParams) { processingConfig = pParams; String ignoreErrors = processingConfig.get(ConfigKey.IGNORE_ERRORS); if (ignoreErrors != null && ignoreErrors.matches("^(true|yes|on|1)$")) { valueFaultHandler = ValueFaultHandler.IGNORING_VALUE_F...
[ "private", "void", "initParameters", "(", "ProcessingParameters", "pParams", ")", "{", "processingConfig", "=", "pParams", ";", "String", "ignoreErrors", "=", "processingConfig", ".", "get", "(", "ConfigKey", ".", "IGNORE_ERRORS", ")", ";", "if", "(", "ignoreError...
Init parameters and value fault handler
[ "Init", "parameters", "and", "value", "fault", "handler" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxRequest.java#L227-L235
120,254
rhuss/jolokia
agent/core/src/main/java/org/jolokia/request/RequestCreator.java
RequestCreator.prepareExtraArgs
protected List<String> prepareExtraArgs(Stack<String> pElements) { if (pElements == null || pElements.size() == 0) { return null; } List<String> ret = new ArrayList<String>(); while (!pElements.isEmpty()) { String element = pElements.pop(); ret.add("*"...
java
protected List<String> prepareExtraArgs(Stack<String> pElements) { if (pElements == null || pElements.size() == 0) { return null; } List<String> ret = new ArrayList<String>(); while (!pElements.isEmpty()) { String element = pElements.pop(); ret.add("*"...
[ "protected", "List", "<", "String", ">", "prepareExtraArgs", "(", "Stack", "<", "String", ">", "pElements", ")", "{", "if", "(", "pElements", "==", "null", "||", "pElements", ".", "size", "(", ")", "==", "0", ")", "{", "return", "null", ";", "}", "Li...
Extract extra arguments from the remaining element on the stack. @param pElements stack from where to extract extra elements @return the remaining elements as list (but never null).
[ "Extract", "extra", "arguments", "from", "the", "remaining", "element", "on", "the", "stack", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/RequestCreator.java#L67-L77
120,255
rhuss/jolokia
agent/core/src/main/java/org/jolokia/request/JmxRequestFactory.java
JmxRequestFactory.extractPathInfo
private static String extractPathInfo(String pPathInfo, ProcessingParameters pProcessingParams) { String pathInfo = pPathInfo; // If no pathinfo is given directly, we look for a query parameter named 'p'. // This variant is helpful, if there are problems with the server mangling // up t...
java
private static String extractPathInfo(String pPathInfo, ProcessingParameters pProcessingParams) { String pathInfo = pPathInfo; // If no pathinfo is given directly, we look for a query parameter named 'p'. // This variant is helpful, if there are problems with the server mangling // up t...
[ "private", "static", "String", "extractPathInfo", "(", "String", "pPathInfo", ",", "ProcessingParameters", "pProcessingParams", ")", "{", "String", "pathInfo", "=", "pPathInfo", ";", "// If no pathinfo is given directly, we look for a query parameter named 'p'.", "// This variant...
Extract path info either from the 'real' URL path, or from an request parameter
[ "Extract", "path", "info", "either", "from", "the", "real", "URL", "path", "or", "from", "an", "request", "parameter" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxRequestFactory.java#L145-L156
120,256
rhuss/jolokia
agent/core/src/main/java/org/jolokia/request/JmxRequestFactory.java
JmxRequestFactory.normalizePathInfo
private static String normalizePathInfo(String pPathInfo) { if (pPathInfo != null && pPathInfo.length() > 0) { return pPathInfo.startsWith("/") ? pPathInfo.substring(1) : pPathInfo; } else { return ""; } }
java
private static String normalizePathInfo(String pPathInfo) { if (pPathInfo != null && pPathInfo.length() > 0) { return pPathInfo.startsWith("/") ? pPathInfo.substring(1) : pPathInfo; } else { return ""; } }
[ "private", "static", "String", "normalizePathInfo", "(", "String", "pPathInfo", ")", "{", "if", "(", "pPathInfo", "!=", "null", "&&", "pPathInfo", ".", "length", "(", ")", ">", "0", ")", "{", "return", "pPathInfo", ".", "startsWith", "(", "\"/\"", ")", "...
Return always a non-null string and strip of leading slash
[ "Return", "always", "a", "non", "-", "null", "string", "and", "strip", "of", "leading", "slash" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxRequestFactory.java#L161-L167
120,257
rhuss/jolokia
agent/core/src/main/java/org/jolokia/request/JmxRequestFactory.java
JmxRequestFactory.getCreator
private static RequestCreator getCreator(RequestType pType) { RequestCreator creator = CREATOR_MAP.get(pType); if (creator == null) { throw new UnsupportedOperationException("Type " + pType + " is not supported (yet)"); } return creator; }
java
private static RequestCreator getCreator(RequestType pType) { RequestCreator creator = CREATOR_MAP.get(pType); if (creator == null) { throw new UnsupportedOperationException("Type " + pType + " is not supported (yet)"); } return creator; }
[ "private", "static", "RequestCreator", "getCreator", "(", "RequestType", "pType", ")", "{", "RequestCreator", "creator", "=", "CREATOR_MAP", ".", "get", "(", "pType", ")", ";", "if", "(", "creator", "==", "null", ")", "{", "throw", "new", "UnsupportedOperation...
Get the request creator for a specific type
[ "Get", "the", "request", "creator", "for", "a", "specific", "type" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxRequestFactory.java#L173-L179
120,258
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/MimeTypeUtil.java
MimeTypeUtil.isValidCallback
public static boolean isValidCallback(String pCallback) { Pattern validJavaScriptFunctionNamePattern = Pattern.compile("^[$A-Z_][0-9A-Z_$]*$", Pattern.CASE_INSENSITIVE); return validJavaScriptFunctionNamePattern.matcher(pCallback).matches(); }
java
public static boolean isValidCallback(String pCallback) { Pattern validJavaScriptFunctionNamePattern = Pattern.compile("^[$A-Z_][0-9A-Z_$]*$", Pattern.CASE_INSENSITIVE); return validJavaScriptFunctionNamePattern.matcher(pCallback).matches(); }
[ "public", "static", "boolean", "isValidCallback", "(", "String", "pCallback", ")", "{", "Pattern", "validJavaScriptFunctionNamePattern", "=", "Pattern", ".", "compile", "(", "\"^[$A-Z_][0-9A-Z_$]*$\"", ",", "Pattern", ".", "CASE_INSENSITIVE", ")", ";", "return", "vali...
Check that a callback matches a javascript function name. The argument must be not null @param pCallback callback to verify @return true if valud, false otherwise
[ "Check", "that", "a", "callback", "matches", "a", "javascript", "function", "name", ".", "The", "argument", "must", "be", "not", "null" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/MimeTypeUtil.java#L68-L72
120,259
rhuss/jolokia
agent/core/src/main/java/org/jolokia/restrictor/RestrictorFactory.java
RestrictorFactory.lookupPolicyRestrictor
public static PolicyRestrictor lookupPolicyRestrictor(String pLocation) throws IOException { InputStream is; if (pLocation.startsWith("classpath:")) { String path = pLocation.substring("classpath:".length()); is = ClassUtil.getResourceAsStream(path); if (is == null) {...
java
public static PolicyRestrictor lookupPolicyRestrictor(String pLocation) throws IOException { InputStream is; if (pLocation.startsWith("classpath:")) { String path = pLocation.substring("classpath:".length()); is = ClassUtil.getResourceAsStream(path); if (is == null) {...
[ "public", "static", "PolicyRestrictor", "lookupPolicyRestrictor", "(", "String", "pLocation", ")", "throws", "IOException", "{", "InputStream", "is", ";", "if", "(", "pLocation", ".", "startsWith", "(", "\"classpath:\"", ")", ")", "{", "String", "path", "=", "pL...
Lookup a restrictor based on an URL @param pLocation classpath or URL representing the location of the policy restrictor @return the restrictor created or <code>null</code> if none could be found. @throws IOException if reading of the policy stream failed
[ "Lookup", "a", "restrictor", "based", "on", "an", "URL" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/restrictor/RestrictorFactory.java#L109-L122
120,260
rhuss/jolokia
agent/core/src/main/java/org/jolokia/handler/list/DataUpdater.java
DataUpdater.update
void update(JSONObject pJSONObject, MBeanInfo pMBeanInfo, Stack<String> pPathStack) { boolean isPathEmpty = pPathStack == null || pPathStack.empty(); String filter = pPathStack != null && !pPathStack.empty() ? pPathStack.pop() : null; verifyThatPathIsEmpty(pPathStack); JSONObject attrM...
java
void update(JSONObject pJSONObject, MBeanInfo pMBeanInfo, Stack<String> pPathStack) { boolean isPathEmpty = pPathStack == null || pPathStack.empty(); String filter = pPathStack != null && !pPathStack.empty() ? pPathStack.pop() : null; verifyThatPathIsEmpty(pPathStack); JSONObject attrM...
[ "void", "update", "(", "JSONObject", "pJSONObject", ",", "MBeanInfo", "pMBeanInfo", ",", "Stack", "<", "String", ">", "pPathStack", ")", "{", "boolean", "isPathEmpty", "=", "pPathStack", "==", "null", "||", "pPathStack", ".", "empty", "(", ")", ";", "String"...
Update the given JSON object with the data extracted from the given MBeanInfo @param pJSONObject JSON object to update @param pMBeanInfo info to extract from @param pPathStack stack for further constraining the result
[ "Update", "the", "given", "JSON", "object", "with", "the", "data", "extracted", "from", "the", "given", "MBeanInfo" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/list/DataUpdater.java#L48-L61
120,261
rhuss/jolokia
agent/core/src/main/java/org/jolokia/handler/list/DataUpdater.java
DataUpdater.verifyThatPathIsEmpty
protected void verifyThatPathIsEmpty(Stack<String> pPathStack) { if (pPathStack != null && pPathStack.size() > 0) { throw new IllegalArgumentException("Path contains extra elements not usable for a list request: " + pPathStack); } }
java
protected void verifyThatPathIsEmpty(Stack<String> pPathStack) { if (pPathStack != null && pPathStack.size() > 0) { throw new IllegalArgumentException("Path contains extra elements not usable for a list request: " + pPathStack); } }
[ "protected", "void", "verifyThatPathIsEmpty", "(", "Stack", "<", "String", ">", "pPathStack", ")", "{", "if", "(", "pPathStack", "!=", "null", "&&", "pPathStack", ".", "size", "(", ")", ">", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "...
Check whether the given path is empty, if not, then throw an exception @param pPathStack path to check
[ "Check", "whether", "the", "given", "path", "is", "empty", "if", "not", "then", "throw", "an", "exception" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/list/DataUpdater.java#L82-L86
120,262
rhuss/jolokia
agent/jvm/src/main/java/org/jolokia/jvmagent/security/ClientCertAuthenticator.java
ClientCertAuthenticator.checkCertForClientUsage
private void checkCertForClientUsage(X509Certificate clientCert) { try { // We required that the extended key usage must be present if we are using // client cert authentication if (extendedClientCheck && (clientCert.getExtendedKeyUsage() == null || ...
java
private void checkCertForClientUsage(X509Certificate clientCert) { try { // We required that the extended key usage must be present if we are using // client cert authentication if (extendedClientCheck && (clientCert.getExtendedKeyUsage() == null || ...
[ "private", "void", "checkCertForClientUsage", "(", "X509Certificate", "clientCert", ")", "{", "try", "{", "// We required that the extended key usage must be present if we are using", "// client cert authentication", "if", "(", "extendedClientCheck", "&&", "(", "clientCert", ".",...
If an empty list as allowedPrincipals is given, no one is allowed to access
[ "If", "an", "empty", "list", "as", "allowedPrincipals", "is", "given", "no", "one", "is", "allowed", "to", "access" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/security/ClientCertAuthenticator.java#L101-L113
120,263
rhuss/jolokia
agent/osgi/src/main/java/org/jolokia/osgi/security/DelegatingRestrictor.java
DelegatingRestrictor.checkRestrictorService
private boolean checkRestrictorService(RestrictorCheck pCheck, Object ... args) { try { ServiceReference[] serviceRefs = bundleContext.getServiceReferences(Restrictor.class.getName(),null); if (serviceRefs != null) { boolean ret = true; boolean found = fal...
java
private boolean checkRestrictorService(RestrictorCheck pCheck, Object ... args) { try { ServiceReference[] serviceRefs = bundleContext.getServiceReferences(Restrictor.class.getName(),null); if (serviceRefs != null) { boolean ret = true; boolean found = fal...
[ "private", "boolean", "checkRestrictorService", "(", "RestrictorCheck", "pCheck", ",", "Object", "...", "args", ")", "{", "try", "{", "ServiceReference", "[", "]", "serviceRefs", "=", "bundleContext", ".", "getServiceReferences", "(", "Restrictor", ".", "class", "...
Actual check which delegate to one or more restrictor services if available. @param pCheck a function object for performing the actual check @param args arguments passed through to the check @return true if all checks return true
[ "Actual", "check", "which", "delegate", "to", "one", "or", "more", "restrictor", "services", "if", "available", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/osgi/src/main/java/org/jolokia/osgi/security/DelegatingRestrictor.java#L52-L73
120,264
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/DebugStore.java
DebugStore.log
public void log(String pMessage, Throwable pThrowable) { add(System.currentTimeMillis() / 1000,pMessage,pThrowable); }
java
public void log(String pMessage, Throwable pThrowable) { add(System.currentTimeMillis() / 1000,pMessage,pThrowable); }
[ "public", "void", "log", "(", "String", "pMessage", ",", "Throwable", "pThrowable", ")", "{", "add", "(", "System", ".", "currentTimeMillis", "(", ")", "/", "1000", ",", "pMessage", ",", "pThrowable", ")", ";", "}" ]
Store the given message in this store if debug is switched on @param pMessage message to store @param pThrowable exception to store
[ "Store", "the", "given", "message", "in", "this", "store", "if", "debug", "is", "switched", "on" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/DebugStore.java#L68-L70
120,265
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/DebugStore.java
DebugStore.debugInfo
public String debugInfo() { if (!isDebug || debugEntries.size() == 0) { return ""; } StringBuffer ret = new StringBuffer(); for (int i = debugEntries.size() - 1;i >= 0;i--) { Entry entry = debugEntries.get(i); ret.append(entry.timestamp).append(": ").a...
java
public String debugInfo() { if (!isDebug || debugEntries.size() == 0) { return ""; } StringBuffer ret = new StringBuffer(); for (int i = debugEntries.size() - 1;i >= 0;i--) { Entry entry = debugEntries.get(i); ret.append(entry.timestamp).append(": ").a...
[ "public", "String", "debugInfo", "(", ")", "{", "if", "(", "!", "isDebug", "||", "debugEntries", ".", "size", "(", ")", "==", "0", ")", "{", "return", "\"\"", ";", "}", "StringBuffer", "ret", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "...
Get back all previously logged and stored debug messages @return debug string
[ "Get", "back", "all", "previously", "logged", "and", "stored", "debug", "messages" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/DebugStore.java#L77-L92
120,266
rhuss/jolokia
agent/core/src/main/java/org/jolokia/util/DebugStore.java
DebugStore.add
private synchronized void add(long pTime,String message) { debugEntries.addFirst(new Entry(pTime,message)); trim(); }
java
private synchronized void add(long pTime,String message) { debugEntries.addFirst(new Entry(pTime,message)); trim(); }
[ "private", "synchronized", "void", "add", "(", "long", "pTime", ",", "String", "message", ")", "{", "debugEntries", ".", "addFirst", "(", "new", "Entry", "(", "pTime", ",", "message", ")", ")", ";", "trim", "(", ")", ";", "}" ]
add a message along with a time stamp
[ "add", "a", "message", "along", "with", "a", "time", "stamp" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/DebugStore.java#L142-L145
120,267
rhuss/jolokia
agent/core/src/main/java/org/jolokia/config/Configuration.java
Configuration.updateGlobalConfiguration
public void updateGlobalConfiguration(ConfigExtractor pExtractor) { Enumeration e = pExtractor.getNames(); while (e.hasMoreElements()) { String keyS = (String) e.nextElement(); ConfigKey key = ConfigKey.getGlobalConfigKey(keyS); if (key != null) { glob...
java
public void updateGlobalConfiguration(ConfigExtractor pExtractor) { Enumeration e = pExtractor.getNames(); while (e.hasMoreElements()) { String keyS = (String) e.nextElement(); ConfigKey key = ConfigKey.getGlobalConfigKey(keyS); if (key != null) { glob...
[ "public", "void", "updateGlobalConfiguration", "(", "ConfigExtractor", "pExtractor", ")", "{", "Enumeration", "e", "=", "pExtractor", ".", "getNames", "(", ")", ";", "while", "(", "e", ".", "hasMoreElements", "(", ")", ")", "{", "String", "keyS", "=", "(", ...
Update the configuration hold by this object @param pExtractor an extractor for retrieving the configuration from some external object
[ "Update", "the", "configuration", "hold", "by", "this", "object" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/config/Configuration.java#L53-L63
120,268
rhuss/jolokia
agent/core/src/main/java/org/jolokia/config/Configuration.java
Configuration.updateGlobalConfiguration
public void updateGlobalConfiguration(Map<String, String> pConfig) { for (ConfigKey c : ConfigKey.values()) { if (c.isGlobalConfig()) { String value = pConfig.get(c.getKeyValue()); if (value != null) { globalConfig.put(c,value); } ...
java
public void updateGlobalConfiguration(Map<String, String> pConfig) { for (ConfigKey c : ConfigKey.values()) { if (c.isGlobalConfig()) { String value = pConfig.get(c.getKeyValue()); if (value != null) { globalConfig.put(c,value); } ...
[ "public", "void", "updateGlobalConfiguration", "(", "Map", "<", "String", ",", "String", ">", "pConfig", ")", "{", "for", "(", "ConfigKey", "c", ":", "ConfigKey", ".", "values", "(", ")", ")", "{", "if", "(", "c", ".", "isGlobalConfig", "(", ")", ")", ...
Update this global configuration from a string-string. Only the known keys are taken from this map @param pConfig config map from where to take the configuration
[ "Update", "this", "global", "configuration", "from", "a", "string", "-", "string", ".", "Only", "the", "known", "keys", "are", "taken", "from", "this", "map" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/config/Configuration.java#L71-L80
120,269
rhuss/jolokia
agent/core/src/main/java/org/jolokia/config/Configuration.java
Configuration.get
public String get(ConfigKey pKey) { String value = globalConfig.get(pKey); if (value == null) { value = pKey.getDefaultValue(); } return value; }
java
public String get(ConfigKey pKey) { String value = globalConfig.get(pKey); if (value == null) { value = pKey.getDefaultValue(); } return value; }
[ "public", "String", "get", "(", "ConfigKey", "pKey", ")", "{", "String", "value", "=", "globalConfig", ".", "get", "(", "pKey", ")", ";", "if", "(", "value", "==", "null", ")", "{", "value", "=", "pKey", ".", "getDefaultValue", "(", ")", ";", "}", ...
Get a configuration value if set as configuration or the default value if not @param pKey the configuration key to lookup @return the configuration value or the default value if no configuration was given.
[ "Get", "a", "configuration", "value", "if", "set", "as", "configuration", "or", "the", "default", "value", "if", "not" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/config/Configuration.java#L90-L96
120,270
rhuss/jolokia
agent/core/src/main/java/org/jolokia/config/Configuration.java
Configuration.getAsInt
public int getAsInt(ConfigKey pKey) { int ret; try { ret = Integer.parseInt(get(pKey)); } catch (NumberFormatException exp) { ret = Integer.parseInt(pKey.getDefaultValue()); } return ret; }
java
public int getAsInt(ConfigKey pKey) { int ret; try { ret = Integer.parseInt(get(pKey)); } catch (NumberFormatException exp) { ret = Integer.parseInt(pKey.getDefaultValue()); } return ret; }
[ "public", "int", "getAsInt", "(", "ConfigKey", "pKey", ")", "{", "int", "ret", ";", "try", "{", "ret", "=", "Integer", ".", "parseInt", "(", "get", "(", "pKey", ")", ")", ";", "}", "catch", "(", "NumberFormatException", "exp", ")", "{", "ret", "=", ...
Get an configuration value as int value @param pKey the configuration key @return the value set or, if not, the default value
[ "Get", "an", "configuration", "value", "as", "int", "value" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/config/Configuration.java#L103-L111
120,271
rhuss/jolokia
agent/core/src/main/java/org/jolokia/config/Configuration.java
Configuration.getProcessingParameters
public ProcessingParameters getProcessingParameters(Map<String,String> pParams) { Map<ConfigKey,String> procParams = ProcessingParameters.convertToConfigMap(pParams); for (Map.Entry<ConfigKey,String> entry : globalConfig.entrySet()) { ConfigKey key = entry.getKey(); if (key.isReq...
java
public ProcessingParameters getProcessingParameters(Map<String,String> pParams) { Map<ConfigKey,String> procParams = ProcessingParameters.convertToConfigMap(pParams); for (Map.Entry<ConfigKey,String> entry : globalConfig.entrySet()) { ConfigKey key = entry.getKey(); if (key.isReq...
[ "public", "ProcessingParameters", "getProcessingParameters", "(", "Map", "<", "String", ",", "String", ">", "pParams", ")", "{", "Map", "<", "ConfigKey", ",", "String", ">", "procParams", "=", "ProcessingParameters", ".", "convertToConfigMap", "(", "pParams", ")",...
Get processing parameters from a string-string map @param pParams params to extra. A parameter "p" is used as extra path info @return the processing parameters
[ "Get", "processing", "parameters", "from", "a", "string", "-", "string", "map" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/config/Configuration.java#L119-L128
120,272
rhuss/jolokia
agent/jvm/src/main/java/org/jolokia/jvmagent/CleanupThread.java
CleanupThread.enumerateThreads
private Thread[] enumerateThreads() { boolean fits = false; int inc = 50; Thread[] threads = null; int nrThreads = 0; while (!fits) { try { threads = new Thread[Thread.activeCount()+inc]; nrThreads = Thread.enumerate(threads); ...
java
private Thread[] enumerateThreads() { boolean fits = false; int inc = 50; Thread[] threads = null; int nrThreads = 0; while (!fits) { try { threads = new Thread[Thread.activeCount()+inc]; nrThreads = Thread.enumerate(threads); ...
[ "private", "Thread", "[", "]", "enumerateThreads", "(", ")", "{", "boolean", "fits", "=", "false", ";", "int", "inc", "=", "50", ";", "Thread", "[", "]", "threads", "=", "null", ";", "int", "nrThreads", "=", "0", ";", "while", "(", "!", "fits", ")"...
Enumerate all active threads
[ "Enumerate", "all", "active", "threads" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/CleanupThread.java#L77-L95
120,273
rhuss/jolokia
agent/jvm/src/main/java/org/jolokia/jvmagent/CleanupThread.java
CleanupThread.joinThreads
private boolean joinThreads(Thread pThreads[]) { for (int i=0;i< pThreads.length;i++) { final Thread t = pThreads[i]; if (t.isDaemon() || t.getThreadGroup() == null || // has died on us t.getThreadGroup().equals(threadGroup) || ...
java
private boolean joinThreads(Thread pThreads[]) { for (int i=0;i< pThreads.length;i++) { final Thread t = pThreads[i]; if (t.isDaemon() || t.getThreadGroup() == null || // has died on us t.getThreadGroup().equals(threadGroup) || ...
[ "private", "boolean", "joinThreads", "(", "Thread", "pThreads", "[", "]", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pThreads", ".", "length", ";", "i", "++", ")", "{", "final", "Thread", "t", "=", "pThreads", "[", "i", "]", ";",...
Join threads, return false if only our own threads are left.
[ "Join", "threads", "return", "false", "if", "only", "our", "own", "threads", "are", "left", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/CleanupThread.java#L98-L120
120,274
rhuss/jolokia
agent/osgi/src/main/java/org/jolokia/osgi/JolokiaActivator.java
JolokiaActivator.getHttpContext
public synchronized HttpContext getHttpContext() { if (jolokiaHttpContext == null) { final String user = getConfiguration(USER); final String authMode = getConfiguration(AUTH_MODE); if (user == null) { if (ServiceAuthenticationHttpContext.shouldBeUsed(authMode...
java
public synchronized HttpContext getHttpContext() { if (jolokiaHttpContext == null) { final String user = getConfiguration(USER); final String authMode = getConfiguration(AUTH_MODE); if (user == null) { if (ServiceAuthenticationHttpContext.shouldBeUsed(authMode...
[ "public", "synchronized", "HttpContext", "getHttpContext", "(", ")", "{", "if", "(", "jolokiaHttpContext", "==", "null", ")", "{", "final", "String", "user", "=", "getConfiguration", "(", "USER", ")", ";", "final", "String", "authMode", "=", "getConfiguration", ...
Get the security context for out servlet. Dependent on the configuration, this is either a no-op context or one which authenticates with a given user @return the HttpContext with which the agent servlet gets registered.
[ "Get", "the", "security", "context", "for", "out", "servlet", ".", "Dependent", "on", "the", "configuration", "this", "is", "either", "a", "no", "-", "op", "context", "or", "one", "which", "authenticates", "with", "a", "given", "user" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/osgi/src/main/java/org/jolokia/osgi/JolokiaActivator.java#L147-L164
120,275
rhuss/jolokia
agent/osgi/src/main/java/org/jolokia/osgi/JolokiaActivator.java
JolokiaActivator.getConfiguration
private Dictionary<String,String> getConfiguration() { Dictionary<String,String> config = new Hashtable<String,String>(); for (ConfigKey key : ConfigKey.values()) { String value = getConfiguration(key); if (value != null) { config.put(key.getKeyValue(),value); ...
java
private Dictionary<String,String> getConfiguration() { Dictionary<String,String> config = new Hashtable<String,String>(); for (ConfigKey key : ConfigKey.values()) { String value = getConfiguration(key); if (value != null) { config.put(key.getKeyValue(),value); ...
[ "private", "Dictionary", "<", "String", ",", "String", ">", "getConfiguration", "(", ")", "{", "Dictionary", "<", "String", ",", "String", ">", "config", "=", "new", "Hashtable", "<", "String", ",", "String", ">", "(", ")", ";", "for", "(", "ConfigKey", ...
Customizer for registering servlet at a HttpService
[ "Customizer", "for", "registering", "servlet", "at", "a", "HttpService" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/osgi/src/main/java/org/jolokia/osgi/JolokiaActivator.java#L177-L192
120,276
rhuss/jolokia
agent/core/src/main/java/org/jolokia/converter/json/ObjectSerializationContext.java
ObjectSerializationContext.push
void push(Object object) { callStack.push(object); if (object != null && !SIMPLE_TYPES.contains(object.getClass())) { objectsInCallStack.add(object); } objectCount++; }
java
void push(Object object) { callStack.push(object); if (object != null && !SIMPLE_TYPES.contains(object.getClass())) { objectsInCallStack.add(object); } objectCount++; }
[ "void", "push", "(", "Object", "object", ")", "{", "callStack", ".", "push", "(", "object", ")", ";", "if", "(", "object", "!=", "null", "&&", "!", "SIMPLE_TYPES", ".", "contains", "(", "object", ".", "getClass", "(", ")", ")", ")", "{", "objectsInCa...
Push a new object on the stack @param object to push
[ "Push", "a", "new", "object", "on", "the", "stack" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ObjectSerializationContext.java#L113-L120
120,277
rhuss/jolokia
agent/core/src/main/java/org/jolokia/converter/json/ObjectSerializationContext.java
ObjectSerializationContext.pop
Object pop() { Object ret = callStack.pop(); if (ret != null && !SIMPLE_TYPES.contains(ret.getClass())) { objectsInCallStack.remove(ret); } return ret; }
java
Object pop() { Object ret = callStack.pop(); if (ret != null && !SIMPLE_TYPES.contains(ret.getClass())) { objectsInCallStack.remove(ret); } return ret; }
[ "Object", "pop", "(", ")", "{", "Object", "ret", "=", "callStack", ".", "pop", "(", ")", ";", "if", "(", "ret", "!=", "null", "&&", "!", "SIMPLE_TYPES", ".", "contains", "(", "ret", ".", "getClass", "(", ")", ")", ")", "{", "objectsInCallStack", "....
Remove an object from top of the call stack @return the object popped
[ "Remove", "an", "object", "from", "top", "of", "the", "call", "stack" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ObjectSerializationContext.java#L126-L132
120,278
rhuss/jolokia
agent/core/src/main/java/org/jolokia/restrictor/policy/MBeanAccessChecker.java
MBeanAccessChecker.extractMbeanConfiguration
private void extractMbeanConfiguration(NodeList pNodes,MBeanPolicyConfig pConfig) throws MalformedObjectNameException { for (int i = 0;i< pNodes.getLength();i++) { Node node = pNodes.item(i); if (node.getNodeType() != Node.ELEMENT_NODE) { continue; } ...
java
private void extractMbeanConfiguration(NodeList pNodes,MBeanPolicyConfig pConfig) throws MalformedObjectNameException { for (int i = 0;i< pNodes.getLength();i++) { Node node = pNodes.item(i); if (node.getNodeType() != Node.ELEMENT_NODE) { continue; } ...
[ "private", "void", "extractMbeanConfiguration", "(", "NodeList", "pNodes", ",", "MBeanPolicyConfig", "pConfig", ")", "throws", "MalformedObjectNameException", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pNodes", ".", "getLength", "(", ")", ";", "i",...
Extract configuration and put it into a given MBeanPolicyConfig
[ "Extract", "configuration", "and", "put", "it", "into", "a", "given", "MBeanPolicyConfig" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/restrictor/policy/MBeanAccessChecker.java#L103-L111
120,279
rhuss/jolokia
agent/core/src/main/java/org/jolokia/restrictor/policy/MBeanAccessChecker.java
MBeanAccessChecker.wildcardMatch
private boolean wildcardMatch(Set<String> pValues, String pValue) { for (String pattern : pValues) { if (pattern.contains("*") && pValue.matches(pattern.replaceAll("\\*",".*"))) { return true; } } return false; }
java
private boolean wildcardMatch(Set<String> pValues, String pValue) { for (String pattern : pValues) { if (pattern.contains("*") && pValue.matches(pattern.replaceAll("\\*",".*"))) { return true; } } return false; }
[ "private", "boolean", "wildcardMatch", "(", "Set", "<", "String", ">", "pValues", ",", "String", "pValue", ")", "{", "for", "(", "String", "pattern", ":", "pValues", ")", "{", "if", "(", "pattern", ".", "contains", "(", "\"*\"", ")", "&&", "pValue", "....
Check whether a value matches patterns in pValues
[ "Check", "whether", "a", "value", "matches", "patterns", "in", "pValues" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/restrictor/policy/MBeanAccessChecker.java#L180-L187
120,280
rhuss/jolokia
agent/core/src/main/java/org/jolokia/detector/GlassfishDetector.java
GlassfishDetector.extractVersionFromFullVersion
private String extractVersionFromFullVersion(String pFullVersion) { if (pFullVersion != null) { Matcher matcher = GLASSFISH_VERSION.matcher(pFullVersion); if (matcher.matches()) { serverName = GLASSFISH_NAME; vendorName = GLASSFISH_VENDOR_NAME; ...
java
private String extractVersionFromFullVersion(String pFullVersion) { if (pFullVersion != null) { Matcher matcher = GLASSFISH_VERSION.matcher(pFullVersion); if (matcher.matches()) { serverName = GLASSFISH_NAME; vendorName = GLASSFISH_VENDOR_NAME; ...
[ "private", "String", "extractVersionFromFullVersion", "(", "String", "pFullVersion", ")", "{", "if", "(", "pFullVersion", "!=", "null", ")", "{", "Matcher", "matcher", "=", "GLASSFISH_VERSION", ".", "matcher", "(", "pFullVersion", ")", ";", "if", "(", "matcher",...
Tries to match Glassfish first, then Payara Server, updating server and vendor name
[ "Tries", "to", "match", "Glassfish", "first", "then", "Payara", "Server", "updating", "server", "and", "vendor", "name" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/GlassfishDetector.java#L84-L100
120,281
rhuss/jolokia
agent/core/src/main/java/org/jolokia/detector/GlassfishDetector.java
GlassfishDetector.bootAmx
private synchronized boolean bootAmx(MBeanServerExecutor pServers, final LogHandler pLoghandler) { ObjectName bootMBean = null; try { bootMBean = new ObjectName("amx-support:type=boot-amx"); } catch (MalformedObjectNameException e) { // Cannot happen .... } ...
java
private synchronized boolean bootAmx(MBeanServerExecutor pServers, final LogHandler pLoghandler) { ObjectName bootMBean = null; try { bootMBean = new ObjectName("amx-support:type=boot-amx"); } catch (MalformedObjectNameException e) { // Cannot happen .... } ...
[ "private", "synchronized", "boolean", "bootAmx", "(", "MBeanServerExecutor", "pServers", ",", "final", "LogHandler", "pLoghandler", ")", "{", "ObjectName", "bootMBean", "=", "null", ";", "try", "{", "bootMBean", "=", "new", "ObjectName", "(", "\"amx-support:type=boo...
Return true if AMX could be booted, false otherwise
[ "Return", "true", "if", "AMX", "could", "be", "booted", "false", "otherwise" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/GlassfishDetector.java#L107-L138
120,282
rhuss/jolokia
agent/core/src/main/java/org/jolokia/converter/json/simplifier/SimplifierExtractor.java
SimplifierExtractor.addExtractor
protected final void addExtractor(String pName, AttributeExtractor<T> pExtractor) { extractorMap.put(pName,pExtractor); }
java
protected final void addExtractor(String pName, AttributeExtractor<T> pExtractor) { extractorMap.put(pName,pExtractor); }
[ "protected", "final", "void", "addExtractor", "(", "String", "pName", ",", "AttributeExtractor", "<", "T", ">", "pExtractor", ")", "{", "extractorMap", ".", "put", "(", "pName", ",", "pExtractor", ")", ";", "}" ]
Add a single extractor @param pName name of the extractor @param pExtractor the extractor itself
[ "Add", "a", "single", "extractor" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/simplifier/SimplifierExtractor.java#L147-L149
120,283
rhuss/jolokia
agent/core/src/main/java/org/jolokia/history/HistoryStore.java
HistoryStore.setGlobalMaxEntries
public synchronized void setGlobalMaxEntries(int pGlobalMaxEntries) { globalMaxEntries = pGlobalMaxEntries; // Refresh all entries for (HistoryEntry entry : historyStore.values()) { entry.setMaxEntries(globalMaxEntries); } }
java
public synchronized void setGlobalMaxEntries(int pGlobalMaxEntries) { globalMaxEntries = pGlobalMaxEntries; // Refresh all entries for (HistoryEntry entry : historyStore.values()) { entry.setMaxEntries(globalMaxEntries); } }
[ "public", "synchronized", "void", "setGlobalMaxEntries", "(", "int", "pGlobalMaxEntries", ")", "{", "globalMaxEntries", "=", "pGlobalMaxEntries", ";", "// Refresh all entries", "for", "(", "HistoryEntry", "entry", ":", "historyStore", ".", "values", "(", ")", ")", "...
Set the global maximum limit for history entries. @param pGlobalMaxEntries limit
[ "Set", "the", "global", "maximum", "limit", "for", "history", "entries", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/history/HistoryStore.java#L80-L86
120,284
rhuss/jolokia
agent/core/src/main/java/org/jolokia/history/HistoryStore.java
HistoryStore.configure
public synchronized void configure(HistoryKey pKey, HistoryLimit pHistoryLimit) { // Remove entries if set to null if (pHistoryLimit == null) { removeEntries(pKey); return; } HistoryLimit limit = pHistoryLimit.respectGlobalMaxEntries(globalMaxEntries); if...
java
public synchronized void configure(HistoryKey pKey, HistoryLimit pHistoryLimit) { // Remove entries if set to null if (pHistoryLimit == null) { removeEntries(pKey); return; } HistoryLimit limit = pHistoryLimit.respectGlobalMaxEntries(globalMaxEntries); if...
[ "public", "synchronized", "void", "configure", "(", "HistoryKey", "pKey", ",", "HistoryLimit", "pHistoryLimit", ")", "{", "// Remove entries if set to null", "if", "(", "pHistoryLimit", "==", "null", ")", "{", "removeEntries", "(", "pKey", ")", ";", "return", ";",...
Configure the history length for a specific entry. If the length is 0 disable history for this key. Please note, that this method might change the limit object so the ownership of this object goes over to the callee. @param pKey history key @param pHistoryLimit limit to apply or <code>null</code> if no history should ...
[ "Configure", "the", "history", "length", "for", "a", "specific", "entry", ".", "If", "the", "length", "is", "0", "disable", "history", "for", "this", "key", ".", "Please", "note", "that", "this", "method", "might", "change", "the", "limit", "object", "so",...
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/history/HistoryStore.java#L96-L122
120,285
rhuss/jolokia
agent/core/src/main/java/org/jolokia/history/HistoryStore.java
HistoryStore.updateAndAdd
public synchronized void updateAndAdd(JmxRequest pJmxReq, JSONObject pJson) { long timestamp = System.currentTimeMillis() / 1000; pJson.put(KEY_TIMESTAMP,timestamp); RequestType type = pJmxReq.getType(); HistoryUpdater updater = historyUpdaters.get(type); if (updater != null) {...
java
public synchronized void updateAndAdd(JmxRequest pJmxReq, JSONObject pJson) { long timestamp = System.currentTimeMillis() / 1000; pJson.put(KEY_TIMESTAMP,timestamp); RequestType type = pJmxReq.getType(); HistoryUpdater updater = historyUpdaters.get(type); if (updater != null) {...
[ "public", "synchronized", "void", "updateAndAdd", "(", "JmxRequest", "pJmxReq", ",", "JSONObject", "pJson", ")", "{", "long", "timestamp", "=", "System", ".", "currentTimeMillis", "(", ")", "/", "1000", ";", "pJson", ".", "put", "(", "KEY_TIMESTAMP", ",", "t...
Update the history store with the value of an an read, write or execute operation. Also, the timestamp of the insertion is recorded. Also, the recorded history values are added to the given json value. @param pJmxReq request for which an entry should be added in this history store @param pJson the JSONObject to which ...
[ "Update", "the", "history", "store", "with", "the", "value", "of", "an", "an", "read", "write", "or", "execute", "operation", ".", "Also", "the", "timestamp", "of", "the", "insertion", "is", "recorded", ".", "Also", "the", "recorded", "history", "values", ...
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/history/HistoryStore.java#L139-L148
120,286
rhuss/jolokia
agent/core/src/main/java/org/jolokia/history/HistoryStore.java
HistoryStore.getSize
public synchronized int getSize() { try { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); ObjectOutputStream oOut = new ObjectOutputStream(bOut); oOut.writeObject(historyStore); bOut.close(); return bOut.size(); } catch (IOException e...
java
public synchronized int getSize() { try { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); ObjectOutputStream oOut = new ObjectOutputStream(bOut); oOut.writeObject(historyStore); bOut.close(); return bOut.size(); } catch (IOException e...
[ "public", "synchronized", "int", "getSize", "(", ")", "{", "try", "{", "ByteArrayOutputStream", "bOut", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "ObjectOutputStream", "oOut", "=", "new", "ObjectOutputStream", "(", "bOut", ")", ";", "oOut", ".", "wri...
Get the size of this history store in bytes @return size in bytes
[ "Get", "the", "size", "of", "this", "history", "store", "in", "bytes" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/history/HistoryStore.java#L155-L165
120,287
rhuss/jolokia
agent/core/src/main/java/org/jolokia/history/HistoryStore.java
HistoryStore.initHistoryUpdaters
private void initHistoryUpdaters() { historyUpdaters.put(RequestType.EXEC, new HistoryUpdater<JmxExecRequest>() { /** {@inheritDoc} */ public void updateHistory(JSONObject pJson,JmxExecRequest request, long pTimestamp) {...
java
private void initHistoryUpdaters() { historyUpdaters.put(RequestType.EXEC, new HistoryUpdater<JmxExecRequest>() { /** {@inheritDoc} */ public void updateHistory(JSONObject pJson,JmxExecRequest request, long pTimestamp) {...
[ "private", "void", "initHistoryUpdaters", "(", ")", "{", "historyUpdaters", ".", "put", "(", "RequestType", ".", "EXEC", ",", "new", "HistoryUpdater", "<", "JmxExecRequest", ">", "(", ")", "{", "/** {@inheritDoc} */", "public", "void", "updateHistory", "(", "JSO...
A set of updaters which are dispatched to for certain request types
[ "A", "set", "of", "updaters", "which", "are", "dispatched", "to", "for", "certain", "request", "types" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/history/HistoryStore.java#L188-L223
120,288
rhuss/jolokia
agent/core/src/main/java/org/jolokia/history/HistoryStore.java
HistoryStore.updateReadHistory
private void updateReadHistory(JmxReadRequest pJmxReq, JSONObject pJson, long pTimestamp) { ObjectName name = pJmxReq.getObjectName(); if (name.isPattern()) { // We have a pattern and hence a value structure // of bean -> attribute_key -> attribute_value Map<String,O...
java
private void updateReadHistory(JmxReadRequest pJmxReq, JSONObject pJson, long pTimestamp) { ObjectName name = pJmxReq.getObjectName(); if (name.isPattern()) { // We have a pattern and hence a value structure // of bean -> attribute_key -> attribute_value Map<String,O...
[ "private", "void", "updateReadHistory", "(", "JmxReadRequest", "pJmxReq", ",", "JSONObject", "pJson", ",", "long", "pTimestamp", ")", "{", "ObjectName", "name", "=", "pJmxReq", ".", "getObjectName", "(", ")", ";", "if", "(", "name", ".", "isPattern", "(", ")...
return multiple values with a single request
[ "return", "multiple", "values", "with", "a", "single", "request" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/history/HistoryStore.java#L250-L283
120,289
rhuss/jolokia
agent/core/src/main/java/org/jolokia/history/HistoryStore.java
HistoryStore.addAttributeFromSingleValue
private JSONObject addAttributeFromSingleValue(HistoryKey pKey, String pAttrName, Object pValue, long pTimestamp) { HistoryEntry entry = getEntry(pKey,pValue,pTimestamp); return entry != null ? addToHistoryEntryAndGetCurrentHistory(new JSONObject(), entry, pAttrName, pValue, pTimestamp) ...
java
private JSONObject addAttributeFromSingleValue(HistoryKey pKey, String pAttrName, Object pValue, long pTimestamp) { HistoryEntry entry = getEntry(pKey,pValue,pTimestamp); return entry != null ? addToHistoryEntryAndGetCurrentHistory(new JSONObject(), entry, pAttrName, pValue, pTimestamp) ...
[ "private", "JSONObject", "addAttributeFromSingleValue", "(", "HistoryKey", "pKey", ",", "String", "pAttrName", ",", "Object", "pValue", ",", "long", "pTimestamp", ")", "{", "HistoryEntry", "entry", "=", "getEntry", "(", "pKey", ",", "pValue", ",", "pTimestamp", ...
Return a fresh map
[ "Return", "a", "fresh", "map" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/history/HistoryStore.java#L366-L371
120,290
rhuss/jolokia
client/java/src/main/java/org/jolokia/client/J4pClient.java
J4pClient.extractResponses
private <R extends J4pResponse<T>, T extends J4pRequest> List<R> extractResponses(JSONAware pJsonResponse, List<T> pRequests, J4pResponseExtractor p...
java
private <R extends J4pResponse<T>, T extends J4pRequest> List<R> extractResponses(JSONAware pJsonResponse, List<T> pRequests, J4pResponseExtractor p...
[ "private", "<", "R", "extends", "J4pResponse", "<", "T", ">", ",", "T", "extends", "J4pRequest", ">", "List", "<", "R", ">", "extractResponses", "(", "JSONAware", "pJsonResponse", ",", "List", "<", "T", ">", "pRequests", ",", "J4pResponseExtractor", "pRespon...
Extract J4pResponses from a returned bulk JSON answer
[ "Extract", "J4pResponses", "from", "a", "returned", "bulk", "JSON", "answer" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/J4pClient.java#L285-L320
120,291
rhuss/jolokia
client/java/src/main/java/org/jolokia/client/J4pClient.java
J4pClient.mapException
private J4pException mapException(Exception pException) throws J4pException { if (pException instanceof ConnectException) { return new J4pConnectException( "Cannot connect to " + requestHandler.getJ4pServerUrl() + ": " + pException.getMessage(), (ConnectExcept...
java
private J4pException mapException(Exception pException) throws J4pException { if (pException instanceof ConnectException) { return new J4pConnectException( "Cannot connect to " + requestHandler.getJ4pServerUrl() + ": " + pException.getMessage(), (ConnectExcept...
[ "private", "J4pException", "mapException", "(", "Exception", "pException", ")", "throws", "J4pException", "{", "if", "(", "pException", "instanceof", "ConnectException", ")", "{", "return", "new", "J4pConnectException", "(", "\"Cannot connect to \"", "+", "requestHandle...
Map IO-Exceptions accordingly
[ "Map", "IO", "-", "Exceptions", "accordingly" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/J4pClient.java#L323-L340
120,292
rhuss/jolokia
client/java/src/main/java/org/jolokia/client/J4pClient.java
J4pClient.verifyBulkJsonResponse
private void verifyBulkJsonResponse(JSONAware pJsonResponse) throws J4pException { if (!(pJsonResponse instanceof JSONArray)) { if (pJsonResponse instanceof JSONObject) { JSONObject errorObject = (JSONObject) pJsonResponse; if (!errorObject.containsKey("status") || (...
java
private void verifyBulkJsonResponse(JSONAware pJsonResponse) throws J4pException { if (!(pJsonResponse instanceof JSONArray)) { if (pJsonResponse instanceof JSONObject) { JSONObject errorObject = (JSONObject) pJsonResponse; if (!errorObject.containsKey("status") || (...
[ "private", "void", "verifyBulkJsonResponse", "(", "JSONAware", "pJsonResponse", ")", "throws", "J4pException", "{", "if", "(", "!", "(", "pJsonResponse", "instanceof", "JSONArray", ")", ")", "{", "if", "(", "pJsonResponse", "instanceof", "JSONObject", ")", "{", ...
Verify the returned JSON answer.
[ "Verify", "the", "returned", "JSON", "answer", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/J4pClient.java#L344-L355
120,293
rhuss/jolokia
agent/core/src/main/java/org/jolokia/backend/BackendManager.java
BackendManager.handleRequest
public JSONObject handleRequest(JmxRequest pJmxReq) throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException { lazyInitIfNeeded(); boolean debug = isDebug(); long time = 0; if (debug) { time = System.currentT...
java
public JSONObject handleRequest(JmxRequest pJmxReq) throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException { lazyInitIfNeeded(); boolean debug = isDebug(); long time = 0; if (debug) { time = System.currentT...
[ "public", "JSONObject", "handleRequest", "(", "JmxRequest", "pJmxReq", ")", "throws", "InstanceNotFoundException", ",", "AttributeNotFoundException", ",", "ReflectionException", ",", "MBeanException", ",", "IOException", "{", "lazyInitIfNeeded", "(", ")", ";", "boolean", ...
Handle a single JMXRequest. The response status is set to 200 if the request was successful @param pJmxReq request to perform @return the already converted answer. @throws InstanceNotFoundException @throws AttributeNotFoundException @throws ReflectionException @throws MBeanException
[ "Handle", "a", "single", "JMXRequest", ".", "The", "response", "status", "is", "set", "to", "200", "if", "the", "request", "was", "successful" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/BackendManager.java#L146-L178
120,294
rhuss/jolokia
agent/core/src/main/java/org/jolokia/backend/BackendManager.java
BackendManager.convertExceptionToJson
public Object convertExceptionToJson(Throwable pExp, JmxRequest pJmxReq) { JsonConvertOptions opts = getJsonConvertOptions(pJmxReq); try { JSONObject expObj = (JSONObject) converters.getToJsonConverter().convertToJson(pExp,null,opts); return expObj; ...
java
public Object convertExceptionToJson(Throwable pExp, JmxRequest pJmxReq) { JsonConvertOptions opts = getJsonConvertOptions(pJmxReq); try { JSONObject expObj = (JSONObject) converters.getToJsonConverter().convertToJson(pExp,null,opts); return expObj; ...
[ "public", "Object", "convertExceptionToJson", "(", "Throwable", "pExp", ",", "JmxRequest", "pJmxReq", ")", "{", "JsonConvertOptions", "opts", "=", "getJsonConvertOptions", "(", "pJmxReq", ")", ";", "try", "{", "JSONObject", "expObj", "=", "(", "JSONObject", ")", ...
Convert a Throwable to a JSON object so that it can be included in an error response @param pExp throwable to convert @param pJmxReq the request from where to take the serialization options @return the exception.
[ "Convert", "a", "Throwable", "to", "a", "JSON", "object", "so", "that", "it", "can", "be", "included", "in", "an", "error", "response" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/BackendManager.java#L187-L198
120,295
rhuss/jolokia
agent/core/src/main/java/org/jolokia/backend/BackendManager.java
BackendManager.isRemoteAccessAllowed
public boolean isRemoteAccessAllowed(String pRemoteHost, String pRemoteAddr) { return restrictor.isRemoteAccessAllowed(pRemoteHost != null ? new String[] { pRemoteHost, pRemoteAddr } : new String[] { ...
java
public boolean isRemoteAccessAllowed(String pRemoteHost, String pRemoteAddr) { return restrictor.isRemoteAccessAllowed(pRemoteHost != null ? new String[] { pRemoteHost, pRemoteAddr } : new String[] { ...
[ "public", "boolean", "isRemoteAccessAllowed", "(", "String", "pRemoteHost", ",", "String", "pRemoteAddr", ")", "{", "return", "restrictor", ".", "isRemoteAccessAllowed", "(", "pRemoteHost", "!=", "null", "?", "new", "String", "[", "]", "{", "pRemoteHost", ",", "...
Check whether remote access from the given client is allowed. @param pRemoteHost remote host to check against. Can be null if no reverse lookup is configured. @param pRemoteAddr alternative IP address @return true if remote access is allowed
[ "Check", "whether", "remote", "access", "from", "the", "given", "client", "is", "allowed", "." ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/BackendManager.java#L218-L222
120,296
rhuss/jolokia
agent/core/src/main/java/org/jolokia/backend/BackendManager.java
BackendManager.info
public void info(String msg) { logHandler.info(msg); if (debugStore != null) { debugStore.log(msg); } }
java
public void info(String msg) { logHandler.info(msg); if (debugStore != null) { debugStore.log(msg); } }
[ "public", "void", "info", "(", "String", "msg", ")", "{", "logHandler", ".", "info", "(", "msg", ")", ";", "if", "(", "debugStore", "!=", "null", ")", "{", "debugStore", ".", "log", "(", "msg", ")", ";", "}", "}" ]
Log at info level @param msg to log
[ "Log", "at", "info", "level" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/BackendManager.java#L241-L246
120,297
rhuss/jolokia
agent/core/src/main/java/org/jolokia/backend/BackendManager.java
BackendManager.debug
public void debug(String msg) { logHandler.debug(msg); if (debugStore != null) { debugStore.log(msg); } }
java
public void debug(String msg) { logHandler.debug(msg); if (debugStore != null) { debugStore.log(msg); } }
[ "public", "void", "debug", "(", "String", "msg", ")", "{", "logHandler", ".", "debug", "(", "msg", ")", ";", "if", "(", "debugStore", "!=", "null", ")", "{", "debugStore", ".", "log", "(", "msg", ")", ";", "}", "}" ]
Log at debug level @param msg message to log
[ "Log", "at", "debug", "level" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/BackendManager.java#L253-L258
120,298
rhuss/jolokia
agent/core/src/main/java/org/jolokia/backend/BackendManager.java
BackendManager.init
private void init(Configuration pConfig) { // Central objects converters = new Converters(); initLimits(pConfig); // Create and remember request dispatchers localDispatcher = new LocalRequestDispatcher(converters, restrictor, ...
java
private void init(Configuration pConfig) { // Central objects converters = new Converters(); initLimits(pConfig); // Create and remember request dispatchers localDispatcher = new LocalRequestDispatcher(converters, restrictor, ...
[ "private", "void", "init", "(", "Configuration", "pConfig", ")", "{", "// Central objects", "converters", "=", "new", "Converters", "(", ")", ";", "initLimits", "(", "pConfig", ")", ";", "// Create and remember request dispatchers", "localDispatcher", "=", "new", "L...
Initialize this object;
[ "Initialize", "this", "object", ";" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/BackendManager.java#L325-L343
120,299
rhuss/jolokia
agent/core/src/main/java/org/jolokia/backend/BackendManager.java
BackendManager.createRequestDispatchers
private List<RequestDispatcher> createRequestDispatchers(Configuration pConfig, Converters pConverters, ServerHandle pServerHandle, Restr...
java
private List<RequestDispatcher> createRequestDispatchers(Configuration pConfig, Converters pConverters, ServerHandle pServerHandle, Restr...
[ "private", "List", "<", "RequestDispatcher", ">", "createRequestDispatchers", "(", "Configuration", "pConfig", ",", "Converters", "pConverters", ",", "ServerHandle", "pServerHandle", ",", "Restrictor", "pRestrictor", ")", "{", "List", "<", "RequestDispatcher", ">", "r...
a list, an empty one if no request dispatcher should be created
[ "a", "list", "an", "empty", "one", "if", "no", "request", "dispatcher", "should", "be", "created" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/BackendManager.java#L364-L377