diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-24 07:42:36 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-24 07:42:36 +0000 |
commit | 3aaf8c95de13c405a50568dd635382197fb657fd (patch) | |
tree | 85bd8e89b95f2aa367cfa1e551cf379aa64c3438 /branches/sca-java-1.x | |
parent | 795d14f2ec2c73c674c08d78d5e8c0333ffaa9b3 (diff) |
Update scadomain to support passing in the default port in the domain uri
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@757678 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
3 files changed, 26 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/modules/host-embedded/pom.xml b/branches/sca-java-1.x/modules/host-embedded/pom.xml index 47322d76ab..c3699ae1d5 100644 --- a/branches/sca-java-1.x/modules/host-embedded/pom.xml +++ b/branches/sca-java-1.x/modules/host-embedded/pom.xml @@ -100,6 +100,12 @@ <version>1.5-SNAPSHOT</version> <scope>runtime</scope> </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-http</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>compile</scope> + </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> diff --git a/branches/sca-java-1.x/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/DefaultSCADomain.java b/branches/sca-java-1.x/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/DefaultSCADomain.java index b76a248f5a..080a60f575 100644 --- a/branches/sca-java-1.x/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/DefaultSCADomain.java +++ b/branches/sca-java-1.x/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/DefaultSCADomain.java @@ -19,6 +19,7 @@ package org.apache.tuscany.sca.host.embedded.impl; +import java.net.URI; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; @@ -41,11 +42,13 @@ import org.apache.tuscany.sca.core.assembly.RuntimeComponentImpl; import org.apache.tuscany.sca.host.embedded.SCADomain; import org.apache.tuscany.sca.host.embedded.management.ComponentListener; import org.apache.tuscany.sca.host.embedded.management.ComponentManager; +import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint; import org.apache.tuscany.sca.node.SCAClient; import org.apache.tuscany.sca.node.SCAContribution; import org.apache.tuscany.sca.node.SCANode; import org.apache.tuscany.sca.node.SCANodeFactory; import org.apache.tuscany.sca.node.impl.NodeImpl; +import org.apache.tuscany.sca.node.impl.RuntimeBootStrapper; import org.osoa.sca.CallableReference; import org.osoa.sca.ServiceReference; @@ -178,12 +181,25 @@ public class DefaultSCADomain extends SCADomain { client = (SCAClient)node; compositeActivator = ((NodeImpl)node).getCompositeActivator(); components = new HashMap<String, Component>(); + + setDefaultPort(); node.start(); getComponents(compositeActivator.getDomainComposite()); } + private void setDefaultPort() { + URI uri = URI.create(domainURI); + if (uri.getPort() > -1) { + RuntimeBootStrapper rt = ((NodeImpl)node).getRuntime(); + ServletHostExtensionPoint sh = rt.getExtensionPointRegistry().getExtensionPoint(ServletHostExtensionPoint.class); + if (sh != null && sh.getServletHosts() != null && !sh.getServletHosts().isEmpty()) { + sh.getServletHosts().get(0).setDefaultPort(uri.getPort()); + } + } + } + private void getComponents(Composite composite) { for (Component c : composite.getComponents()) { components.put(c.getName(), c); diff --git a/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java index 9ee03c2e46..4a6ac723c2 100644 --- a/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java +++ b/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java @@ -850,5 +850,9 @@ public class NodeImpl implements SCANode, SCAClient { public CompositeActivator getCompositeActivator() { return compositeActivator; } + + public RuntimeBootStrapper getRuntime() { + return runtime; + } } |