Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 78674179FA for ; Tue, 17 Feb 2015 07:45:36 +0000 (UTC) Received: (qmail 27418 invoked by uid 500); 17 Feb 2015 07:45:30 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 27368 invoked by uid 500); 17 Feb 2015 07:45:30 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 27359 invoked by uid 99); 17 Feb 2015 07:45:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2015 07:45:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AF86BE03E9; Tue, 17 Feb 2015 07:45:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Message-Id: <8f8fe05f442645e1bd13ea87aaed695c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: camel git commit: CAMEL-4232: Make camel-core-osgi a separate bundle and move out from camel-spring. Need to do the same for camel-blueprint. Remove not used old spring osgi namespace, and removed not used classes. Date: Tue, 17 Feb 2015 07:45:29 +0000 (UTC) Repository: camel Updated Branches: refs/heads/CAMEL-4232 [created] 95dcb38f7 CAMEL-4232: Make camel-core-osgi a separate bundle and move out from camel-spring. Need to do the same for camel-blueprint. Remove not used old spring osgi namespace, and removed not used classes. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/95dcb38f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/95dcb38f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/95dcb38f Branch: refs/heads/CAMEL-4232 Commit: 95dcb38f71910458553fe9a97823eddd9092cb07 Parents: 21795ee Author: Claus Ibsen Authored: Tue Feb 17 08:46:01 2015 +0100 Committer: Claus Ibsen Committed: Tue Feb 17 08:46:01 2015 +0100 ---------------------------------------------------------------------- components/camel-spring/pom.xml | 21 ++---- .../java/org/apache/camel/osgi/Activator.java | 45 ------------ .../apache/camel/osgi/CamelContextFactory.java | 66 ----------------- .../camel/osgi/CamelContextFactoryBean.java | 74 -------------------- .../camel/osgi/CamelNamespaceHandler.java | 45 ------------ .../camel/osgi/OsgiSpringCamelContext.java | 64 ----------------- .../camel/osgi/SpringCamelContextFactory.java | 36 ---------- .../org/apache/camel/osgi/package-info.java | 18 ----- .../src/main/resources/META-INF/spring.handlers | 1 - .../src/main/resources/META-INF/spring.schemas | 61 ++-------------- .../src/main/resources/camel-osgi.xsd | 38 ---------- .../resources/org/apache/camel/osgi/jaxb.index | 17 ----- .../org/apache/camel/osgi/camelContext.xml | 28 -------- .../apache/camel/spring/osgi/camelContext.xml | 28 ++++++++ .../features/src/main/resources/features.xml | 2 + .../itest/osgi/OSGiIntegrationTestSupport.java | 9 +-- ...ogRouteWithLoggersPresentInRegistryTest.java | 24 +++---- .../log/LogRouteWithNonDefaultLoggerTest.java | 20 +++--- 18 files changed, 63 insertions(+), 534 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/pom.xml ---------------------------------------------------------------------- diff --git a/components/camel-spring/pom.xml b/components/camel-spring/pom.xml index ac0a76b..abc4c10 100644 --- a/components/camel-spring/pom.xml +++ b/components/camel-spring/pom.xml @@ -32,7 +32,6 @@ !org.apache.camel.spring.*, - !org.apache.camel.osgi.*, !org.apache.camel.component, !org.apache.camel.component.event, !org.apache.camel.language.spel, @@ -45,22 +44,17 @@ org.apache.camel.spring.*;${camel.osgi.version}, - org.apache.camel.osgi.*;${camel.osgi.version}, org.apache.camel.util.spring.*;${camel.osgi.version}, org.apache.camel.component.event;${camel.osgi.split.pkg};${camel.osgi.version}, org.apache.camel.language.spel;${camel.osgi.split.pkg};${camel.osgi.version} - org.apache.camel.core.osgi*, org.apache.camel.core.xml* org.apache.camel.spi.ComponentResolver;component=spring-event, org.apache.camel.spi.LanguageResolver;language=spel - - org.apache.camel.osgi.Activator - @@ -74,6 +68,13 @@ org.apache.camel camel-core-xml provided + true + + + org.apache.camel + camel-core-osgi + provided + true org.springframework @@ -88,12 +89,6 @@ spring-tx - org.apache.camel - camel-core-osgi - provided - true - - org.osgi org.osgi.core provided @@ -321,7 +316,6 @@ Including source code from camel-core-xml in the camel-spring-sources.jar - @@ -349,7 +343,6 @@ - org.codehaus.mojo build-helper-maven-plugin http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/main/java/org/apache/camel/osgi/Activator.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/java/org/apache/camel/osgi/Activator.java b/components/camel-spring/src/main/java/org/apache/camel/osgi/Activator.java deleted file mode 100644 index c8b6aaa..0000000 --- a/components/camel-spring/src/main/java/org/apache/camel/osgi/Activator.java +++ /dev/null @@ -1,45 +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.camel.osgi; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - private static Bundle bundle; - - public static Bundle getBundle() { - return bundle; - } - - public static BundleContext getBundleContext() { - return context; - } - - public void start(BundleContext context) throws Exception { - Activator.context = context; - Activator.bundle = context.getBundle(); - } - - public void stop(BundleContext context) throws Exception { - Activator.context = null; - Activator.bundle = null; - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelContextFactory.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelContextFactory.java b/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelContextFactory.java deleted file mode 100644 index 7989bd9..0000000 --- a/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelContextFactory.java +++ /dev/null @@ -1,66 +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.camel.osgi; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.impl.DefaultCamelContext; -import org.apache.camel.spi.Registry; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.osgi.context.BundleContextAware; - -/** - * This factory just create a DefaultContext in OSGi without - * any spring application context involved. - */ -public class CamelContextFactory implements BundleContextAware { - private static final Logger LOG = LoggerFactory.getLogger(CamelContextFactory.class); - private BundleContext bundleContext; - private Registry registry; - - public BundleContext getBundleContext() { - return bundleContext; - } - - public void setBundleContext(BundleContext bundleContext) { - LOG.debug("Using BundleContext: {}", bundleContext); - this.bundleContext = bundleContext; - } - - public Registry getRegistry() { - return registry; - } - - public void setRegistry(Registry registry) { - LOG.debug("Using Registry: {}", registry); - this.registry = registry; - } - - protected DefaultCamelContext newCamelContext() { - if (registry != null) { - return new OsgiDefaultCamelContext(bundleContext, registry); - } else { - return new OsgiDefaultCamelContext(bundleContext); - } - } - - public DefaultCamelContext createContext() { - return newCamelContext(); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelContextFactoryBean.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelContextFactoryBean.java b/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelContextFactoryBean.java deleted file mode 100644 index 068fc93..0000000 --- a/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelContextFactoryBean.java +++ /dev/null @@ -1,74 +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.camel.osgi; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; - -import org.apache.camel.core.osgi.OsgiCamelContextPublisher; -import org.apache.camel.core.osgi.OsgiEventAdminNotifier; -import org.apache.camel.spring.SpringCamelContext; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.osgi.context.BundleContextAware; - -@XmlRootElement(name = "camelContext") -@XmlAccessorType(XmlAccessType.FIELD) -public class CamelContextFactoryBean extends org.apache.camel.spring.CamelContextFactoryBean implements BundleContextAware { - private static final Logger LOG = LoggerFactory.getLogger(CamelContextFactoryBean.class); - - @XmlTransient - private BundleContext bundleContext; - - public BundleContext getBundleContext() { - return bundleContext; - } - - public void setBundleContext(BundleContext bundleContext) { - LOG.debug("Using BundleContext: {}", bundleContext); - this.bundleContext = bundleContext; - } - - protected SpringCamelContext createContext() { - SpringCamelContext ctx = newCamelContext(); - // only set the name if its explicit (Camel will auto assign name if none explicit set) - if (!isImplicitId()) { - ctx.setName(getId()); - } - return ctx; - } - - protected SpringCamelContext newCamelContext() { - return new OsgiSpringCamelContext(getApplicationContext(), getBundleContext()); - } - - @Override - public void afterPropertiesSet() throws Exception { - super.afterPropertiesSet(); - getContext().getManagementStrategy().addEventNotifier(new OsgiCamelContextPublisher(bundleContext)); - try { - getClass().getClassLoader().loadClass("org.osgi.service.event.EventAdmin"); - getContext().getManagementStrategy().addEventNotifier(new OsgiEventAdminNotifier(bundleContext)); - } catch (Throwable t) { - // Ignore, if the EventAdmin package is not available, just don't use it - LOG.debug("EventAdmin package is not available, just don't use it"); - } - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelNamespaceHandler.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelNamespaceHandler.java b/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelNamespaceHandler.java deleted file mode 100644 index 41fcf6c..0000000 --- a/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelNamespaceHandler.java +++ /dev/null @@ -1,45 +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.camel.osgi; - -import java.util.HashSet; -import java.util.Set; - -public class CamelNamespaceHandler extends org.apache.camel.spring.handler.CamelNamespaceHandler { - - public void init() { - super.init(); - registerParser("camelContext", new CamelContextBeanDefinitionParser(CamelContextFactoryBean.class)); - } - - // It just add the package of the class for initiate the JAXB context - protected Set> getJaxbPackages() { - Set> classes = new HashSet>(); - classes.add(CamelContextFactoryBean.class); - classes.add(org.apache.camel.spring.CamelContextFactoryBean.class); - classes.add(org.apache.camel.ExchangePattern.class); - classes.add(org.apache.camel.model.RouteDefinition.class); - classes.add(org.apache.camel.model.config.StreamResequencerConfig.class); - classes.add(org.apache.camel.model.dataformat.DataFormatsDefinition.class); - classes.add(org.apache.camel.model.language.ExpressionDefinition.class); - classes.add(org.apache.camel.model.loadbalancer.RoundRobinLoadBalancerDefinition.class); - classes.add(org.apache.camel.model.rest.RestDefinition.class); - return classes; - } - - -} http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/main/java/org/apache/camel/osgi/OsgiSpringCamelContext.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/java/org/apache/camel/osgi/OsgiSpringCamelContext.java b/components/camel-spring/src/main/java/org/apache/camel/osgi/OsgiSpringCamelContext.java deleted file mode 100644 index 5355586..0000000 --- a/components/camel-spring/src/main/java/org/apache/camel/osgi/OsgiSpringCamelContext.java +++ /dev/null @@ -1,64 +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.camel.osgi; - -import org.apache.camel.TypeConverter; -import org.apache.camel.core.osgi.OsgiCamelContextHelper; -import org.apache.camel.core.osgi.OsgiFactoryFinderResolver; -import org.apache.camel.core.osgi.OsgiTypeConverter; -import org.apache.camel.core.osgi.utils.BundleContextUtils; -import org.apache.camel.spi.FactoryFinder; -import org.apache.camel.spi.Registry; -import org.apache.camel.spring.SpringCamelContext; -import org.osgi.framework.BundleContext; -import org.springframework.context.ApplicationContext; - -public class OsgiSpringCamelContext extends SpringCamelContext { - - private final BundleContext bundleContext; - - public OsgiSpringCamelContext(ApplicationContext applicationContext, BundleContext bundleContext) { - super(applicationContext); - this.bundleContext = bundleContext; - OsgiCamelContextHelper.osgiUpdate(this, bundleContext); - } - - @Override - protected TypeConverter createTypeConverter() { - // CAMEL-3614: make sure we use a bundle context which imports org.apache.camel.impl.converter package - BundleContext ctx = BundleContextUtils.getBundleContext(getClass()); - if (ctx == null) { - ctx = bundleContext; - } - FactoryFinder finder = new OsgiFactoryFinderResolver(bundleContext).resolveDefaultFactoryFinder(getClassResolver()); - return new OsgiTypeConverter(ctx, getInjector(), finder); - } - - @Override - protected Registry createRegistry() { - return OsgiCamelContextHelper.wrapRegistry(this, super.createRegistry(), bundleContext); - } - - @Override - public void setName(String name) { - super.setName(name); - // in OSGi prefix the bundle id to the management name so it will be unique in the JVM - // and also nicely sorted based on bundle id - super.setManagementName(bundleContext.getBundle().getBundleId() + "-" + name); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/main/java/org/apache/camel/osgi/SpringCamelContextFactory.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/java/org/apache/camel/osgi/SpringCamelContextFactory.java b/components/camel-spring/src/main/java/org/apache/camel/osgi/SpringCamelContextFactory.java deleted file mode 100644 index 8896edf..0000000 --- a/components/camel-spring/src/main/java/org/apache/camel/osgi/SpringCamelContextFactory.java +++ /dev/null @@ -1,36 +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.camel.osgi; - -import org.apache.camel.impl.DefaultCamelContext; -import org.apache.camel.spring.SpringCamelContext; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; - -public class SpringCamelContextFactory extends CamelContextFactory implements ApplicationContextAware { - private ApplicationContext applicationContext; - - public void setApplicationContext(ApplicationContext context) { - this.applicationContext = context; - } - - @Override - protected DefaultCamelContext newCamelContext() { - return new SpringCamelContext(applicationContext); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/main/java/org/apache/camel/osgi/package-info.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/java/org/apache/camel/osgi/package-info.java b/components/camel-spring/src/main/java/org/apache/camel/osgi/package-info.java deleted file mode 100644 index cc4aaf5..0000000 --- a/components/camel-spring/src/main/java/org/apache/camel/osgi/package-info.java +++ /dev/null @@ -1,18 +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. - */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://camel.apache.org/schema/osgi", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.apache.camel.osgi; http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/main/resources/META-INF/spring.handlers ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/resources/META-INF/spring.handlers b/components/camel-spring/src/main/resources/META-INF/spring.handlers index 36c60d3..285f296 100644 --- a/components/camel-spring/src/main/resources/META-INF/spring.handlers +++ b/components/camel-spring/src/main/resources/META-INF/spring.handlers @@ -17,4 +17,3 @@ http\://camel.apache.org/schema/spring=org.apache.camel.spring.handler.CamelNamespaceHandler http\://camel.apache.org/schema/spring/v${camel.schema.version}=org.apache.camel.spring.handler.CamelNamespaceHandler -http\://camel.apache.org/schema/osgi=org.apache.camel.osgi.CamelNamespaceHandler http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/main/resources/META-INF/spring.schemas ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/resources/META-INF/spring.schemas b/components/camel-spring/src/main/resources/META-INF/spring.schemas index 82515f4..b182ead 100644 --- a/components/camel-spring/src/main/resources/META-INF/spring.schemas +++ b/components/camel-spring/src/main/resources/META-INF/spring.schemas @@ -72,61 +72,8 @@ http\://camel.apache.org/schema/spring/camel-spring-2.12.4.xsd=camel-spring.xsd http\://camel.apache.org/schema/spring/camel-spring-2.13.0.xsd=camel-spring.xsd http\://camel.apache.org/schema/spring/camel-spring-2.13.1.xsd=camel-spring.xsd http\://camel.apache.org/schema/spring/camel-spring-2.13.2.xsd=camel-spring.xsd -http\://camel.apache.org/schema/spring/camel-spring-${project.version}.xsd=camel-spring.xsd - -http\://camel.apache.org/schema/osgi/camel-osgi.xsd=camel-osgi.xsd +http\://camel.apache.org/schema/spring/camel-spring-2.13.3.xsd=camel-spring.xsd +http\://camel.apache.org/schema/spring/camel-spring-2.14.0.xsd=camel-spring.xsd +http\://camel.apache.org/schema/spring/camel-spring-2.14.1.xsd=camel-spring.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.0-M1.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.0-M2.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.0-M3.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.0.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.1.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.2.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.3.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.4.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.5.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.6.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.7.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.7.1.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.7.2.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.7.3.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.7.4.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.7.5.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.8.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.8.1.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.8.2.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.8.3.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.8.4.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.8.5.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.8.6.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.9.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.9.1.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.9.2.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.9.3.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.9.4.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.9.5.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.9.6.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.9.7.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.9.8.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.10.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.10.1.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.10.2.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.10.3.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.10.4.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.10.5.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.10.6.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.10.7.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.11.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.11.1.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.11.2.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.11.3.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.11.4.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.12.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.12.1.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.12.2.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.12.3.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.12.4.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.13.0.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.13.1.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-2.13.2.xsd=camel-osgi.xsd -http\://camel.apache.org/schema/osgi/camel-osgi-${project.version}.xsd=camel-osgi.xsd +http\://camel.apache.org/schema/spring/camel-spring-${project.version}.xsd=camel-spring.xsd http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/main/resources/camel-osgi.xsd ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/resources/camel-osgi.xsd b/components/camel-spring/src/main/resources/camel-osgi.xsd deleted file mode 100644 index bb44dd9..0000000 --- a/components/camel-spring/src/main/resources/camel-osgi.xsd +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/main/resources/org/apache/camel/osgi/jaxb.index ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/resources/org/apache/camel/osgi/jaxb.index b/components/camel-spring/src/main/resources/org/apache/camel/osgi/jaxb.index deleted file mode 100644 index 18674e4..0000000 --- a/components/camel-spring/src/main/resources/org/apache/camel/osgi/jaxb.index +++ /dev/null @@ -1,17 +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. -## ------------------------------------------------------------------------ -CamelContextFactoryBean http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/test/resources/org/apache/camel/osgi/camelContext.xml ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/resources/org/apache/camel/osgi/camelContext.xml b/components/camel-spring/src/test/resources/org/apache/camel/osgi/camelContext.xml deleted file mode 100644 index 69b3f71..0000000 --- a/components/camel-spring/src/test/resources/org/apache/camel/osgi/camelContext.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/components/camel-spring/src/test/resources/org/apache/camel/spring/osgi/camelContext.xml ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/osgi/camelContext.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/osgi/camelContext.xml new file mode 100644 index 0000000..69b3f71 --- /dev/null +++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/osgi/camelContext.xml @@ -0,0 +1,28 @@ + + + + + + + http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/platforms/karaf/features/src/main/resources/features.xml ---------------------------------------------------------------------- diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml index 3b2ae3a..b8ed784 100644 --- a/platforms/karaf/features/src/main/resources/features.xml +++ b/platforms/karaf/features/src/main/resources/features.xml @@ -45,6 +45,8 @@ spring-dm spring-tx camel-core + eventadmin + mvn:org.apache.camel/camel-core-osgi/${project.version} mvn:org.apache.camel/camel-spring/${project.version} http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java index 50d351b..c0147d1 100644 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java @@ -15,17 +15,17 @@ * limitations under the License. */ package org.apache.camel.itest.osgi; + import java.io.File; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.Properties; import java.util.concurrent.atomic.AtomicInteger; - import javax.inject.Inject; import org.apache.camel.CamelContext; -import org.apache.camel.osgi.CamelContextFactory; +import org.apache.camel.core.osgi.OsgiDefaultCamelContext; import org.apache.camel.test.junit4.CamelTestSupport; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; @@ -67,10 +67,7 @@ public class OSGiIntegrationTestSupport extends CamelTestSupport { setThreadContextClassLoader(); - CamelContextFactory factory = new CamelContextFactory(); - factory.setBundleContext(bundleContext); - factory.setRegistry(createRegistry()); - return factory.createContext(); + return new OsgiDefaultCamelContext(bundleContext, createRegistry()); } protected void setThreadContextClassLoader() { http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithLoggersPresentInRegistryTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithLoggersPresentInRegistryTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithLoggersPresentInRegistryTest.java index 7de66a7..1da5417 100644 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithLoggersPresentInRegistryTest.java +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithLoggersPresentInRegistryTest.java @@ -19,13 +19,10 @@ package org.apache.camel.itest.osgi.core.log; import java.io.File; import org.apache.camel.CamelContext; -import org.apache.camel.impl.SimpleRegistry; +import org.apache.camel.impl.JndiRegistry; import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.apache.camel.osgi.CamelContextFactory; - import org.junit.Test; import org.junit.runner.RunWith; - import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; @@ -72,20 +69,19 @@ public class LogRouteWithLoggersPresentInRegistryTest extends OSGiIntegrationTes LOG.info("Get the bundleContext is {}", bundleContext); LOG.info("Application installed as bundle id: {}", bundleContext.getBundle().getBundleId()); - setThreadContextClassLoader(); - - CamelContextFactory factory = new CamelContextFactory(); - factory.setBundleContext(bundleContext); - SimpleRegistry registry = new SimpleRegistry(); - registry.put("mylogger1", LoggerFactory.getLogger("org.apache.camel.SIFT.l1")); - registry.put("mylogger2", LoggerFactory.getLogger("org.apache.camel.SIFT.l2")); - factory.setRegistry(registry); - CamelContext camelContext = factory.createContext(); - camelContext.setApplicationContextClassLoader(getClass().getClassLoader()); + CamelContext camelContext = super.createCamelContext(); camelContext.setUseMDCLogging(true); return camelContext; } + @Override + protected JndiRegistry createRegistry() throws Exception { + JndiRegistry registry = new JndiRegistry(); + registry.bind("mylogger1", LoggerFactory.getLogger("org.apache.camel.SIFT.l1")); + registry.bind("mylogger2", LoggerFactory.getLogger("org.apache.camel.SIFT.l2")); + return registry; + } + @Configuration public static Option[] configure() throws Exception { return combine( http://git-wip-us.apache.org/repos/asf/camel/blob/95dcb38f/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithNonDefaultLoggerTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithNonDefaultLoggerTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithNonDefaultLoggerTest.java index 0c61013..e8d7197 100644 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithNonDefaultLoggerTest.java +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithNonDefaultLoggerTest.java @@ -19,9 +19,8 @@ package org.apache.camel.itest.osgi.core.log; import java.io.File; import org.apache.camel.CamelContext; -import org.apache.camel.impl.SimpleRegistry; +import org.apache.camel.impl.JndiRegistry; import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.apache.camel.osgi.CamelContextFactory; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; @@ -70,19 +69,18 @@ public class LogRouteWithNonDefaultLoggerTest extends OSGiIntegrationTestSupport LOG.info("Get the bundleContext is {}", bundleContext); LOG.info("Application installed as bundle id: {}", bundleContext.getBundle().getBundleId()); - setThreadContextClassLoader(); - - CamelContextFactory factory = new CamelContextFactory(); - factory.setBundleContext(bundleContext); - SimpleRegistry registry = new SimpleRegistry(); - registry.put("mylogger", LoggerFactory.getLogger("org.apache.camel.SIFT")); - factory.setRegistry(registry); - CamelContext camelContext = factory.createContext(); - camelContext.setApplicationContextClassLoader(getClass().getClassLoader()); + CamelContext camelContext = super.createCamelContext(); camelContext.setUseMDCLogging(true); return camelContext; } + @Override + protected JndiRegistry createRegistry() throws Exception { + JndiRegistry registry = new JndiRegistry(); + registry.bind("mylogger", LoggerFactory.getLogger("org.apache.camel.SIFT")); + return registry; + } + @Configuration public static Option[] configure() throws Exception { return combine(