[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openejb-cvs
Subject:    tomee git commit: adding ClasspathMain in tomee-embedded to ease deploy classpath main (some cloud p
From:       rmannibucau () apache ! org
Date:       2015-06-18 11:21:05
Message-ID: b1c0cf22ba7c437c9fe1368bf5576534 () git ! apache ! org
[Download RAW message or body]

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 <rmannibucau@apache.org>
Authored: Thu Jun 18 13:20:58 2015 +0200
Committer: Romain Manni-Bucau <rmannibucau@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
+    }
+}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic