You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2015/06/18 13:21:05 UTC
tomee git commit: adding ClasspathMain in tomee-embedded to ease
deploy classpath main (some cloud platforms dont support params ie --as-war)
Repository: tomee
Updated Branches:
refs/heads/master c836ad8b0 -> 7cc580c4f
adding ClasspathMain in tomee-embedded to ease deploy classpath main (some cloud platforms dont support params ie --as-war)
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/7cc580c4
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/7cc580c4
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/7cc580c4
Branch: refs/heads/master
Commit: 7cc580c4f132e72fd62726af6914db7705873c40
Parents: c836ad8
Author: Romain Manni-Bucau <rm...@apache.org>
Authored: Thu Jun 18 13:20:58 2015 +0200
Committer: Romain Manni-Bucau <rm...@apache.org>
Committed: Thu Jun 18 13:20:58 2015 +0200
----------------------------------------------------------------------
.../apache/tomee/embedded/ClasspathMain.java | 35 ++++++++++++++++++++
1 file changed, 35 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/7cc580c4/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/ClasspathMain.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/ClasspathMain.java b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/ClasspathMain.java
new file mode 100644
index 0000000..ff73475
--- /dev/null
+++ b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/ClasspathMain.java
@@ -0,0 +1,35 @@
+/**
+ * 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.tomee.embedded;
+
+// same as Main but for platforms not supporting parameters it is convenient
+public final class ClasspathMain {
+ public static void main(final String[] args) {
+ try (final Container container = new Container(new Configuration().http(httpPort())).deployClasspathAsWebApp()) {
+ container.await();
+ }
+ }
+
+ private static int httpPort() {
+ final String port = System.getenv("PORT");
+ return port == null ? 8080 : Integer.parseInt(port);
+ }
+
+ private ClasspathMain() {
+ // no-op
+ }
+}