Created
May 14, 2012 16:28
-
-
Save itaifrenkel/2694919 to your computer and use it in GitHub Desktop.
Cloudify Tomcat recipe DSL file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a new Service object and initialize it with this closure | |
service { | |
//calls setName(), setType(), etc... | |
name "tomcat" | |
type "WEB_SERVER" | |
numInstances 1 | |
// context is injected automatically | |
def portIncrement = | |
context.isLocalCloud() ? context.getInstanceId()-1 : 0 | |
// httpPort and ajpPort are injected | |
// from an external properties file | |
def currHttpPort = httpPort + portIncrement | |
def currAjpPort = ajpPort + portIncrement | |
// create a new LifeCycle object ,initialize it with the closue | |
// and inject the result to setLifecycle() | |
lifecycle { | |
// calls setInstall() of the LifeCycle object. | |
install "tomcat_install.groovy" | |
start "tomcat_start.groovy" | |
preStop "tomcat_stop.groovy" | |
startDetectionTimeoutSecs 240 | |
startDetection { | |
//ServiceUtils import statement is injected automatically | |
!ServiceUtils.arePortsFree([ currHttpPort, currAjpPort ]) | |
} | |
}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment