Brooklyn

brooklyn.entity.basic.lifecycle.legacy
[Groovy] Class SshBasedJavaAppSetup

java.lang.Object
  brooklyn.entity.basic.AbstractSoftwareProcessDriver
      brooklyn.entity.basic.AbstractSoftwareProcessSshDriver
          brooklyn.entity.basic.lifecycle.legacy.SshBasedAppSetup
              brooklyn.entity.basic.lifecycle.legacy.SshBasedJavaAppSetup

@Deprecated
abstract class SshBasedJavaAppSetup
extends SshBasedAppSetup

Java application installation, configuration and startup using ssh. This class should be extended for use by entities that are implemented by a Java application. TODO complete documentation

deprecated:
will be deleted in 0.5. Use JavaStartStopSshDriver, with SoftwareProcessEntity


Field Summary
protected java.util.Map environmentPropertyFiles

protected int jmxPort

protected java.util.Map namedPropertyFiles

protected int rmiPort

 
Fields inherited from class SshBasedAppSetup
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
 
Property Summary
static Logger log

 
Constructor Summary
SshBasedJavaAppSetup(EntityLocal entity, SshMachineLocation machine)

 
Method Summary
void config()

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.

protected java.util.Map getJmxJavaSystemProperties()

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

java.util.Map getShellEnvironment()

Sets all JVM options (-X..

boolean isJmxEnabled()

protected void setEntityAttributes()

void setEnvironmentPropertyFiles(java.util.Map propertyFiles)

void setJmxPort(int val)

void setNamedPropertyFiles(java.util.Map propertyFiles)

void setRmiPort(int val)

 
Methods inherited from class SshBasedAppSetup
config, copy, customize, deploy, exec, getCheckRunningScript, getConfigScript, getDefaultVersion, getDeployScript, getInstallDir, getInstallScript, getRestartScript, getRunScript, getShutdownScript, install, isRunning, kill, launch, makeCheckPortOpenScript, makeCheckRunningScript, makeInstallScript, makeRestartScript, makeShutdownScript, newScript, obtainPort, obtainPort, postShutdown, restart, runApp, setEntityAttributes, setInstallDir, setRunDir, setVersion, shutdown, stop, toDesiredPortRange
 
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

environmentPropertyFiles

protected java.util.Map environmentPropertyFiles


jmxPort

protected int jmxPort


namedPropertyFiles

protected java.util.Map namedPropertyFiles


rmiPort

protected int rmiPort


 
Property Detail

log

static final Logger log


 
Constructor Detail

SshBasedJavaAppSetup

SshBasedJavaAppSetup(EntityLocal entity, SshMachineLocation machine)


 
Method Detail

config

@Override
void config()


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

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.


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!


getShellEnvironment

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

All env vars are wrapped in double quotes when defined in the shell, so values in the resulting map can contain spaces, and must be valid bash expressions.

However variables such as JAVA_OPTS used by many scripts get passed as a string, not an array, so spaces in a single argument in the variable, say, a java system define, cannot be passed via this mechanism. We have tried a number of ways around this and conclusion is that the delegated scripts would have to be changed to allow this (treating JAVA_OPTS as an array, eg). If spaces are needed, raise a jira.


isJmxEnabled

boolean isJmxEnabled()


setEntityAttributes

@Override
protected void setEntityAttributes()


setEnvironmentPropertyFiles

void setEnvironmentPropertyFiles(java.util.Map propertyFiles)


setJmxPort

void setJmxPort(int val)


setNamedPropertyFiles

void setNamedPropertyFiles(java.util.Map propertyFiles)


setRmiPort

void setRmiPort(int val)


 

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