From 19ad394d57d2c63b250c5f1ed21c444a24b3f883 Mon Sep 17 00:00:00 2001 From: antelder Date: Wed, 13 Aug 2008 08:34:03 +0000 Subject: TUSCANY-2391: apply standalone_node_modified patch from Thilina to support Standalone nodes can be run in the Geronimo ACE git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@685477 13f79535-47bb-0310-9956-ffa450edef68 --- sandbox/thilina/geronimo_ACE/pom.xml | 48 ++++++++++ .../apache/tuscany/geronimoace/GeronimoACE.java | 21 ++++- .../src/main/webapp/WEB-INF/geronimo-web.xml | 101 +++++++++++---------- .../src/main/webapp/pages/Standalone.jsp | 10 +- 4 files changed, 126 insertions(+), 54 deletions(-) (limited to 'sandbox/thilina') diff --git a/sandbox/thilina/geronimo_ACE/pom.xml b/sandbox/thilina/geronimo_ACE/pom.xml index 54e2a02a36..2ee343dffd 100644 --- a/sandbox/thilina/geronimo_ACE/pom.xml +++ b/sandbox/thilina/geronimo_ACE/pom.xml @@ -26,7 +26,55 @@ 1.0-SNAPSHOT geronimo-ace http://maven.apache.org + + + apache.snapshots + Apache SNAPSHOT Repository + http://people.apache.org/repo/m2-snapshot-repository + + false + + + true + + + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.4-SNAPSHOT + compile + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.4-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.4-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.4-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-node2-impl + 1.4-SNAPSHOT + + junit junit diff --git a/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java b/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java index 219420c000..4808434c2d 100644 --- a/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java +++ b/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java @@ -19,6 +19,11 @@ package org.apache.tuscany.geronimoace; +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; + import javax.portlet.*; import java.io.IOException; @@ -31,14 +36,24 @@ public class GeronimoACE extends GenericPortlet { super.init(config); } - public void manageStandaloneNode(String loc){ - System.out.println("location :" + loc); + public void manageStandaloneNode(String loc, String nodeName, String composite){ + + SCANode2Factory factory = org.apache.tuscany.sca.node.SCANode2Factory.newInstance(); + + SCAContribution contribution = new SCAContribution(nodeName, "file:"+loc); + SCANode2 node = factory.createSCANode(composite, new SCAContribution[] {contribution}); + node.start(); + } public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { isHome = true; String task = request.getParameter("task"); // getting request parameters task and domain name String location = request.getParameter("contributionLocation"); + String nodeName = request.getParameter("nodeName"); + String composite = request.getParameter("composite"); + + if (task != null) { if (task.equals("composites")) { // if the request is for Composites,forwarding to Composites.html viewUrl = "/pages/Composite.jsp"; @@ -57,7 +72,7 @@ public class GeronimoACE extends GenericPortlet { } } if (location != null){ - manageStandaloneNode(location); + manageStandaloneNode(location, nodeName, composite); } response.setPortletMode(PortletMode.VIEW); // by changing portlet mode, doview methos is called again. diff --git a/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml b/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml index 376fe17d75..bfb6edd2c6 100644 --- a/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml +++ b/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml @@ -1,50 +1,51 @@ - - - - - - - org.apache.tuscany.geronimoace - geronimo-ace - 1.0-SNAPSHOT - war - - - - - org.apache.geronimo.plugins - pluto-support - - - - - - /GeronimoACE - - - - Tuscany ACE - /GeronimoACE - [GeronimoACE] - - PlutoPortalServices - - - + + + + + + + org.apache.tuscany.geronimoace + geronimo-ace + 1.0-SNAPSHOT + war + + + + + org.apache.geronimo.plugins + pluto-support + + + + + + + /GeronimoACE + + + + Tuscany ACE + /GeronimoACE + [GeronimoACE] + + PlutoPortalServices + + + diff --git a/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp index 6e8ec83af8..120d7583eb 100644 --- a/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp +++ b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp @@ -6,9 +6,17 @@
- + + + + + + + + +
Location:Contribution Location :
Name of the node :
Composite :
-- cgit v1.2.3