You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2011/03/29 20:25:56 UTC

svn commit: r1086673 - in /tuscany/sca-java-2.x/trunk/modules/host-http/src/main: java/org/apache/tuscany/sca/host/http/extensibility/impl/ resources/META-INF/services/

Author: lresende
Date: Tue Mar 29 18:25:55 2011
New Revision: 1086673

URL: http://svn.apache.org/viewvc?rev=1086673&view=rev
Log:
TUSCANY-3856 - Missing default http port allocator implementation plus service locator for port allocator extensibility

Added:
    tuscany/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/
    tuscany/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/DefaultHttpPortAllocatorImpl.java   (with props)
    tuscany/sca-java-2.x/trunk/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.extensibility.HttpPortAllocator
    tuscany/sca-java-2.x/trunk/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.extensibility.HttpPortAllocatorExtensionPoint

Added: tuscany/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/DefaultHttpPortAllocatorImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/DefaultHttpPortAllocatorImpl.java?rev=1086673&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/DefaultHttpPortAllocatorImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/DefaultHttpPortAllocatorImpl.java Tue Mar 29 18:25:55 2011
@@ -0,0 +1,41 @@
+/*
+ * 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.tuscany.sca.host.http.extensibility.impl;
+
+import org.apache.tuscany.sca.host.http.HttpScheme;
+import org.apache.tuscany.sca.host.http.extensibility.HttpPortAllocator;
+
+public class DefaultHttpPortAllocatorImpl implements HttpPortAllocator {
+
+    public int getDefaultPort(HttpScheme scheme) {
+        int port = 0;
+
+        if(scheme == HttpScheme.HTTP) {
+            port = 8080;
+        } else if(scheme == HttpScheme.HTTPS) {
+           port = 8443;
+        } else {
+            throw new IllegalArgumentException("Scheme not support : " + scheme.toString());
+        }
+
+        return port;
+    }
+
+}

Propchange: tuscany/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/DefaultHttpPortAllocatorImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/DefaultHttpPortAllocatorImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sca-java-2.x/trunk/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.extensibility.HttpPortAllocator
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.extensibility.HttpPortAllocator?rev=1086673&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.extensibility.HttpPortAllocator (added)
+++ tuscany/sca-java-2.x/trunk/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.extensibility.HttpPortAllocator Tue Mar 29 18:25:55 2011
@@ -0,0 +1,19 @@
+# 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.
+
+org.apache.tuscany.sca.host.http.extensibility.impl.DefaultHttpPortAllocatorImpl
+

Added: tuscany/sca-java-2.x/trunk/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.extensibility.HttpPortAllocatorExtensionPoint
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.extensibility.HttpPortAllocatorExtensionPoint?rev=1086673&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.extensibility.HttpPortAllocatorExtensionPoint (added)
+++ tuscany/sca-java-2.x/trunk/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.extensibility.HttpPortAllocatorExtensionPoint Tue Mar 29 18:25:55 2011
@@ -0,0 +1,19 @@
+# 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.
+
+org.apache.tuscany.sca.host.http.extensibility.DefaultHttpPortAllocatorExtensionPoint
+