You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2015/08/12 17:55:35 UTC
[17/35] incubator-brooklyn git commit: [BROOKLYN-162] package rename
to org.apache.brooklyn: software/webapp
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/nodejs/NodeJsWebAppSshDriver.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/nodejs/NodeJsWebAppSshDriver.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/nodejs/NodeJsWebAppSshDriver.java
new file mode 100644
index 0000000..cd72263
--- /dev/null
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/nodejs/NodeJsWebAppSshDriver.java
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.entity.webapp.nodejs;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.brooklyn.entity.webapp.WebAppService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import brooklyn.entity.basic.AbstractSoftwareProcessSshDriver;
+import brooklyn.entity.basic.Attributes;
+import brooklyn.entity.basic.SoftwareProcess;
+import brooklyn.location.basic.SshMachineLocation;
+import brooklyn.util.collections.MutableList;
+import brooklyn.util.collections.MutableMap;
+import brooklyn.util.file.ArchiveUtils;
+import brooklyn.util.net.Networking;
+import brooklyn.util.os.Os;
+import brooklyn.util.ssh.BashCommands;
+import brooklyn.util.text.Strings;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+
+public class NodeJsWebAppSshDriver extends AbstractSoftwareProcessSshDriver implements NodeJsWebAppDriver {
+
+ private static final Logger LOG = LoggerFactory.getLogger(NodeJsWebAppService.class);
+
+ public NodeJsWebAppSshDriver(NodeJsWebAppServiceImpl entity, SshMachineLocation machine) {
+ super(entity, machine);
+ }
+
+ public NodeJsWebAppServiceImpl getEntity() {
+ return (NodeJsWebAppServiceImpl) super.getEntity();
+ }
+
+ @Override
+ public Integer getHttpPort() {
+ return getEntity().getAttribute(Attributes.HTTP_PORT);
+ }
+
+ @Override
+ public String getAppDir() {
+ return Os.mergePaths(getRunDir(), getEntity().getConfig(NodeJsWebAppService.APP_NAME));
+ }
+
+ @Override
+ public void postLaunch() {
+ String rootUrl = String.format("http://%s:%d/", getHostname(), getHttpPort());
+ entity.setAttribute(Attributes.MAIN_URI, URI.create(rootUrl));
+ entity.setAttribute(WebAppService.ROOT_URL, rootUrl);
+ }
+
+ protected Map<String, Integer> getPortMap() {
+ return MutableMap.of("http", getHttpPort());
+ }
+
+ @Override
+ public Set<Integer> getPortsUsed() {
+ return ImmutableSet.<Integer>builder()
+ .addAll(super.getPortsUsed())
+ .addAll(getPortMap().values())
+ .build();
+ }
+
+ // TODO Suggest that other entities follow this pattern as well: check for port availability early
+ // to report failures early, and in case getShellEnvironment() tries to convert any null port numbers
+ // to int.
+ @Override
+ public void preInstall() {
+ super.preInstall();
+ Networking.checkPortsValid(getPortMap());
+ }
+
+ @Override
+ public void install() {
+ LOG.info("Installing Node.JS {}", getEntity().getConfig(SoftwareProcess.SUGGESTED_VERSION));
+
+ List<String> commands = MutableList.<String>builder()
+ .add(BashCommands.INSTALL_CURL)
+ .add(BashCommands.ifExecutableElse0("apt-get", BashCommands.chain(
+ BashCommands.installPackage("software-properties-common python-software-properties python g++ make"),
+ BashCommands.sudo("add-apt-repository ppa:chris-lea/node.js"))))
+ .add(BashCommands.installPackage(MutableMap.of("yum", "git nodejs npm", "apt", "git-core nodejs"), null))
+ .add("mkdir \"$HOME/.npm\"")
+ .add(BashCommands.sudo("npm install -g n"))
+ .add(BashCommands.sudo("n " + getEntity().getConfig(SoftwareProcess.SUGGESTED_VERSION)))
+ .build();
+
+ newScript(INSTALLING)
+ .body.append(commands)
+ .execute();
+ }
+
+ @Override
+ public void customize() {
+ List<String> commands = Lists.newLinkedList();
+
+ String gitRepoUrl = getEntity().getConfig(NodeJsWebAppService.APP_GIT_REPOSITORY_URL);
+ String archiveUrl = getEntity().getConfig(NodeJsWebAppService.APP_ARCHIVE_URL);
+ String appName = getEntity().getConfig(NodeJsWebAppService.APP_NAME);
+ if (Strings.isNonBlank(gitRepoUrl) && Strings.isNonBlank(archiveUrl)) {
+ throw new IllegalStateException("Only one of Git or archive URL must be set for " + getEntity());
+ } else if (Strings.isNonBlank(gitRepoUrl)) {
+ commands.add(String.format("git clone %s %s", gitRepoUrl, appName));
+ commands.add(String.format("cd %s", appName));
+ } else if (Strings.isNonBlank(archiveUrl)) {
+ ArchiveUtils.deploy(archiveUrl, getMachine(), getRunDir());
+ } else {
+ throw new IllegalStateException("At least one of Git or archive URL must be set for " + getEntity());
+ }
+
+ commands.add(BashCommands.ifFileExistsElse1("package.json", "npm install"));
+ List<String> packages = getEntity().getConfig(NodeJsWebAppService.NODE_PACKAGE_LIST);
+ if (packages != null && packages.size() > 0) {
+ commands.add(BashCommands.sudo("npm install -g " + Joiner.on(' ').join(packages)));
+ }
+
+ newScript(CUSTOMIZING)
+ .body.append(commands)
+ .execute();
+ }
+
+ @Override
+ public void launch() {
+ List<String> commands = Lists.newLinkedList();
+
+ String appName = getEntity().getConfig(NodeJsWebAppService.APP_NAME);
+ String appFile = getEntity().getConfig(NodeJsWebAppService.APP_FILE);
+ String appCommand = getEntity().getConfig(NodeJsWebAppService.APP_COMMAND);
+ String appCommandLine = getEntity().getConfig(NodeJsWebAppService.APP_COMMAND_LINE);
+
+ if (Strings.isBlank(appCommandLine)) {
+ appCommandLine = appCommand + " " + appFile;
+ }
+
+ // Ensure global NPM modules are on Node's path.
+ commands.add("export NODE_PATH=\"$NODE_PATH:$(npm root -g)\"");
+ commands.add(String.format("cd %s", Os.mergePathsUnix(getRunDir(), appName)));
+ commands.add("nohup " + appCommandLine + " > console.out 2>&1 &");
+
+ newScript(MutableMap.of(USE_PID_FILE, true), LAUNCHING)
+ .body.append(commands)
+ .execute();
+ }
+
+ @Override
+ public boolean isRunning() {
+ return newScript(MutableMap.of(USE_PID_FILE, true), CHECK_RUNNING).execute() == 0;
+ }
+
+ @Override
+ public void stop() {
+ newScript(MutableMap.of(USE_PID_FILE, true), STOPPING).execute();
+ }
+
+ @Override
+ public Map<String, String> getShellEnvironment() {
+ return MutableMap.<String, String>builder().putAll(super.getShellEnvironment())
+ .put("PORT", Integer.toString(getHttpPort()))
+ .build();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat7Driver.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat7Driver.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat7Driver.java
new file mode 100644
index 0000000..9c86b43
--- /dev/null
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat7Driver.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.entity.webapp.tomcat;
+
+@Deprecated
+public interface Tomcat7Driver extends TomcatDriver {
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat7SshDriver.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat7SshDriver.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat7SshDriver.java
new file mode 100644
index 0000000..584054b
--- /dev/null
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat7SshDriver.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.entity.webapp.tomcat;
+
+import brooklyn.location.basic.SshMachineLocation;
+
+@Deprecated
+public class Tomcat7SshDriver extends TomcatSshDriver implements Tomcat7Driver {
+
+ public Tomcat7SshDriver(TomcatServerImpl entity, SshMachineLocation machine) {
+ super(entity, machine);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8Server.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8Server.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8Server.java
new file mode 100644
index 0000000..b17bb2c
--- /dev/null
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8Server.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.entity.webapp.tomcat;
+
+import org.apache.brooklyn.catalog.Catalog;
+import brooklyn.config.ConfigKey;
+import brooklyn.entity.basic.ConfigKeys;
+import brooklyn.entity.basic.SoftwareProcess;
+import brooklyn.entity.proxying.ImplementedBy;
+import brooklyn.event.basic.BasicAttributeSensorAndConfigKey;
+import brooklyn.util.flags.SetFromFlag;
+import brooklyn.util.javalang.JavaClassNames;
+
+/**
+ * An {@link brooklyn.entity.Entity} that represents a single Tomcat instance.
+ */
+@Catalog(name="Tomcat Server",
+ description="Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies",
+ iconUrl="classpath:///tomcat-logo.png")
+@ImplementedBy(Tomcat8ServerImpl.class)
+public interface Tomcat8Server extends TomcatServer {
+
+ @SetFromFlag("version")
+ ConfigKey<String> SUGGESTED_VERSION = ConfigKeys.newConfigKeyWithDefault(SoftwareProcess.SUGGESTED_VERSION, "8.0.22");
+
+ @SetFromFlag("downloadUrl")
+ BasicAttributeSensorAndConfigKey<String> DOWNLOAD_URL = new BasicAttributeSensorAndConfigKey<String>(
+ SoftwareProcess.DOWNLOAD_URL, "http://download.nextag.com/apache/tomcat/tomcat-8/v${version}/bin/apache-tomcat-${version}.tar.gz");
+
+ @SetFromFlag("server.xml")
+ ConfigKey<String> SERVER_XML_RESOURCE = ConfigKeys.newStringConfigKey(
+ "tomcat.serverxml", "The file to template and use as the Tomcat process' server.xml",
+ JavaClassNames.resolveClasspathUrl(Tomcat8Server.class, "tomcat8-server.xml"));
+
+ @SetFromFlag("web.xml")
+ ConfigKey<String> WEB_XML_RESOURCE = ConfigKeys.newStringConfigKey(
+ "tomcat.webxml", "The file to template and use as the Tomcat process' web.xml",
+ JavaClassNames.resolveClasspathUrl(Tomcat8Server.class, "tomcat8-web.xml"));
+}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8ServerImpl.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8ServerImpl.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8ServerImpl.java
new file mode 100644
index 0000000..fb307c0
--- /dev/null
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8ServerImpl.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.entity.webapp.tomcat;
+
+/**
+ * An {@link brooklyn.entity.Entity} that represents a single Tomcat instance.
+ */
+public class Tomcat8ServerImpl extends TomcatServerImpl implements Tomcat8Server {
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatDriver.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatDriver.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatDriver.java
new file mode 100644
index 0000000..1671512
--- /dev/null
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatDriver.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.entity.webapp.tomcat;
+
+import org.apache.brooklyn.entity.webapp.JavaWebAppDriver;
+
+public interface TomcatDriver extends JavaWebAppDriver {
+}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServer.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServer.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServer.java
new file mode 100644
index 0000000..a3b9ce3
--- /dev/null
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServer.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.entity.webapp.tomcat;
+
+import org.apache.brooklyn.catalog.Catalog;
+import org.apache.brooklyn.entity.webapp.JavaWebAppSoftwareProcess;
+
+import brooklyn.config.ConfigKey;
+import brooklyn.entity.basic.ConfigKeys;
+import brooklyn.entity.basic.SoftwareProcess;
+import brooklyn.entity.java.UsesJmx;
+import brooklyn.entity.proxying.ImplementedBy;
+import brooklyn.entity.trait.HasShortName;
+import brooklyn.event.AttributeSensor;
+import brooklyn.event.basic.BasicAttributeSensor;
+import brooklyn.event.basic.BasicAttributeSensorAndConfigKey;
+import brooklyn.event.basic.PortAttributeSensorAndConfigKey;
+import brooklyn.location.basic.PortRanges;
+import brooklyn.util.flags.SetFromFlag;
+import brooklyn.util.javalang.JavaClassNames;
+import brooklyn.util.time.Duration;
+
+/**
+ * An {@link brooklyn.entity.Entity} that represents a single Tomcat instance.
+ */
+@Catalog(name="Tomcat Server",
+ description="Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies",
+ iconUrl="classpath:///tomcat-logo.png")
+@ImplementedBy(TomcatServerImpl.class)
+public interface TomcatServer extends JavaWebAppSoftwareProcess, UsesJmx, HasShortName {
+
+ @SetFromFlag("version")
+ ConfigKey<String> SUGGESTED_VERSION = ConfigKeys.newConfigKeyWithDefault(SoftwareProcess.SUGGESTED_VERSION, "7.0.56");
+
+ @SetFromFlag("downloadUrl")
+ BasicAttributeSensorAndConfigKey<String> DOWNLOAD_URL = new BasicAttributeSensorAndConfigKey<String>(
+ SoftwareProcess.DOWNLOAD_URL, "http://download.nextag.com/apache/tomcat/tomcat-7/v${version}/bin/apache-tomcat-${version}.tar.gz");
+
+ /**
+ * Tomcat insists on having a port you can connect to for the sole purpose of shutting it down.
+ * Don't see an easy way to disable it; causes collisions in its out-of-the-box location of 8005,
+ * so override default here to a high-numbered port.
+ */
+ @SetFromFlag("shutdownPort")
+ PortAttributeSensorAndConfigKey SHUTDOWN_PORT =
+ ConfigKeys.newPortSensorAndConfigKey("tomcat.shutdownport", "Suggested shutdown port", PortRanges.fromString("31880+"));
+
+ @SetFromFlag("server.xml")
+ ConfigKey<String> SERVER_XML_RESOURCE = ConfigKeys.newStringConfigKey(
+ "tomcat.serverxml", "The file to template and use as the Tomcat process' server.xml",
+ JavaClassNames.resolveClasspathUrl(TomcatServer.class, "server.xml"));
+
+ @SetFromFlag("web.xml")
+ ConfigKey<String> WEB_XML_RESOURCE = ConfigKeys.newStringConfigKey(
+ "tomcat.webxml", "The file to template and use as the Tomcat process' web.xml",
+ JavaClassNames.resolveClasspathUrl(TomcatServer.class, "web.xml"));
+
+ ConfigKey<Duration> START_TIMEOUT = ConfigKeys.newConfigKeyWithDefault(SoftwareProcess.START_TIMEOUT, Duration.FIVE_MINUTES);
+
+ AttributeSensor<String> CONNECTOR_STATUS =
+ new BasicAttributeSensor<String>(String.class, "webapp.tomcat.connectorStatus", "Catalina connector state name");
+
+ AttributeSensor<String> JMX_SERVICE_URL = UsesJmx.JMX_URL;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerImpl.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerImpl.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerImpl.java
new file mode 100644
index 0000000..c7858dc
--- /dev/null
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerImpl.java
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.entity.webapp.tomcat;
+
+import static java.lang.String.format;
+
+import java.util.concurrent.TimeUnit;
+
+import org.apache.brooklyn.entity.webapp.JavaWebAppSoftwareProcessImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import brooklyn.entity.java.JavaAppUtils;
+import brooklyn.event.feed.jmx.JmxAttributePollConfig;
+import brooklyn.event.feed.jmx.JmxFeed;
+
+import com.google.common.base.Functions;
+import com.google.common.base.Predicates;
+
+/**
+ * An {@link brooklyn.entity.Entity} that represents a single Tomcat instance.
+ */
+public class TomcatServerImpl extends JavaWebAppSoftwareProcessImpl implements TomcatServer {
+
+ private static final Logger LOG = LoggerFactory.getLogger(TomcatServerImpl.class);
+
+ public TomcatServerImpl() {
+ super();
+ }
+
+ private volatile JmxFeed jmxWebFeed;
+ private volatile JmxFeed jmxAppFeed;
+
+ @Override
+ public void connectSensors() {
+ super.connectSensors();
+
+ if (getDriver().isJmxEnabled()) {
+ String requestProcessorMbeanName = "Catalina:type=GlobalRequestProcessor,name=\"http-*\"";
+
+ Integer port = isHttpsEnabled() ? getAttribute(HTTPS_PORT) : getAttribute(HTTP_PORT);
+ String connectorMbeanName = format("Catalina:type=Connector,port=%s", port);
+ boolean retrieveUsageMetrics = getConfig(RETRIEVE_USAGE_METRICS);
+
+ jmxWebFeed = JmxFeed.builder()
+ .entity(this)
+ .period(3000, TimeUnit.MILLISECONDS)
+ .pollAttribute(new JmxAttributePollConfig<Boolean>(SERVICE_PROCESS_IS_RUNNING)
+ // TODO Want to use something different from SERVICE_PROCESS_IS_RUNNING,
+ // to indicate this is jmx MBean's reported state (or failure to connect)
+ .objectName(connectorMbeanName)
+ .attributeName("stateName")
+ .onSuccess(Functions.forPredicate(Predicates.<Object>equalTo("STARTED")))
+ .setOnFailureOrException(false)
+ .suppressDuplicates(true))
+ .pollAttribute(new JmxAttributePollConfig<String>(CONNECTOR_STATUS)
+ .objectName(connectorMbeanName)
+ .attributeName("stateName")
+ .suppressDuplicates(true))
+ .pollAttribute(new JmxAttributePollConfig<Integer>(ERROR_COUNT)
+ .objectName(requestProcessorMbeanName)
+ .attributeName("errorCount")
+ .enabled(retrieveUsageMetrics))
+ .pollAttribute(new JmxAttributePollConfig<Integer>(REQUEST_COUNT)
+ .objectName(requestProcessorMbeanName)
+ .attributeName("requestCount")
+ .enabled(retrieveUsageMetrics))
+ .pollAttribute(new JmxAttributePollConfig<Integer>(TOTAL_PROCESSING_TIME)
+ .objectName(requestProcessorMbeanName)
+ .attributeName("processingTime")
+ .enabled(retrieveUsageMetrics))
+ .build();
+
+ jmxAppFeed = JavaAppUtils.connectMXBeanSensors(this);
+ } else {
+ // if not using JMX
+ LOG.warn("Tomcat running without JMX monitoring; limited visibility of service available");
+ connectServiceUpIsRunning();
+ }
+ }
+
+ @Override
+ public void disconnectSensors() {
+ super.disconnectSensors();
+ if (getDriver() != null && getDriver().isJmxEnabled()) {
+ if (jmxWebFeed != null) jmxWebFeed.stop();
+ if (jmxAppFeed != null) jmxAppFeed.stop();
+ } else {
+ disconnectServiceUpIsRunning();
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Class getDriverInterface() {
+ return TomcatDriver.class;
+ }
+
+ @Override
+ public String getShortName() {
+ return "Tomcat";
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatSshDriver.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatSshDriver.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatSshDriver.java
new file mode 100644
index 0000000..45d9bb9
--- /dev/null
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatSshDriver.java
@@ -0,0 +1,175 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.entity.webapp.tomcat;
+
+import static java.lang.String.format;
+
+import java.io.InputStream;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.brooklyn.entity.webapp.JavaWebAppSshDriver;
+
+import brooklyn.entity.basic.Entities;
+import brooklyn.location.basic.SshMachineLocation;
+import brooklyn.util.collections.MutableList;
+import brooklyn.util.collections.MutableMap;
+import brooklyn.util.net.Networking;
+import brooklyn.util.os.Os;
+import brooklyn.util.ssh.BashCommands;
+import brooklyn.util.text.StringEscapes.BashStringEscapes;
+
+import com.google.common.base.Preconditions;
+
+public class TomcatSshDriver extends JavaWebAppSshDriver implements TomcatDriver {
+
+ private static final String KEYSTORE_FILE = "keystore";
+
+ public TomcatSshDriver(TomcatServerImpl entity, SshMachineLocation machine) {
+ super(entity, machine);
+ }
+
+ @Override
+ public void preInstall() {
+ resolver = Entities.newDownloader(this);
+ setExpandedInstallDir(Os.mergePaths(getInstallDir(), resolver.getUnpackedDirectoryName("apache-tomcat-"+getVersion())));
+ }
+
+ @Override
+ public void install() {
+ List<String> urls = resolver.getTargets();
+ String saveAs = resolver.getFilename();
+
+ List<String> commands = new LinkedList<String>();
+ commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs));
+ commands.add(BashCommands.INSTALL_TAR);
+ commands.add(format("tar xvzf %s", saveAs));
+
+ newScript(INSTALLING)
+ .environmentVariablesReset()
+ .body.append(commands)
+ .execute();
+ }
+
+ @Override
+ public void customize() {
+ newScript(CUSTOMIZING)
+ .body.append("mkdir -p conf logs webapps temp")
+ .failOnNonZeroResultCode()
+ .execute();
+
+ copyTemplate(entity.getConfig(TomcatServer.SERVER_XML_RESOURCE), Os.mergePaths(getRunDir(), "conf", "server.xml"));
+ copyTemplate(entity.getConfig(TomcatServer.WEB_XML_RESOURCE), Os.mergePaths(getRunDir(), "conf", "web.xml"));
+
+ // Deduplicate same code in JBoss
+ if (isProtocolEnabled("HTTPS")) {
+ String keystoreUrl = Preconditions.checkNotNull(getSslKeystoreUrl(), "keystore URL must be specified if using HTTPS for " + entity);
+ String destinationSslKeystoreFile = getHttpsSslKeystoreFile();
+ InputStream keystoreStream = resource.getResourceFromUrl(keystoreUrl);
+ getMachine().copyTo(keystoreStream, destinationSslKeystoreFile);
+ }
+
+ getEntity().deployInitialWars();
+ }
+
+ @Override
+ public void launch() {
+ Map<String, Integer> ports = MutableMap.of("httpPort", getHttpPort(), "shutdownPort", getShutdownPort());
+ Networking.checkPortsValid(ports);
+
+ // We wait for evidence of tomcat running because, using
+ // brooklyn.ssh.config.tool.class=brooklyn.util.internal.ssh.cli.SshCliTool,
+ // we saw the ssh session return before the tomcat process was fully running
+ // so the process failed to start.
+ newScript(MutableMap.of(USE_PID_FILE, false), LAUNCHING)
+ .body.append(
+ format("%s/bin/startup.sh >>$RUN/console 2>&1 </dev/null",getExpandedInstallDir()),
+ "for i in {1..10}\n" +
+ "do\n" +
+ " if [ -s "+getLogFileLocation()+" ]; then exit; fi\n" +
+ " sleep 1\n" +
+ "done\n" +
+ "echo \"Couldn't determine if tomcat-server is running (logs/catalina.out is still empty); continuing but may subsequently fail\""
+ )
+ .execute();
+ }
+
+ @Override
+ public boolean isRunning() {
+ return newScript(MutableMap.of(USE_PID_FILE, "pid.txt"), CHECK_RUNNING).execute() == 0;
+ }
+
+ @Override
+ public void stop() {
+ newScript(MutableMap.of(USE_PID_FILE, "pid.txt"), STOPPING).execute();
+ }
+
+ @Override
+ public void kill() {
+ newScript(MutableMap.of(USE_PID_FILE, "pid.txt"), KILLING).execute();
+ }
+
+ @Override
+ protected List<String> getCustomJavaConfigOptions() {
+ return MutableList.<String>builder()
+ .addAll(super.getCustomJavaConfigOptions())
+ .add("-Xms200m")
+ .add("-Xmx800m")
+ .add("-XX:MaxPermSize=400m")
+ .build();
+ }
+
+ @Override
+ public Map<String, String> getShellEnvironment() {
+ Map<String, String> shellEnv = MutableMap.<String, String>builder()
+ .putAll(super.getShellEnvironment())
+ .remove("JAVA_OPTS")
+ .put("CATALINA_PID", "pid.txt")
+ .put("CATALINA_BASE", getRunDir())
+ .put("RUN", getRunDir())
+ .build();
+
+ // Double quoting of individual JAVA_OPTS entries required due to eval in catalina.sh
+ List<String> javaOpts = getJavaOpts();
+ String sJavaOpts = BashStringEscapes.doubleQuoteLiteralsForBash(javaOpts.toArray(new String[0]));
+ shellEnv.put("CATALINA_OPTS", sJavaOpts);
+
+ return shellEnv;
+ }
+
+ @Override
+ protected String getLogFileLocation() {
+ return Os.mergePathsUnix(getRunDir(), "logs/catalina.out");
+ }
+
+ @Override
+ protected String getDeploySubdir() {
+ return "webapps";
+ }
+
+ public Integer getShutdownPort() {
+ return entity.getAttribute(TomcatServerImpl.SHUTDOWN_PORT);
+ }
+
+ public String getHttpsSslKeystoreFile() {
+ return Os.mergePathsUnix(getRunDir(), "conf", KEYSTORE_FILE);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/resources/brooklyn/entity/dns/geoscaling/template.php
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/resources/brooklyn/entity/dns/geoscaling/template.php b/software/webapp/src/main/resources/brooklyn/entity/dns/geoscaling/template.php
deleted file mode 100755
index 7c879f1..0000000
--- a/software/webapp/src/main/resources/brooklyn/entity/dns/geoscaling/template.php
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-
-/**************************************************************************************
- ** DO NOT modify this script, as your changes will likely be overwritten.
- ** Auto-generated by Brooklyn on DATESTAMP
- **************************************************************************************/
-
-
-/* Returns the approximate distance (in km) between 2 points on the Earth's surface,
- * specified as latitude and longitude in decimal degrees. Derived from the spherical
- * law of cosines.
- */
-function distanceBetween($lat1_deg, $long1_deg, $lat2_deg, $long2_deg) {
- define("RADIUS_KM", 6372.8); // approx
- $lat1_rad = deg2rad($lat1_deg);
- $lat2_rad = deg2rad($lat2_deg);
- $long_delta_rad = deg2rad($long1_deg - $long2_deg);
- $distance_km = RADIUS_KM * acos( (sin($lat1_rad) * sin($lat2_rad)) +
- (cos($lat1_rad) * cos($lat2_rad) * cos($long_delta_rad)) );
- return $distance_km;
-}
-
-function findClosestHost($lat_deg, $long_deg, $available_hosts) {
- $minimum_distance = PHP_INT_MAX;
- for ($i = 0 ; $i < sizeof($available_hosts); $i++) {
- $host = $available_hosts[$i];
- $distance_km = distanceBetween($lat_deg, $long_deg, $host['latitude'], $host['longitude']);
- if ($distance_km < $minimum_distance) {
- $minimum_distance = $distance_km;
- $closest_host = $host;
- }
- }
- return $closest_host;
-}
-
-
-/* HOST DECLARATIONS TO BE SUBSTITUTED HERE */
-
-$closest_host = findClosestHost($city_info['latitude'], $city_info['longitude'], $hosts);
-
-if (isset($closest_host)) {
- $output[] = array("TXT", "Request from [".$city_info['latitude'].",".$city_info['longitude']."]-".$city_info['city']."(".strtoupper($city_info['country']).") directed to ".$closest_host['name']);
- $output[] = array("TXT", "GeoScaling config auto-updated by Brooklyn DATESTAMP");
- if (filter_var($closest_host['ip'], FILTER_VALIDATE_IP)) {
- $output[] = array("A", $closest_host['ip']);
- } else {
- $output[] = array("CNAME", $closest_host['ip']);
- }
-} else {
- $output[] = array("fail");
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/resources/brooklyn/entity/proxy/nginx/server.conf
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/resources/brooklyn/entity/proxy/nginx/server.conf b/software/webapp/src/main/resources/brooklyn/entity/proxy/nginx/server.conf
deleted file mode 100644
index 3de046f..0000000
--- a/software/webapp/src/main/resources/brooklyn/entity/proxy/nginx/server.conf
+++ /dev/null
@@ -1,84 +0,0 @@
-[#ftl]
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# example nginx configuration file
-
-pid ${driver.pidFile};
-
-events {
- worker_connections 8196;
-}
-
-http {
- [#if entity.serverPoolAddresses?has_content]
- upstream ${entity.id} {
- [#list entity.serverPoolAddresses as address]
- server ${address};
- [/#list]
- [#if entity.sticky]
- sticky;
- [/#if]
- }
- [/#if]
-
- include mime.types;
- default_type application/octet-stream;
-
- server {
- [#if entity.domain?has_content]
- server_name ${entity.domain};
- [/#if]
-
- [#if entity.ssl]
- # HTTPS setup
- listen ${entity.port?c} default ssl;
- ssl_certificate ${driver.runDir}/conf/global.crt;
- ssl_certificate_key ${driver.runDir}/conf/global.key;
-
- # https://wiki.mozilla.org/Security/Server_Side_TLS
- # https://mozilla.github.io/server-side-tls/ssl-config-generator/
- # generated 05.05.2015, Intermediate config from first link
- ssl_session_timeout 1d;
- ssl_session_cache shared:SSL:50m;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
- ssl_prefer_server_ciphers on;
- [#else]
- # HTTP setup
- listen ${entity.port?c};
- [/#if]
-
-
- # Logging
- access_log ${driver.accessLogLocation};
- error_log ${driver.errorLogLocation};
-
- [#if entity.serverPoolAddresses?has_content]
- location / {
- server_tokens off;
- proxy_pass http[#if entity.portNumberSensor.name == "https.port"]s[/#if]://${entity.id};
- proxy_set_header X-Real-IP [#noparse]$remote_addr[/#noparse];
- proxy_set_header X-Forwarded-For [#noparse]$proxy_add_x_forwarded_for[/#noparse];
- proxy_set_header Host [#noparse]$http_host[/#noparse];
- proxy_read_timeout 900;
- proxy_connect_timeout 75;
- }
- [/#if]
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/resources/brooklyn/entity/webapp/jboss/jboss7-standalone.xml
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/resources/brooklyn/entity/webapp/jboss/jboss7-standalone.xml b/software/webapp/src/main/resources/brooklyn/entity/webapp/jboss/jboss7-standalone.xml
deleted file mode 100644
index 1e0f6c1..0000000
--- a/software/webapp/src/main/resources/brooklyn/entity/webapp/jboss/jboss7-standalone.xml
+++ /dev/null
@@ -1,311 +0,0 @@
-[#ftl]
-<?xml version="1.0" encoding="UTF-8"?>
-<server xmlns="urn:jboss:domain:1.2">
- <extensions>
- <extension module="org.jboss.as.clustering.infinispan"/>
- <extension module="org.jboss.as.configadmin"/>
- <extension module="org.jboss.as.connector"/>
- <extension module="org.jboss.as.deployment-scanner"/>
- <extension module="org.jboss.as.ee"/>
- <extension module="org.jboss.as.ejb3"/>
- <extension module="org.jboss.as.jaxrs"/>
- <extension module="org.jboss.as.jdr"/>
- <extension module="org.jboss.as.jmx"/>
- <extension module="org.jboss.as.jpa"/>
- <extension module="org.jboss.as.logging"/>
- <extension module="org.jboss.as.mail"/>
- <extension module="org.jboss.as.naming"/>
- <extension module="org.jboss.as.osgi"/>
- <extension module="org.jboss.as.pojo"/>
- <extension module="org.jboss.as.remoting"/>
- <extension module="org.jboss.as.sar"/>
- <extension module="org.jboss.as.security"/>
- <extension module="org.jboss.as.threads"/>
- <extension module="org.jboss.as.transactions"/>
- <extension module="org.jboss.as.web"/>
- <extension module="org.jboss.as.webservices"/>
- <extension module="org.jboss.as.weld"/>
- </extensions>
- <management>
- <security-realms>
- <security-realm name="ManagementRealm">
- <authentication>
- <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
- </authentication>
- </security-realm>
- <security-realm name="ApplicationRealm">
- <authentication>
- <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
- </authentication>
- </security-realm>
- </security-realms>
- <management-interfaces>
- <native-interface security-realm="ManagementRealm">
- <socket-binding native="management-native"/>
- </native-interface>
- <http-interface security-realm="ManagementRealm">
- <socket-binding http="management-http"/>
- </http-interface>
- </management-interfaces>
- </management>
- <profile>
- <subsystem xmlns="urn:jboss:domain:logging:1.1">
- <console-handler name="CONSOLE">
- <level name="INFO"/>
- <formatter>
- <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
- </formatter>
- </console-handler>
- <periodic-rotating-file-handler name="FILE">
- <formatter>
- <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
- </formatter>
- <file relative-to="jboss.server.log.dir" path="server.log"/>
- <suffix value=".yyyy-MM-dd"/>
- <append value="true"/>
- </periodic-rotating-file-handler>
- <logger category="com.arjuna">
- <level name="WARN"/>
- </logger>
- <logger category="org.apache.tomcat.util.modeler">
- <level name="WARN"/>
- </logger>
- <logger category="sun.rmi">
- <level name="WARN"/>
- </logger>
- <logger category="jacorb">
- <level name="WARN"/>
- </logger>
- <logger category="jacorb.config">
- <level name="ERROR"/>
- </logger>
- <root-logger>
- <level name="INFO"/>
- <handlers>
- <handler name="CONSOLE"/>
- <handler name="FILE"/>
- </handlers>
- </root-logger>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:configadmin:1.0"/>
- <subsystem xmlns="urn:jboss:domain:datasources:1.0">
- <datasources>
- <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
- <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
- <driver>h2</driver>
- <security>
- <user-name>sa</user-name>
- <password>sa</password>
- </security>
- </datasource>
- <drivers>
- <driver name="h2" module="com.h2database.h2">
- <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
- </driver>
- </drivers>
- </datasources>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
- <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000"/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:ee:1.0"/>
- <subsystem xmlns="urn:jboss:domain:ejb3:1.2">
- <session-bean>
- <stateless>
- <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
- </stateless>
- <stateful default-access-timeout="5000" cache-ref="simple"/>
- <singleton default-access-timeout="5000"/>
- </session-bean>
- <pools>
- <bean-instance-pools>
- <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
- <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
- </bean-instance-pools>
- </pools>
- <caches>
- <cache name="simple" aliases="NoPassivationCache"/>
- <cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/>
- </caches>
- <passivation-stores>
- <file-passivation-store name="file"/>
- </passivation-stores>
- <async thread-pool-name="default"/>
- <timer-service thread-pool-name="default">
- <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>
- </timer-service>
- <remote connector-ref="remoting-connector" thread-pool-name="default"/>
- <thread-pools>
- <thread-pool name="default">
- <max-threads count="10"/>
- <keepalive-time time="100" unit="milliseconds"/>
- </thread-pool>
- </thread-pools>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="hibernate">
- <cache-container name="hibernate" default-cache="local-query">
- <local-cache name="entity">
- <transaction mode="NON_XA"/>
- <eviction strategy="LRU" max-entries="10000"/>
- <expiration max-idle="100000"/>
- </local-cache>
- <local-cache name="local-query">
- <transaction mode="NONE"/>
- <eviction strategy="LRU" max-entries="10000"/>
- <expiration max-idle="100000"/>
- </local-cache>
- <local-cache name="timestamps">
- <transaction mode="NONE"/>
- <eviction strategy="NONE"/>
- </local-cache>
- </cache-container>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
- <subsystem xmlns="urn:jboss:domain:jca:1.1">
- <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
- <bean-validation enabled="true"/>
- <default-workmanager>
- <short-running-threads>
- <core-threads count="50"/>
- <queue-length count="50"/>
- <max-threads count="50"/>
- <keepalive-time time="10" unit="seconds"/>
- </short-running-threads>
- <long-running-threads>
- <core-threads count="50"/>
- <queue-length count="50"/>
- <max-threads count="50"/>
- <keepalive-time time="10" unit="seconds"/>
- </long-running-threads>
- </default-workmanager>
- <cached-connection-manager/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
- <subsystem xmlns="urn:jboss:domain:jmx:1.1">
- <show-model value="true"/>
- <remoting-connector/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jpa:1.0">
- <jpa default-datasource=""/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:mail:1.0">
- <mail-session jndi-name="java:jboss/mail/Default">
- <smtp-server outbound-socket-binding-ref="mail-smtp"/>
- </mail-session>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:naming:1.1"/>
- <subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="lazy">
- <properties>
- <!-- Specifies the beginning start level of the framework -->
- <property name="org.osgi.framework.startlevel.beginning">1</property>
- </properties>
- <capabilities>
- <!-- modules registered with the OSGi layer on startup -->
- <capability name="javax.servlet.api:v25"/>
- <capability name="javax.transaction.api"/>
- <!-- bundles started in startlevel 1 -->
- <capability name="org.apache.felix.log" startlevel="1"/>
- <capability name="org.jboss.osgi.logging" startlevel="1"/>
- <capability name="org.apache.felix.configadmin" startlevel="1"/>
- <capability name="org.jboss.as.osgi.configadmin" startlevel="1"/>
- </capabilities>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:pojo:1.0"/>
- <subsystem xmlns="urn:jboss:domain:remoting:1.1">
- <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"/>
- <subsystem xmlns="urn:jboss:domain:sar:1.0"/>
- <subsystem xmlns="urn:jboss:domain:security:1.1">
- <security-domains>
- <security-domain name="other" cache-type="default">
- <authentication>
- <login-module code="Remoting" flag="optional">
- <module-option name="password-stacking" value="useFirstPass"/>
- </login-module>
- <login-module code="RealmUsersRoles" flag="required">
- <module-option name="usersProperties" value="[#noparse]${jboss.server.config.dir}[/#noparse]/application-users.properties"/>
- <module-option name="rolesProperties" value="[#noparse]${jboss.server.config.dir}[/#noparse]/application-roles.properties"/>
- <module-option name="realm" value="ApplicationRealm"/>
- <module-option name="password-stacking" value="useFirstPass"/>
- </login-module>
- </authentication>
- </security-domain>
- <security-domain name="jboss-web-policy" cache-type="default">
- <authorization>
- <policy-module code="Delegating" flag="required"/>
- </authorization>
- </security-domain>
- <security-domain name="jboss-ejb-policy" cache-type="default">
- <authorization>
- <policy-module code="Delegating" flag="required"/>
- </authorization>
- </security-domain>
- </security-domains>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:threads:1.1"/>
- <subsystem xmlns="urn:jboss:domain:transactions:1.1">
- <core-environment>
- <process-id>
- <uuid/>
- </process-id>
- </core-environment>
- <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
- <coordinator-environment default-timeout="300"/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
- <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" enabled="${entity.httpEnabled?string}"/>
- [#if entity.httpsEnabled]
- <connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true" enabled="${entity.httpsEnabled?string}">
- <ssl key-alias="${entity.httpsSslKeyAlias}" password="${entity.httpsSslKeystorePassword}" certificate-key-file="${entity.httpsSslKeystoreFile}" protocol="TLSv1,TLSv1.1,TLSv1.2"/>
- </connector>
- [/#if]
- <virtual-server name="default-host" enable-welcome-root="${entity.welcomeRootEnabled?string}">
- <alias name="localhost"/>
- <alias name="example.com"/>
- </virtual-server>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:webservices:1.1">
- <modify-wsdl-address>true</modify-wsdl-address>
- <wsdl-host>${entity.bindAddress}</wsdl-host>
- <endpoint-config name="Standard-Endpoint-Config"/>
- <endpoint-config name="Recording-Endpoint-Config">
- <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
- <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
- </pre-handler-chain>
- </endpoint-config>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:weld:1.0"/>
- </profile>
- <interfaces>
- <interface name="management">
- <inet-address value="${entity.managementBindAddress}"/>
- </interface>
- <interface name="public">
- <inet-address value="${entity.bindAddress}"/>
- </interface>
- <!-- TODO - only show this if the jacorb subsystem is added -->
- <interface name="unsecure">
- <!--
- ~ Used for IIOP sockets in the standard configuration.
- ~ To secure JacORB you need to setup SSL
- -->
- <inet-address value="${entity.unsecureBindAddress}"/>
- </interface>
- </interfaces>
- <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${entity.portOffset?c}">
- <socket-binding name="management-native" interface="management" port="${entity.managementNativePort?c}"/>
- <socket-binding name="management-http" interface="management" port="${entity.managementHttpPort?c}"/>
- <socket-binding name="management-https" interface="management" port="${entity.managementHttpsPort?c}"/>
- <socket-binding name="ajp" port="8009"/>
- <socket-binding name="http" port="[#if entity.httpEnabled]${entity.httpPort?c}[#else]8080[/#if]"/>
- <socket-binding name="https" port="[#if entity.httpsEnabled]${entity.httpsPort?c}[#else]8443[/#if]"/>
- <socket-binding name="osgi-http" interface="management" port="8090"/>
- <socket-binding name="remoting" port="4447"/>
- <socket-binding name="txn-recovery-environment" port="4712"/>
- <socket-binding name="txn-status-manager" port="4713"/>
- <outbound-socket-binding name="mail-smtp">
- <remote-destination host="localhost" port="25"/>
- </outbound-socket-binding>
- </socket-binding-group>
-</server>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/resources/brooklyn/entity/webapp/jetty/jetty-brooklyn.xml
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/resources/brooklyn/entity/webapp/jetty/jetty-brooklyn.xml b/software/webapp/src/main/resources/brooklyn/entity/webapp/jetty/jetty-brooklyn.xml
deleted file mode 100644
index 746395f..0000000
--- a/software/webapp/src/main/resources/brooklyn/entity/webapp/jetty/jetty-brooklyn.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-[#ftl]
-<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
-<!-- Configure the Jetty JMX Server -->
-<Configure id="Server" class="org.mortbay.jetty.Server">
-[#if entity.jmxPort > 0]
- <!-- Create an MBeanServer -->
- <!--
- <Call id="MBeanServer" class="javax.management.MBeanServerFactory" name="createMBeanServer"/>
- -->
-
- <!-- Use the JDK PlatformMBeanServer -->
- <Call id="MBeanServer" class="java.lang.management.ManagementFactory" name="getPlatformMBeanServer"/>
-
- <!-- initialize the Jetty MBean container -->
- <Get id="Container" name="container">
- <Call name="addEventListener">
- <Arg>
- <New class="org.mortbay.management.MBeanContainer">
- <Arg><Ref id="MBeanServer"/></Arg>
- <Set name="managementPort">${entity.jmxPort?c}</Set>
- <Call name="start" />
- </New>
- </Arg>
- </Call>
- </Get>
-
- <!-- Add a remote JMX connector -->
- <!--
- <Call id="jmxConnector" class="javax.management.remote.JMXConnectorServerFactory" name="newJMXConnectorServer">
- <Arg>
- <New class="javax.management.remote.JMXServiceURL">
- <Arg>service:jmx:rmi:///jndi/rmi:///jettymbeanserver</Arg>
- </New>
- </Arg>
- <Arg/>
- <Arg><Ref id="MBeanServer"/></Arg>
- <Call name="start"/>
- </Call>
- -->
-[/#if]
-</Configure>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/resources/brooklyn/entity/webapp/sample-java-keystore.jks
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/resources/brooklyn/entity/webapp/sample-java-keystore.jks b/software/webapp/src/main/resources/brooklyn/entity/webapp/sample-java-keystore.jks
deleted file mode 100644
index ee18b1d..0000000
Binary files a/software/webapp/src/main/resources/brooklyn/entity/webapp/sample-java-keystore.jks and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/resources/brooklyn/entity/webapp/sample-java-keystore.txt
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/resources/brooklyn/entity/webapp/sample-java-keystore.txt b/software/webapp/src/main/resources/brooklyn/entity/webapp/sample-java-keystore.txt
deleted file mode 100644
index 53096b5..0000000
--- a/software/webapp/src/main/resources/brooklyn/entity/webapp/sample-java-keystore.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Keystore for use in tests and sample YAML, containing key with alias "myname" and password "mypass";
-created for this project using AbstractWebAppFixtureIntegrationTest.createTemporaryKeyStore .
-
-
-----
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/resources/brooklyn/entity/webapp/tomcat/server.xml
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/resources/brooklyn/entity/webapp/tomcat/server.xml b/software/webapp/src/main/resources/brooklyn/entity/webapp/tomcat/server.xml
deleted file mode 100644
index 83e8db0..0000000
--- a/software/webapp/src/main/resources/brooklyn/entity/webapp/tomcat/server.xml
+++ /dev/null
@@ -1,206 +0,0 @@
-[#ftl]
-<?xml version='1.0' encoding='utf-8'?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<!-- Brooklyn note: This file is a modified copy of server.xml from Tomcat v7.0.56.
--->
-<!-- Note: A "Server" is not itself a "Container", so you may not
- define subcomponents such as "Valves" at this level.
- Documentation at /docs/config/server.html
- -->
-<Server port="${driver.shutdownPort?c}" shutdown="SHUTDOWN">
- <!-- Security listener. Documentation at /docs/config/listeners.html
- <Listener className="org.apache.catalina.security.SecurityListener" />
- -->
- <!--APR library loader. Documentation at /docs/apr.html -->
- <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
- <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
- <Listener className="org.apache.catalina.core.JasperListener" />
- <!-- Prevent memory leaks due to use of particular java/javax APIs-->
- <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
- <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
- <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
-
- <!-- Global JNDI resources
- Documentation at /docs/jndi-resources-howto.html
- -->
- <GlobalNamingResources>
- <!-- Editable user database that can also be used by
- UserDatabaseRealm to authenticate users
- -->
- <Resource name="UserDatabase" auth="Container"
- type="org.apache.catalina.UserDatabase"
- description="User database that can be updated and saved"
- factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
- pathname="conf/tomcat-users.xml" />
- </GlobalNamingResources>
-
- <!-- A "Service" is a collection of one or more "Connectors" that share
- a single "Container" Note: A "Service" is not itself a "Container",
- so you may not define subcomponents such as "Valves" at this level.
- Documentation at /docs/config/service.html
- -->
- <Service name="Catalina">
-
- <!--The connectors can use a shared executor, you can define one or more named thread pools-->
- <!--
- <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
- maxThreads="150" minSpareThreads="4"/>
- -->
-
-
- <!-- A "Connector" represents an endpoint by which requests are received
- and responses are returned. Documentation at :
- Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
- Java AJP Connector: /docs/config/ajp.html
- APR (HTTP/AJP) Connector: /docs/apr.html
- Define a non-SSL HTTP/1.1 Connector on port ${driver.httpPort?c}
- -->
- [#if entity.httpEnabled]
- <Connector port="${driver.httpPort?c}" protocol="HTTP/1.1"
- connectionTimeout="20000"
- redirectPort="${driver.httpsPort?c}" />
- [/#if]
-
- <!-- A "Connector" using the shared thread pool-->
- <!--
- <Connector executor="tomcatThreadPool"
- port="${driver.httpPort?c}" protocol="HTTP/1.1"
- connectionTimeout="20000"
- redirectPort="${driver.httpsPort?c}" />
- -->
-
- <!-- Define a SSL HTTP/1.1 Connector on port ${driver.httpPort?c}
- This connector uses the BIO implementation that requires the JSSE
- style configuration. When using the APR/native implementation, the
- OpenSSL style configuration is required as described in the APR/native
- documentation -->
- [#if entity.httpsEnabled]
-
- <!--
- SSL config:
- https://wiki.mozilla.org/Security/Server_Side_TLS (v3.4)
- http://stackoverflow.com/questions/19846020/how-to-map-a-openssls-cipher-list-to-java-jsse
- List created on 05.05.2015, Intermediate config from first link.
-
- List repeated twice, once with TLS_ prefix, once with SSL_ prefix for IBM java compatibility.
- https://www-01.ibm.com/support/knowledgecenter/SSYKE2_7.0.0/com.ibm.java.security.component.70.doc/security-component/jsse2Docs/ciphersuites.html
- -->
-
- <Connector port="${driver.httpsPort?c}" protocol="org.apache.coyote.http11.Http11Protocol"
- maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
- keystoreFile="${driver.httpsSslKeystoreFile}" keystorePass="${entity.httpsSslKeystorePassword}"
- clientAuth="false" sslEnabledProtocols="TLSv1.2,TLSv1.1,TLSv1"
- ciphers="TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
- TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_DSS_WITH_AES_128_GCM_SHA256,
- TLS_DHE_DSS_WITH_AES_256_GCM_SHA384,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,
- TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
- TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
- TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
- TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
- TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,
- TLS_DHE_DSS_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,
- TLS_DHE_DSS_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
- TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,
- TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA256,
- TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,
- TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
- TLS_SRP_SHA_WITH_AES_256_CBC_SHA,TLS_DHE_DSS_WITH_AES_256_CBC_SHA256,
- TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
- TLS_SRP_SHA_WITH_AES_128_CBC_SHA,TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
- TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
- TLS_RSA_WITH_CAMELLIA_256_CBC_SHA,TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
- TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,TLS_RSA_WITH_CAMELLIA_128_CBC_SHA,
- TLS_RSA_WITH_3DES_EDE_CBC_SHA,
- SSL_ECDHE_RSA_WITH_AES_128_GCM_SHA256,SSL_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
- SSL_ECDHE_RSA_WITH_AES_256_GCM_SHA384,SSL_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
- SSL_DHE_RSA_WITH_AES_128_GCM_SHA256,SSL_DHE_DSS_WITH_AES_128_GCM_SHA256,
- SSL_DHE_DSS_WITH_AES_256_GCM_SHA384,SSL_DHE_RSA_WITH_AES_256_GCM_SHA384,
- SSL_ECDHE_RSA_WITH_AES_128_CBC_SHA256,SSL_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
- SSL_ECDHE_RSA_WITH_AES_128_CBC_SHA,SSL_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
- SSL_ECDHE_RSA_WITH_AES_256_CBC_SHA384,SSL_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
- SSL_ECDHE_RSA_WITH_AES_256_CBC_SHA,SSL_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
- SSL_DHE_RSA_WITH_AES_128_CBC_SHA256,SSL_DHE_RSA_WITH_AES_128_CBC_SHA,
- SSL_DHE_DSS_WITH_AES_128_CBC_SHA256,SSL_DHE_RSA_WITH_AES_256_CBC_SHA256,
- SSL_DHE_DSS_WITH_AES_256_CBC_SHA,SSL_DHE_RSA_WITH_AES_256_CBC_SHA,
- SSL_RSA_WITH_AES_128_GCM_SHA256,SSL_RSA_WITH_AES_256_GCM_SHA384,
- SSL_RSA_WITH_AES_128_CBC_SHA256,SSL_RSA_WITH_AES_256_CBC_SHA256,
- SSL_RSA_WITH_AES_128_CBC_SHA,SSL_RSA_WITH_AES_256_CBC_SHA,
- SSL_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,SSL_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
- SSL_SRP_SHA_WITH_AES_256_CBC_SHA,SSL_DHE_DSS_WITH_AES_256_CBC_SHA256,
- SSL_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,SSL_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
- SSL_SRP_SHA_WITH_AES_128_CBC_SHA,SSL_DHE_DSS_WITH_AES_128_CBC_SHA,
- SSL_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,SSL_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
- SSL_RSA_WITH_CAMELLIA_256_CBC_SHA,SSL_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
- SSL_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,SSL_RSA_WITH_CAMELLIA_128_CBC_SHA,
- SSL_RSA_WITH_3DES_EDE_CBC_SHA" />
- [/#if]
-
- <!-- Define an AJP 1.3 Connector on port 8009 -->
- <!-- <Connector port="8009" protocol="AJP/1.3" redirectPort="${driver.httpPort?c}" /> -->
-
-
- <!-- An Engine represents the entry point (within Catalina) that processes
- every request. The Engine implementation for Tomcat stand alone
- analyzes the HTTP headers included with the request, and passes them
- on to the appropriate Host (virtual host).
- Documentation at /docs/config/engine.html -->
-
- <!-- You should set jvmRoute to support load-balancing via AJP ie :
- <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
- -->
- <Engine name="Catalina" defaultHost="localhost">
-
- <!--For clustering, please take a look at documentation at:
- /docs/cluster-howto.html (simple how to)
- /docs/config/cluster.html (reference documentation) -->
- <!--
- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
- -->
-
- <!-- Use the LockOutRealm to prevent attempts to guess user passwords
- via a brute-force attack -->
- <Realm className="org.apache.catalina.realm.LockOutRealm">
- <!-- This Realm uses the UserDatabase configured in the global JNDI
- resources under the key "UserDatabase". Any edits
- that are performed against this UserDatabase are immediately
- available for use by the Realm. -->
- <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
- resourceName="UserDatabase"/>
- </Realm>
-
- <Host name="localhost" appBase="webapps"
- unpackWARs="true" autoDeploy="true">
-
- <!-- SingleSignOn valve, share authentication between web applications
- Documentation at: /docs/config/valve.html -->
- <!--
- <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
- -->
-
- <!-- Access log processes all example.
- Documentation at: /docs/config/valve.html
- Note: The pattern used is equivalent to using pattern="common" -->
- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
- prefix="localhost_access_log." suffix=".txt"
- pattern="%h %l %u %t "%r" %s %b" />
-
- </Host>
- </Engine>
- </Service>
-</Server>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/resources/brooklyn/entity/webapp/tomcat/tomcat8-server.xml
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/resources/brooklyn/entity/webapp/tomcat/tomcat8-server.xml b/software/webapp/src/main/resources/brooklyn/entity/webapp/tomcat/tomcat8-server.xml
deleted file mode 100644
index 98f014a..0000000
--- a/software/webapp/src/main/resources/brooklyn/entity/webapp/tomcat/tomcat8-server.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-[#ftl]
-<?xml version='1.0' encoding='utf-8'?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<!-- Brooklyn note: This file is a modified copy of server.xml from Tomcat v8.0.22.
--->
-<!-- Note: A "Server" is not itself a "Container", so you may not
- define subcomponents such as "Valves" at this level.
- Documentation at /docs/config/server.html
- -->
-<Server port="${driver.shutdownPort?c}" shutdown="SHUTDOWN">
- <!-- Security listener. Documentation at /docs/config/listeners.html
- <Listener className="org.apache.catalina.security.SecurityListener" />
- -->
- <!--APR library loader. Documentation at /docs/apr.html -->
- <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
- <!-- Prevent memory leaks due to use of particular java/javax APIs-->
- <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
- <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
- <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
-
- <!-- Global JNDI resources
- Documentation at /docs/jndi-resources-howto.html
- -->
- <GlobalNamingResources>
- <!-- Editable user database that can also be used by
- UserDatabaseRealm to authenticate users
- -->
- <Resource name="UserDatabase" auth="Container"
- type="org.apache.catalina.UserDatabase"
- description="User database that can be updated and saved"
- factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
- pathname="conf/tomcat-users.xml" />
- </GlobalNamingResources>
-
- <!-- A "Service" is a collection of one or more "Connectors" that share
- a single "Container" Note: A "Service" is not itself a "Container",
- so you may not define subcomponents such as "Valves" at this level.
- Documentation at /docs/config/service.html
- -->
- <Service name="Catalina">
-
- <!--The connectors can use a shared executor, you can define one or more named thread pools-->
- <!--
- <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
- maxThreads="150" minSpareThreads="4"/>
- -->
-
-
- <!-- A "Connector" represents an endpoint by which requests are received
- and responses are returned. Documentation at :
- Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
- Java AJP Connector: /docs/config/ajp.html
- APR (HTTP/AJP) Connector: /docs/apr.html
- Define a non-SSL HTTP/1.1 Connector on port ${driver.httpPort?c}
- -->
- [#if entity.httpEnabled]
- <Connector port="${driver.httpPort?c}" protocol="HTTP/1.1"
- connectionTimeout="20000"
- redirectPort="${driver.httpsPort?c}" />
- [/#if]
-
- <!-- A "Connector" using the shared thread pool-->
- <!--
- <Connector executor="tomcatThreadPool"
- port="${driver.httpPort?c}" protocol="HTTP/1.1"
- connectionTimeout="20000"
- redirectPort="${driver.httpsPort?c}" />
- -->
-
- <!-- Define a SSL HTTP/1.1 Connector on port ${driver.httpPort?c}
- This connector uses the BIO implementation that requires the JSSE
- style configuration. When using the APR/native implementation, the
- OpenSSL style configuration is required as described in the APR/native
- documentation -->
- [#if entity.httpsEnabled]
- <Connector port="${driver.httpsPort?c}" protocol="org.apache.coyote.http11.Http11Protocol"
- maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
- keystoreFile="${driver.httpsSslKeystoreFile}" keystorePass="${entity.httpsSslKeystorePassword}"
- clientAuth="false" sslEnabledProtocols="TLSv1.2,TLSv1.1,TLSv1" />
- [/#if]
-
- <!-- Define an AJP 1.3 Connector on port 8009 -->
- <!-- <Connector port="8009" protocol="AJP/1.3" redirectPort="${driver.httpPort?c}" /> -->
-
-
- <!-- An Engine represents the entry point (within Catalina) that processes
- every request. The Engine implementation for Tomcat stand alone
- analyzes the HTTP headers included with the request, and passes them
- on to the appropriate Host (virtual host).
- Documentation at /docs/config/engine.html -->
-
- <!-- You should set jvmRoute to support load-balancing via AJP ie :
- <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
- -->
- <Engine name="Catalina" defaultHost="localhost">
-
- <!--For clustering, please take a look at documentation at:
- /docs/cluster-howto.html (simple how to)
- /docs/config/cluster.html (reference documentation) -->
- <!--
- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
- -->
-
- <!-- Use the LockOutRealm to prevent attempts to guess user passwords
- via a brute-force attack -->
- <Realm className="org.apache.catalina.realm.LockOutRealm">
- <!-- This Realm uses the UserDatabase configured in the global JNDI
- resources under the key "UserDatabase". Any edits
- that are performed against this UserDatabase are immediately
- available for use by the Realm. -->
- <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
- resourceName="UserDatabase"/>
- </Realm>
-
- <Host name="localhost" appBase="webapps"
- unpackWARs="true" autoDeploy="true">
-
- <!-- SingleSignOn valve, share authentication between web applications
- Documentation at: /docs/config/valve.html -->
- <!--
- <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
- -->
-
- <!-- Access log processes all example.
- Documentation at: /docs/config/valve.html
- Note: The pattern used is equivalent to using pattern="common" -->
- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
- prefix="localhost_access_log" suffix=".txt"
- pattern="%h %l %u %t "%r" %s %b" />
-
- </Host>
- </Engine>
- </Service>
-</Server>