From 635fe997f91dbec1cf8ab0b7aeb8c76c56330013 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Tue, 23 Sep 2008 23:44:47 +0000 Subject: Starting to fix jetty OSGi import/exports. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@698404 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca-equinox/distribution/features/all/pom.xml | 6 -- .../distribution/features/ejava/pom.xml | 2 + .../modules/binding-atom-abdera/pom.xml | 5 +- branches/sca-equinox/modules/binding-atom/pom.xml | 3 +- branches/sca-equinox/modules/host-jetty/pom.xml | 4 +- .../http/jetty/JettyRuntimeModuleActivator.java | 76 +++++++++++++++++++++ .../jetty/module/JettyRuntimeModuleActivator.java | 77 ---------------------- .../org.apache.tuscany.sca.core.ModuleActivator | 2 +- .../sca/node/equinox/launcher/EquinoxHost.java | 2 +- .../sca-equinox/modules/policy-transaction/pom.xml | 2 +- branches/sca-equinox/modules/pom.xml | 4 ++ 11 files changed, 93 insertions(+), 90 deletions(-) create mode 100644 branches/sca-equinox/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java delete mode 100644 branches/sca-equinox/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/module/JettyRuntimeModuleActivator.java diff --git a/branches/sca-equinox/distribution/features/all/pom.xml b/branches/sca-equinox/distribution/features/all/pom.xml index f70bb16bf0..f88efa792e 100644 --- a/branches/sca-equinox/distribution/features/all/pom.xml +++ b/branches/sca-equinox/distribution/features/all/pom.xml @@ -98,12 +98,6 @@ 1.4-SNAPSHOT - - org.apache.tuscany.sca - tuscany-implementation-das - 1.4-SNAPSHOT - - org.apache.tuscany.sca tuscany-tracing-aspectj diff --git a/branches/sca-equinox/distribution/features/ejava/pom.xml b/branches/sca-equinox/distribution/features/ejava/pom.xml index 85fe239a11..abdc08f435 100644 --- a/branches/sca-equinox/distribution/features/ejava/pom.xml +++ b/branches/sca-equinox/distribution/features/ejava/pom.xml @@ -68,6 +68,7 @@ tuscany-host-corba-jee 1.4-SNAPSHOT + diff --git a/branches/sca-equinox/modules/binding-atom-abdera/pom.xml b/branches/sca-equinox/modules/binding-atom-abdera/pom.xml index 4b922be0a7..42a484bde6 100644 --- a/branches/sca-equinox/modules/binding-atom-abdera/pom.xml +++ b/branches/sca-equinox/modules/binding-atom-abdera/pom.xml @@ -206,7 +206,10 @@ ${tuscany.version} org.apache.tuscany.sca.binding.atom.abdera ${pom.name} - org.apache.tuscany.sca.binding.atom* + + org.apache.tuscany.sca.binding.atom.collection, + org.apache.tuscany.sca.binding.atom.provider + diff --git a/branches/sca-equinox/modules/binding-atom/pom.xml b/branches/sca-equinox/modules/binding-atom/pom.xml index 388f203e1d..8c8aad875a 100644 --- a/branches/sca-equinox/modules/binding-atom/pom.xml +++ b/branches/sca-equinox/modules/binding-atom/pom.xml @@ -71,8 +71,7 @@ ${tuscany.version} org.apache.tuscany.sca.binding.atom ${pom.name} - org.apache.tuscany.sca.binding.atom* - org.apache.tuscany.sca.assembly.xml;version="1.4", * + org.apache.tuscany.sca.binding.atom diff --git a/branches/sca-equinox/modules/host-jetty/pom.xml b/branches/sca-equinox/modules/host-jetty/pom.xml index 736a6f8dde..ee76b73ab4 100644 --- a/branches/sca-equinox/modules/host-jetty/pom.xml +++ b/branches/sca-equinox/modules/host-jetty/pom.xml @@ -66,7 +66,9 @@ ${tuscany.version} org.apache.tuscany.sca.host.jetty ${pom.name} - org.apache.tuscany.sca.http.jetty* + + org.apache.tuscany.sca.http.jetty, + org.mortbay.jetty;version="6.1.7", org.mortbay.jetty.handler;version="6.1.7", diff --git a/branches/sca-equinox/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java b/branches/sca-equinox/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java new file mode 100644 index 0000000000..31c8397f8b --- /dev/null +++ b/branches/sca-equinox/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java @@ -0,0 +1,76 @@ +/* + * 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.http.jetty; + +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.logging.Level; +import java.util.logging.Logger; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.ModuleActivator; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint; +import org.apache.tuscany.sca.work.WorkScheduler; + +/** + * @version $Rev$ $Date$ + */ +public class JettyRuntimeModuleActivator implements ModuleActivator { + private static final Logger logger = Logger.getLogger(JettyRuntimeModuleActivator.class.getName()); + + private JettyServer server; + + public void start(ExtensionPointRegistry extensionPointRegistry) { + + // Register a Jetty Servlet host + ServletHostExtensionPoint servletHosts = + extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class); + + if (servletHosts.getServletHosts().size() < 1) { + UtilityExtensionPoint utilities = extensionPointRegistry.getExtensionPoint(UtilityExtensionPoint.class); + final WorkScheduler workScheduler = utilities.getUtility(WorkScheduler.class); + // Allow privileged access to start MBeans. Requires MBeanPermission in security policy. + try { + server = AccessController.doPrivileged(new PrivilegedAction() { + public JettyServer run() { + return new JettyServer(workScheduler); + } + }); + servletHosts.addServletHost(server); + } catch (Exception e) { + logger.log(Level.WARNING, "Exception creating JettyServer", e); + } + } + } + + public void stop(ExtensionPointRegistry registry) { + // Allow privileged access to stop MBeans. Requires MBeanPermission in security policy. + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + if (server != null) { + server.stop(); + } + return null; + } + }); + } + +} diff --git a/branches/sca-equinox/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/module/JettyRuntimeModuleActivator.java b/branches/sca-equinox/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/module/JettyRuntimeModuleActivator.java deleted file mode 100644 index 884c8a4cce..0000000000 --- a/branches/sca-equinox/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/module/JettyRuntimeModuleActivator.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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.http.jetty.module; - -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.ModuleActivator; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint; -import org.apache.tuscany.sca.http.jetty.JettyServer; -import org.apache.tuscany.sca.work.WorkScheduler; - -/** - * @version $Rev$ $Date$ - */ -public class JettyRuntimeModuleActivator implements ModuleActivator { - private static final Logger logger = Logger.getLogger(JettyRuntimeModuleActivator.class.getName()); - - private JettyServer server; - - public void start(ExtensionPointRegistry extensionPointRegistry) { - - // Register a Jetty Servlet host - ServletHostExtensionPoint servletHosts = - extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class); - - if (servletHosts.getServletHosts().size() < 1) { - UtilityExtensionPoint utilities = extensionPointRegistry.getExtensionPoint(UtilityExtensionPoint.class); - final WorkScheduler workScheduler = utilities.getUtility(WorkScheduler.class); - // Allow privileged access to start MBeans. Requires MBeanPermission in security policy. - try { - server = AccessController.doPrivileged(new PrivilegedAction() { - public JettyServer run() { - return new JettyServer(workScheduler); - } - }); - servletHosts.addServletHost(server); - } catch (Exception e) { - logger.log(Level.WARNING, "Exception creating JettyServer", e); - } - } - } - - public void stop(ExtensionPointRegistry registry) { - // Allow privileged access to stop MBeans. Requires MBeanPermission in security policy. - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - if (server != null) { - server.stop(); - } - return null; - } - }); - } - -} diff --git a/branches/sca-equinox/modules/host-jetty/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-equinox/modules/host-jetty/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator index f61708de90..e826f5a496 100644 --- a/branches/sca-equinox/modules/host-jetty/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ b/branches/sca-equinox/modules/host-jetty/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. # Implementation class for the ModuleActivator -org.apache.tuscany.sca.http.jetty.module.JettyRuntimeModuleActivator +org.apache.tuscany.sca.http.jetty.JettyRuntimeModuleActivator diff --git a/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java b/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java index 7cbcdab693..f47a088c52 100644 --- a/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java +++ b/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java @@ -272,7 +272,7 @@ public class EquinoxHost { if ((bundle.getState() & Bundle.ACTIVE) == 0) { logger.info("Starting bundle: " + string(bundle, false)); try { - bundle.start(); + //bundle.start(); } catch (Exception e) { logger.log(Level.SEVERE, e.getMessage(), e); throw e; diff --git a/branches/sca-equinox/modules/policy-transaction/pom.xml b/branches/sca-equinox/modules/policy-transaction/pom.xml index 638674660b..1376ead3c3 100644 --- a/branches/sca-equinox/modules/policy-transaction/pom.xml +++ b/branches/sca-equinox/modules/policy-transaction/pom.xml @@ -73,7 +73,7 @@ ${tuscany.version} org.apache.tuscany.sca.policy.transaction ${pom.name} - org.apache.tuscany.sca.policy.transaction* + org.apache.tuscany.sca.policy.transaction javax.transaction;version="1.0.1",* diff --git a/branches/sca-equinox/modules/pom.xml b/branches/sca-equinox/modules/pom.xml index 9b24679b5b..2ee9c9c9c2 100644 --- a/branches/sca-equinox/modules/pom.xml +++ b/branches/sca-equinox/modules/pom.xml @@ -102,11 +102,15 @@ host-corba-jee host-corba-jse host-corba-jse-tns + host-embedded host-http host-jetty + host-rmi