Tabnine Logo
Configuration
Code IndexAdd Tabnine to your IDE (free)

How to use
Configuration
in
org.jolokia.config

Best Java code snippets using org.jolokia.config.Configuration (Showing top 20 results out of 315)

origin: rhuss/jolokia

private boolean listenForDiscoveryMcRequests(Configuration pConfig) {
  String enable = pConfig.get(ConfigKey.DISCOVERY_ENABLED);
  String url = pConfig.get(ConfigKey.DISCOVERY_AGENT_URL);
  return url != null || enable == null || Boolean.valueOf(enable);
}
origin: rhuss/jolokia

Configuration initConfig(ServletConfig pConfig) {
  Configuration config = new Configuration(
      ConfigKey.AGENT_ID, NetworkUtil.getAgentId(hashCode(),"servlet"));
  // From ServletContext ....
  config.updateGlobalConfiguration(new ServletConfigFacade(pConfig));
  // ... and ServletConfig
  config.updateGlobalConfiguration(new ServletContextFacade(getServletContext()));
  // Set type last and overwrite anything written
  config.updateGlobalConfiguration(Collections.singletonMap(ConfigKey.AGENT_TYPE.getKeyValue(),"servlet"));
  return config;
}
origin: rhuss/jolokia

private void initAuthenticatorFromAuthMode() {
  String user = jolokiaConfig.get(ConfigKey.USER);
  String password = jolokiaConfig.get(ConfigKey.PASSWORD);
  String authMode = jolokiaConfig.get(ConfigKey.AUTH_MODE);
  String realm = jolokiaConfig.get(ConfigKey.REALM);
  } else if ("delegate".equalsIgnoreCase(authMode)) {
    authenticators.add(new DelegatingAuthenticator(realm,
                          jolokiaConfig.get(ConfigKey.AUTH_URL),
                          jolokiaConfig.get(ConfigKey.AUTH_PRINCIPAL_SPEC),
                          jolokiaConfig.getAsBoolean(ConfigKey.AUTH_IGNORE_CERTS)));
  } else {
    throw new IllegalArgumentException("No auth method '" + authMode + "' known. " +
    authenticator = new MultiAuthenticator(MultiAuthenticator.Mode.fromString(jolokiaConfig.get(ConfigKey.AUTH_MATCH)), authenticators);
origin: rhuss/jolokia

String dispatchers = pConfig.get(ConfigKey.DISPATCHER_CLASSES);
String jsr160DispatcherClass = "org.jolokia.jsr160.Jsr160RequestDispatcher";
    if (param != null && (param.isEmpty() || Boolean.parseBoolean(param))) {
        pConfig.updateGlobalConfiguration(
          Collections.singletonMap(
            ConfigKey.DISPATCHER_CLASSES.getKeyValue(),
    pConfig.updateGlobalConfiguration(Collections.singletonMap(
      ConfigKey.DISPATCHER_CLASSES.getKeyValue(),
      Jsr160ProxyNotEnabledByDefaultAnymoreDispatcher.class.getCanonicalName()));
origin: rhuss/jolokia

private void initMBeans(Configuration pConfig) {
  int maxEntries = pConfig.getAsInt(HISTORY_MAX_ENTRIES);
  int maxDebugEntries = pConfig.getAsInt(DEBUG_MAX_ENTRIES);
  historyStore = new HistoryStore(maxEntries);
  debugStore = new DebugStore(maxDebugEntries, pConfig.getAsBoolean(DEBUG));
  try {
    localDispatcher.initMBeans(historyStore, debugStore);
  } catch (NotCompliantMBeanException e) {
    intError("Error registering config MBean: " + e, e);
  } catch (MBeanRegistrationException e) {
    intError("Cannot register MBean: " + e, e);
  } catch (MalformedObjectNameException e) {
    intError("Invalid name for config MBean: " + e, e);
  }
}
origin: rhuss/jolokia

private String getHostName(InetSocketAddress address) {
  return configuration.getAsBoolean(ConfigKey.ALLOW_DNS_REVERSE_LOOKUP) ? address.getHostName() : null;
}
origin: rhuss/jolokia

private ProcessingParameters getProcessingParameter(Map<String, String[]> pParameterMap) {
  Map<String,String> ret = new HashMap<String, String>();
  if (pParameterMap != null) {
    for (Map.Entry<String,String[]> entry : pParameterMap.entrySet()) {
      String values[] = entry.getValue();
      if (values != null && values.length > 0) {
          ret.put(entry.getKey(), values[0]);
      }
    }
  }
  return config.getProcessingParameters(ret);
}
origin: org.jolokia/jolokia-osgi

String dispatchers = pConfig.get(ConfigKey.DISPATCHER_CLASSES);
String jsr160DispatcherClass = "org.jolokia.jsr160.Jsr160RequestDispatcher";
    if (param != null && (param.isEmpty() || Boolean.parseBoolean(param))) {
        pConfig.updateGlobalConfiguration(
          Collections.singletonMap(
            ConfigKey.DISPATCHER_CLASSES.getKeyValue(),
    pConfig.updateGlobalConfiguration(Collections.singletonMap(
      ConfigKey.DISPATCHER_CLASSES.getKeyValue(),
      Jsr160ProxyNotEnabledByDefaultAnymoreDispatcher.class.getCanonicalName()));
origin: org.jolokia/jolokia-core

private void initMBeans(Configuration pConfig) {
  int maxEntries = pConfig.getAsInt(HISTORY_MAX_ENTRIES);
  int maxDebugEntries = pConfig.getAsInt(DEBUG_MAX_ENTRIES);
  historyStore = new HistoryStore(maxEntries);
  debugStore = new DebugStore(maxDebugEntries, pConfig.getAsBoolean(DEBUG));
  try {
    localDispatcher.initMBeans(historyStore, debugStore);
  } catch (NotCompliantMBeanException e) {
    intError("Error registering config MBean: " + e, e);
  } catch (MBeanRegistrationException e) {
    intError("Cannot register MBean: " + e, e);
  } catch (MalformedObjectNameException e) {
    intError("Invalid name for config MBean: " + e, e);
  }
}
origin: rhuss/jolokia

private boolean listenForDiscoveryMcRequests(Configuration pConfig) {
  // Check for system props, system env and agent config
  boolean sysProp = System.getProperty("jolokia." + ConfigKey.DISCOVERY_ENABLED.getKeyValue()) != null;
  boolean env     = System.getenv("JOLOKIA_DISCOVERY") != null;
  boolean config  = pConfig.getAsBoolean(ConfigKey.DISCOVERY_ENABLED);
  return sysProp || env || config;
}
/**
origin: org.jolokia/jolokia-core

private ProcessingParameters getProcessingParameter(Map<String, String[]> pParameterMap) {
  Map<String,String> ret = new HashMap<String, String>();
  if (pParameterMap != null) {
    for (Map.Entry<String,String[]> entry : pParameterMap.entrySet()) {
      String values[] = entry.getValue();
      if (values != null && values.length > 0) {
          ret.put(entry.getKey(), values[0]);
      }
    }
  }
  return config.getProcessingParameters(ret);
}
origin: rhuss/jolokia

/**
 * Get an configuration value as boolean value. The value must
 * be configured as 'true' for this method to return true
 *
 * @param pKey the configuration key for which a boolean config value is requested
 * @return true if the configuration (or the default value, if the configuration is not set)
 *         is "true" for this key, false otherwise.
 */
public boolean getAsBoolean(ConfigKey pKey) {
  return Boolean.valueOf(get(pKey));
}
origin: rhuss/jolokia

String logHandlerClass =  config.get(ConfigKey.LOGHANDLER_CLASS);
logHandler = logHandlerClass != null ?
    (LogHandler) ClassUtil.newInstance(logHandlerClass) :
    createLogHandler(pServletConfig,Boolean.valueOf(config.get(ConfigKey.DEBUG)));
  logHandler.info("Using custom access restriction provided by " + restrictor);
configMimeType = config.get(ConfigKey.MIME_TYPE);
allowDnsReverseLookup = config.getAsBoolean(ConfigKey.ALLOW_DNS_REVERSE_LOOKUP);
streamingEnabled = config.getAsBoolean(ConfigKey.STREAMING);
origin: org.jolokia/jolokia-core

String dispatchers = pConfig.get(ConfigKey.DISPATCHER_CLASSES);
String jsr160DispatcherClass = "org.jolokia.jsr160.Jsr160RequestDispatcher";
    if (param != null && (param.isEmpty() || Boolean.parseBoolean(param))) {
        pConfig.updateGlobalConfiguration(
          Collections.singletonMap(
            ConfigKey.DISPATCHER_CLASSES.getKeyValue(),
    pConfig.updateGlobalConfiguration(Collections.singletonMap(
      ConfigKey.DISPATCHER_CLASSES.getKeyValue(),
      Jsr160ProxyNotEnabledByDefaultAnymoreDispatcher.class.getCanonicalName()));
origin: rhuss/jolokia

/**
 * Initialize the configuration with the given map
 *
 * @param pConfig map holding the configuration in string representation. A reference to the map will be kept
 */
protected void init(Map<String, String> pConfig) {
  Map<String, String> finalCfg = getDefaultConfig(pConfig);
  finalCfg.putAll(pConfig);
  prepareDetectorOptions(finalCfg);
  addJolokiaId(finalCfg);
  jolokiaConfig = new Configuration();
  jolokiaConfig.updateGlobalConfiguration(finalCfg);
  initConfigAndValidate(finalCfg);
}
origin: org.jolokia/jolokia-osgi

private void initMBeans(Configuration pConfig) {
  int maxEntries = pConfig.getAsInt(HISTORY_MAX_ENTRIES);
  int maxDebugEntries = pConfig.getAsInt(DEBUG_MAX_ENTRIES);
  historyStore = new HistoryStore(maxEntries);
  debugStore = new DebugStore(maxDebugEntries, pConfig.getAsBoolean(DEBUG));
  try {
    localDispatcher.initMBeans(historyStore, debugStore);
  } catch (NotCompliantMBeanException e) {
    intError("Error registering config MBean: " + e, e);
  } catch (MBeanRegistrationException e) {
    intError("Cannot register MBean: " + e, e);
  } catch (MalformedObjectNameException e) {
    intError("Invalid name for config MBean: " + e, e);
  }
}
origin: rhuss/jolokia

private void addErrorInfo(JSONObject pErrorResp, Throwable pExp, JmxRequest pJmxReq) {
  if (config.getAsBoolean(ConfigKey.ALLOW_ERROR_DETAILS)) {
    String includeStackTrace = pJmxReq != null ?
        pJmxReq.getParameter(ConfigKey.INCLUDE_STACKTRACE) : "true";
    if (includeStackTrace.equalsIgnoreCase("true") ||
      (includeStackTrace.equalsIgnoreCase("runtime") && pExp instanceof RuntimeException)) {
      StringWriter writer = new StringWriter();
      pExp.printStackTrace(new PrintWriter(writer));
      pErrorResp.put("stacktrace", writer.toString());
    }
    if (pJmxReq != null && pJmxReq.getParameterAsBool(ConfigKey.SERIALIZE_EXCEPTION)) {
      pErrorResp.put("error_value", backendManager.convertExceptionToJson(pExp, pJmxReq));
    }
  }
}
origin: org.jolokia/jolokia-osgi

private ProcessingParameters getProcessingParameter(Map<String, String[]> pParameterMap) {
  Map<String,String> ret = new HashMap<String, String>();
  if (pParameterMap != null) {
    for (Map.Entry<String,String[]> entry : pParameterMap.entrySet()) {
      String values[] = entry.getValue();
      if (values != null && values.length > 0) {
          ret.put(entry.getKey(), values[0]);
      }
    }
  }
  return config.getProcessingParameters(ret);
}
origin: rhuss/jolokia

/**
 * Create a new HttpHandler for processing HTTP request
 *
 * @param pConfig     jolokia specific config tuning the processing behaviour
 * @param pLogHandler log-handler the log handler to use for jolokia
 */
public JolokiaHttpHandler(Configuration pConfig, LogHandler pLogHandler) {
  configuration = pConfig;
  context = pConfig.get(ConfigKey.AGENT_CONTEXT);
  if (!context.endsWith("/")) {
    context += "/";
  }
  logHandler = pLogHandler != null ? pLogHandler : createLogHandler(pConfig.get(ConfigKey.LOGHANDLER_CLASS), pConfig.get(ConfigKey.DEBUG));
}
origin: org.jolokia/jolokia-core

String logHandlerClass =  config.get(ConfigKey.LOGHANDLER_CLASS);
logHandler = logHandlerClass != null ?
    (LogHandler) ClassUtil.newInstance(logHandlerClass) :
    createLogHandler(pServletConfig,Boolean.valueOf(config.get(ConfigKey.DEBUG)));
  logHandler.info("Using custom access restriction provided by " + restrictor);
configMimeType = config.get(ConfigKey.MIME_TYPE);
allowDnsReverseLookup = config.getAsBoolean(ConfigKey.ALLOW_DNS_REVERSE_LOOKUP);
streamingEnabled = config.getAsBoolean(ConfigKey.STREAMING);
org.jolokia.configConfiguration

Javadoc

Class encapsulating all Agent configuration, global config and processing parameters

Most used methods

  • get
    Get a configuration value if set as configuration or the default value if not
  • <init>
    Convenience constructor for setting up base configuration with key values pairs. This constructor is
  • getAsBoolean
    Get an configuration value as boolean value. The value must be configured as 'true' for this method
  • getProcessingParameters
    Get processing parameters from a string-string map
  • updateGlobalConfiguration
    Update the configuration hold by this object
  • getAsInt
    Get an configuration value as int value

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Permission (java.security)
    Legacy security code; do not use.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • ImageIO (javax.imageio)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now