@Override public BrooklynNodeImpl getEntity() { return (BrooklynNodeImpl) super.getEntity(); }
public VanillaJavaApp getEntity() { return (VanillaJavaApp) super.getEntity(); }
public JavaWebAppSoftwareProcessImpl getEntity() { return (JavaWebAppSoftwareProcessImpl) super.getEntity(); }
/** * 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 checkJavaHostnameBug() { try { ProcessTaskWrapper<Integer> hostnameLen = DynamicTasks.queue(SshEffectorTasks.ssh("hostname -f | wc | awk '{print $3}'")).block(); if (hostnameLen.getExitCode()==0) { Integer len = Integer.parseInt(hostnameLen.getStdout().trim()); if (len > 63) { // likely to cause a java crash due to java bug 7089443 -- set a new short hostname // http://mail.openjdk.java.net/pipermail/net-dev/2012-July/004603.html String newHostname = "br-"+getEntity().getId(); log.info("Detected likelihood of Java hostname bug with hostname length "+len+" for "+getEntity()+"; renaming "+getMachine()+" to hostname "+newHostname); DynamicTasks.queue(SshEffectorTasks.ssh( "hostname "+newHostname, "echo 127.0.0.1 "+newHostname+" > /etc/hosts").runAsRoot()).block(); } } } catch (Exception e) { log.warn("Error checking/fixing Java hostname bug: "+e, e); } }
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(); }
@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(); }