Brooklyn

brooklyn.entity.java
[Java] Class JavaSoftwareProcessSshDriver

java.lang.Object
  brooklyn.entity.basic.AbstractSoftwareProcessDriver
      brooklyn.entity.basic.AbstractSoftwareProcessSshDriver
          brooklyn.entity.java.JavaSoftwareProcessSshDriver
All Implemented Interfaces:
JavaSoftwareProcessDriver

public abstract class JavaSoftwareProcessSshDriver
extends AbstractSoftwareProcessSshDriver

The SSH implementation of the JavaSoftwareProcessDriver.


Field Summary
static java.util.List KEY_VAL_OPT_PREFIXES

static java.util.List MUTUALLY_EXCLUSIVE_OPTS

static Logger log

 
Fields inherited from class AbstractSoftwareProcessSshDriver
BROOKLYN_HOME_DIR, CHECK_RUNNING, CUSTOMIZING, DEFAULT_INSTALL_BASEDIR, DEFAULT_RUN_BASEDIR, INSTALLING, KILLING, LAUNCHING, NO_VERSION_INFO, PID_FILENAME, RESTARTING, STOPPING, log, logSsh
 
Fields inherited from class AbstractSoftwareProcessDriver
entity
 
Constructor Summary
JavaSoftwareProcessSshDriver(EntityLocal entity, SshMachineLocation machine)

 
Method Summary
protected java.util.List getCustomJavaConfigOptions()

Return extra Java config options, ie arguments starting with - which are passed to the JVM prior to the class name.

protected java.util.Map getCustomJavaSystemProperties()

Return extra Java system properties (-D defines) used by the application.

java.util.List getJavaOpts()

arguments to pass to the JVM; this is the config options (e.g.

protected java.util.Map getJavaSystemProperties()

Returns the complete set of Java system properties (-D defines) to set for the application.

java.lang.String getJmxContext()

protected java.util.Map getJmxJavaSystemProperties()

Return the configuration properties required to enable JMX for a Java application.

java.lang.Integer getJmxPort()

protected java.lang.String getLogFileLocation()

java.lang.Integer getRmiPort()

java.lang.Integer getRmiServerPort()

java.util.Map getShellEnvironment()

Sets all JVM options (-X..

void installJava()

boolean isJmxEnabled()

void start()

 
Methods inherited from class AbstractSoftwareProcessSshDriver
copyFile, copyFile, execute, execute, getDefaultVersion, getEntityVersionLabel, getEntityVersionLabel, getHostname, getInstallDir, getLocation, getMachine, getPortsUsed, getRunDir, getShellEnvironment, getVersion, newScript, newScript
 
Methods inherited from class AbstractSoftwareProcessDriver
customize, getEntity, getLocation, getResource, install, kill, launch, postLaunch, restart, start, stop, waitForConfigKey
 

Field Detail

KEY_VAL_OPT_PREFIXES

public static final java.util.List KEY_VAL_OPT_PREFIXES


MUTUALLY_EXCLUSIVE_OPTS

public static final java.util.List MUTUALLY_EXCLUSIVE_OPTS


log

public static final Logger log


 
Constructor Detail

JavaSoftwareProcessSshDriver

public JavaSoftwareProcessSshDriver(EntityLocal entity, SshMachineLocation machine)


 
Method Detail

getCustomJavaConfigOptions

protected java.util.List getCustomJavaConfigOptions()
Return extra Java config options, ie arguments starting with - which are passed to the JVM prior to the class name.

Note defines are handled separately, in getCustomJavaSystemProperties().

Override as needed; default is an empty list.


getCustomJavaSystemProperties

protected java.util.Map getCustomJavaSystemProperties()
Return extra Java system properties (-D defines) used by the application. Override as needed; default is an empty map.


getJavaOpts

public java.util.List getJavaOpts()
arguments to pass to the JVM; this is the config options (e.g. -Xmx1024; only the contents of getCustomJavaConfigOptions() by default) and java system properties (-Dk=v; add custom properties in getCustomJavaSystemProperties())

See getShellEnvironment() for discussion of quoting/escaping strategy.


getJavaSystemProperties

protected java.util.Map getJavaSystemProperties()
Returns the complete set of Java system properties (-D defines) to set for the application.

This is exposed to the JVM as the contents of the JAVA_OPTS environment variable. Default set contains config key, custom system properties, and JMX defines.

Null value means to set -Dkey otherwise it is -Dkey=value.

See getShellEnvironment() for discussion of quoting/escaping strategy.


getJmxContext

@Override
public java.lang.String getJmxContext()


getJmxJavaSystemProperties

protected java.util.Map getJmxJavaSystemProperties()
Return the configuration properties required to enable JMX for a Java application. These should be set as properties in the JAVA_OPTS environment variable when calling the run script for the application. TODO security!


getJmxPort

@Override
public java.lang.Integer getJmxPort()


getLogFileLocation

protected java.lang.String getLogFileLocation()


getRmiPort

@Deprecated
    // since 0.4, use getRmiServerPort
@Override
public java.lang.Integer getRmiPort()


getRmiServerPort

public java.lang.Integer getRmiServerPort()


getShellEnvironment

@Override
public java.util.Map getShellEnvironment()
Sets all JVM options (-X.. -D..) in an environment var JAVA_OPTS.

That variable is constructed from getJavaOpts(), then wrapped _unescaped_ in double quotes. An error is thrown if there is an unescaped double quote in the string. All other unescaped characters are permitted, but unless $var expansion or `command` execution is desired (although this is not confirmed as supported) the generally caller should escape any such characters, for example using BashStringEscapes#escapeLiteralForDoubleQuotedBash(String)#escapeLiteralForDoubleQuotedBash(String).


installJava

public void installJava()


isJmxEnabled

public boolean isJmxEnabled()


start

@Override
public void start()


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.