summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/host-http/src/main
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2011-04-20 22:34:51 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2011-04-20 22:34:51 +0000
commit19c5d85b1c029029f345b7300eacd4894a50cb14 (patch)
tree9d32d585e8d3cc75464d0ebe89cbdb2d55d11dc7 /sca-java-2.x/trunk/modules/host-http/src/main
parente088fd512295048f3caec62f1dd2cd4d1a6b4d54 (diff)
Allow the look up of endpoint address by component/service/binding name from the Node API
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1095537 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/host-http/src/main')
-rw-r--r--sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/HttpPortAllocator.java2
-rw-r--r--sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/DefaultHttpPortAllocatorImpl.java12
2 files changed, 8 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/HttpPortAllocator.java b/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/HttpPortAllocator.java
index 71a164df2e..e7324130b1 100644
--- a/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/HttpPortAllocator.java
+++ b/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/HttpPortAllocator.java
@@ -27,6 +27,8 @@ import org.apache.tuscany.sca.host.http.HttpScheme;
* @version $Rev$ $Date$
*/
public interface HttpPortAllocator {
+ int DEFAULT_HTTP_PORT = 8085;
+ int DEFAULT_HTTPS_PORT = 8443;
/**
* Get default port for a given http scheme
* @param scheme the http scheme in use (http/https)
diff --git a/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/DefaultHttpPortAllocatorImpl.java b/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/DefaultHttpPortAllocatorImpl.java
index af41e85213..544b1ea8df 100644
--- a/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/DefaultHttpPortAllocatorImpl.java
+++ b/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/extensibility/impl/DefaultHttpPortAllocatorImpl.java
@@ -34,21 +34,21 @@ public class DefaultHttpPortAllocatorImpl implements HttpPortAllocator {
if (scheme == null || scheme == HttpScheme.HTTP) {
try {
- port = Integer.parseInt(getVariable("HTTP_PORT", "8080"));
+ port = Integer.parseInt(getVariable("HTTP_PORT", String.valueOf(DEFAULT_HTTP_PORT)));
if (port == 0) {
- port = findFreePort(8080, 9080);
+ port = findFreePort(DEFAULT_HTTP_PORT, DEFAULT_HTTP_PORT + 1000);
}
} catch (NumberFormatException e) {
- port = 8080;
+ port = DEFAULT_HTTP_PORT;
}
} else if (scheme == HttpScheme.HTTPS) {
try {
- port = Integer.parseInt(getVariable("HTTPS_PORT", "8443"));
+ port = Integer.parseInt(getVariable("HTTPS_PORT", String.valueOf(DEFAULT_HTTPS_PORT)));
if (port == 0) {
- port = findFreePort(8443, 9443);
+ port = findFreePort(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_PORT + 1000);
}
} catch (NumberFormatException e) {
- port = 8443;
+ port = DEFAULT_HTTPS_PORT;
}
}