Brooklyn

com.acme.sample.brooklyn.sample.app
[Java] Class ClusterWebServerDatabaseSample

java.lang.Object
  brooklyn.entity.basic.AbstractEntity
      brooklyn.entity.basic.AbstractApplication
          com.acme.sample.brooklyn.sample.app.ClusterWebServerDatabaseSample

@Catalog(name="Elastic Java Web + DB",
    description="Deploys a WAR to a load-balanced elastic Java AppServer cluster, " +
        "with an auto-scaling policy, " +
        "wired to a database initialized with the provided SQL; " +
        "defaults to a 'Hello World' chatroom app.",
    iconUrl="classpath://com/acme/sample/brooklyn/sample-icon.png")
public class ClusterWebServerDatabaseSample
extends AbstractApplication

This sample builds a 3-tier application with an elastic app-server cluster, and it sets it up for use in the Brooklyn catalog.

Note that root access (and xcode etc) may be required to install nginx.


Field Summary
static java.lang.String DB_PASSWORD

static ConfigKey DB_SETUP_SQL_URL

static java.lang.String DB_TABLE

static java.lang.String DB_USERNAME

static java.lang.String DEFAULT_DB_SETUP_SQL_URL

static java.lang.String DEFAULT_WAR_URL

static Logger LOG

static ConfigKey WAR_URL

 
Fields inherited from class AbstractApplication
log
 
Fields inherited from class AbstractEntity
EFFECTOR_ADDED, EFFECTOR_CHANGED, EFFECTOR_REMOVED, LOG, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVED, _subscriptionTracker, managementSupport, tempWorkings
 
Method Summary
void init()

Initialize our application.

 
Methods inherited from class AbstractApplication
getApplication, init, onManagementStopped, postStart, preStart, restart, setApplication, setParent, start, stop
 
Methods inherited from class AbstractEntity
addChild, addChild, addEnricher, addGroup, addLocations, addPolicy, clearLocations, clearParent, configure, configure, configure, configure, configure, configure, destroy, emit, emitInternal, equals, finalize, firstLocation, getAllAttributes, getAllConfig, getApplication, getApplicationId, getAttribute, getAttributeByNameParts, getChildren, getConfig, getConfig, getConfig, getConfig, getConfigMap, getCreationTime, getDisplayName, getEffector, getEnrichers, getEntityManager, getEntityType, getEntityTypeName, getExecutionContext, getGroups, getIconUrl, getId, getLocations, getManagementContext, getManagementSupport, getMutableEntityType, getParent, getPolicies, getProxy, getProxyIfAvailable, getRebindSupport, getSubscriptionContext, getSubscriptionTracker, hashCode, init, invalidateReferences, invoke, invoke, invoke, isLegacyConstruction, onManagementBecomingMaster, onManagementNoLongerMaster, onManagementStarted, onManagementStarting, onManagementStopped, refreshInheritedConfig, removeAllEnrichers, removeAllPolicies, removeAttribute, removeChild, removeEnricher, removeLocations, removePolicy, setApplication, setAttribute, setAttribute, setAttributeWithoutPublishing, setConfig, setConfig, setConfig, setConfig, setConfig, setConfig, setConfigEvenIfOwned, setConfigEvenIfOwned, setConfigIfValNonNull, setConfigIfValNonNull, setDisplayName, setManagementContext, setParent, setProxy, subscribe, subscribeToChildren, subscribeToMembers, toMetadataRecord, toString, toStringHelper, unsubscribe, unsubscribe
 

Field Detail

DB_PASSWORD

public static final java.lang.String DB_PASSWORD


DB_SETUP_SQL_URL

public static final ConfigKey DB_SETUP_SQL_URL


DB_TABLE

public static final java.lang.String DB_TABLE


DB_USERNAME

public static final java.lang.String DB_USERNAME


DEFAULT_DB_SETUP_SQL_URL

public static final java.lang.String DEFAULT_DB_SETUP_SQL_URL


DEFAULT_WAR_URL

public static final java.lang.String DEFAULT_WAR_URL


LOG

public static final Logger LOG


WAR_URL

"app.war", "URL to the application archive which should be deployed", DEFAULT_WAR_URL);
public static final ConfigKey WAR_URL


 
Method Detail

init

ControlledDynamicWebAppCluster web = addChild(
public void init()
Initialize our application. In this case it consists of a single DB, with a load-balanced cluster (nginx + multiple JBosses, by default), with some sensors and a policy.


 

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