/** @deprecated since 0.6.0, the config key is always used instead of this */ @Deprecated public Integer getJmxPort() { return !isJmxEnabled() ? Integer.valueOf(-1) : entity.getAttribute(UsesJmx.JMX_PORT); }
/** @deprecated since 0.6.0, the config key is always used instead of this */ @Deprecated public Integer getRmiRegistryPort() { return !isJmxEnabled() ? -1 : entity.getAttribute(UsesJmx.RMI_REGISTRY_PORT); }
/** @deprecated since 0.6.0, the config key is always used instead of this */ @Deprecated public String getJmxContext() { return !isJmxEnabled() ? null : entity.getAttribute(UsesJmx.JMX_CONTEXT); }
/** @deprecated since 0.4.0, see {@link #getRmiRegistryPort()} */ @Deprecated public Integer getRmiServerPort() { return !isJmxEnabled() ? -1 : entity.getAttribute(UsesJmx.RMI_SERVER_PORT); }
/** * Return any JVM arguments required, other than the -D defines returned by {@link #getJmxJavaSystemProperties()} */ protected List<String> getJmxJavaConfigOptions() { List<String> result = new ArrayList<String>(); if (isJmxEnabled()) { result.addAll(new JmxSupport(getEntity(), getRunDir()).getJmxJavaConfigOptions()); } return result; }
public void installJmxSupport() { if (isJmxEnabled()) { newScript("JMX_SETUP_PREINSTALL").body.append("mkdir -p "+getRunDir()).execute(); new JmxSupport(getEntity(), getRunDir()).install(); } }
/** * Return the configuration properties required to enable JMX for a Java application. * * These should be set as properties in the {@code JAVA_OPTS} environment variable when calling the * run script for the application. */ protected Map<String, ?> getJmxJavaSystemProperties() { MutableMap.Builder<String, Object> result = MutableMap.<String, Object> builder(); if (isJmxEnabled()) { new JmxSupport(getEntity(), getRunDir()).applyJmxJavaSystemProperties(result); } return result.build(); }
/** * Returns the complete set of Java system properties (-D defines) to set for the application. * <p> * This is exposed to the JVM as the contents of the {@code JAVA_OPTS} environment variable. Default * set contains config key, custom system properties, and JMX defines. * <p> * Null value means to set -Dkey otherwise it is -Dkey=value. * <p> * See {@link #getShellEnvironment()} for discussion of quoting/escaping strategy. */ protected Map<String,?> getJavaSystemProperties() { return MutableMap.<String,Object>builder() .putAll(getCustomJavaSystemProperties()) .putAll(isJmxEnabled() ? getJmxJavaSystemProperties() : Collections.<String,Object>emptyMap()) .putAll(entity.getConfig(UsesJava.JAVA_SYSPROPS)) .build(); }
@Override public void start() { DynamicTasks.queue("install java", new Runnable() { public void run() { installJava(); }}); if (isJmxEnabled()) { DynamicTasks.queue("install jmx", new Runnable() { public void run() { installJmxSupport(); }}); } if (getEntity().getConfig(UsesJava.CHECK_JAVA_HOSTNAME_BUG)) { DynamicTasks.queue("check java hostname bug", new Runnable() { public void run() { checkJavaHostnameBug(); }}); } super.start(); }