camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1405798 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/impl/osgi/ components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/ components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/ components/camel-even...
Date Mon, 05 Nov 2012 14:06:57 GMT
Author: davsclaus
Date: Mon Nov  5 14:06:56 2012
New Revision: 1405798

URL: http://svn.apache.org/viewvc?rev=1405798&view=rev
Log:
CAMEL-5745: Upgraded to Aries Blueprint 1.0.0/OSGi 4.3.0/Karaf 2.3.0

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
    camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
    camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/CamelMockBundle.java
    camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/Activator.java
    camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminConsumer.java
    camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminProducer.java
    camel/trunk/components/camel-paxlogging/src/main/java/org/apache/camel/component/paxlogging/Activator.java
    camel/trunk/components/camel-paxlogging/src/main/java/org/apache/camel/component/paxlogging/PaxLoggingConsumer.java
    camel/trunk/components/camel-test-blueprint/pom.xml
    camel/trunk/parent/pom.xml
    camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java?rev=1405798&r1=1405797&r2=1405798&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java Mon Nov
 5 14:06:56 2012
@@ -291,7 +291,6 @@ public class Activator implements Bundle
                 super(null);
             }
 
-            @SuppressWarnings("unchecked")
             public void load(TypeConverterRegistry registry) throws TypeConverterLoaderException
{
                 PackageScanFilter test = new AnnotatedWithPackageScanFilter(Converter.class,
true);
                 Set<Class<?>> classes = new LinkedHashSet<Class<?>>();
@@ -396,11 +395,11 @@ public class Activator implements Bundle
             try {
                 Properties properties = loadProperties(url);
                 String classname = (String) properties.get("class");
-                Class<T> type = bundle.loadClass(classname);
+                Class<?> type = bundle.loadClass(classname);
                 if (!this.type.isAssignableFrom(type)) {
                     throw new IllegalArgumentException("Type is not a " + this.type.getName()
+ " implementation. Found: " + type.getName());
                 }
-                return injector.newInstance(type);
+                return injector.newInstance((Class<T>) type);
             } catch (ClassNotFoundException e) {
                 throw new IllegalArgumentException("Invalid URI, no " + this.type.getName()
+ " registered for scheme : " + name, e);
             }
@@ -411,7 +410,7 @@ public class Activator implements Bundle
     protected abstract static class BaseService {
 
         protected final Bundle bundle;
-        private ServiceRegistration reg;
+        private ServiceRegistration<?> reg;
 
         protected BaseService(Bundle bundle) {
             this.bundle = bundle;
@@ -433,7 +432,7 @@ public class Activator implements Bundle
             doRegister(type, null);
         }
 
-        protected void doRegister(Class<?> type, Dictionary<?, ?> props) {
+        protected void doRegister(Class<?> type, Dictionary<String, ?> props)
{
             reg = bundle.getBundleContext().registerService(type.getName(), this, props);
         }
 

Modified: camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java?rev=1405798&r1=1405797&r2=1405798&view=diff
==============================================================================
--- camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
(original)
+++ camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
Mon Nov  5 14:06:56 2012
@@ -18,8 +18,8 @@ package org.apache.camel.core.osgi;
 
 import java.util.Dictionary;
 import java.util.EventObject;
+import java.util.Hashtable;
 import java.util.Map;
-import java.util.Properties;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.camel.CamelContext;
@@ -43,7 +43,7 @@ public class OsgiCamelContextPublisher e
     public static final String CONTEXT_NAME_PROPERTY = "camel.context.name";
 
     private final BundleContext bundleContext;
-    private final Map<CamelContext, ServiceRegistration> registrations = new ConcurrentHashMap<CamelContext,
ServiceRegistration>();
+    private final Map<CamelContext, ServiceRegistration<?>> registrations = new
ConcurrentHashMap<CamelContext, ServiceRegistration<?>>();
 
     public OsgiCamelContextPublisher(BundleContext bundleContext) {
         this.bundleContext = bundleContext;
@@ -53,18 +53,18 @@ public class OsgiCamelContextPublisher e
         if (event instanceof CamelContextStartedEvent) {
             CamelContext context = ((CamelContextStartedEvent) event).getContext();
 
-            Properties props = new Properties();
+            Dictionary<String, Object > props = new Hashtable<String, Object>();
             props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, bundleContext.getBundle().getSymbolicName());
             props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(bundleContext.getBundle()));
             props.put(CONTEXT_NAME_PROPERTY, context.getName());
 
             log.debug("Registering CamelContext [{}] of in OSGi registry", props);
 
-            ServiceRegistration reg = bundleContext.registerService(CamelContext.class.getName(),
context, props);
+            ServiceRegistration<?> reg = bundleContext.registerService(CamelContext.class.getName(),
context, props);
             registrations.put(context, reg);
         } else if (event instanceof CamelContextStoppingEvent) {
             CamelContext context = ((CamelContextStoppingEvent) event).getContext();
-            ServiceRegistration reg = registrations.get(context);
+            ServiceRegistration<?> reg = registrations.get(context);
             if (reg != null) {
                 if (log.isDebugEnabled()) {
                     log.debug("Unregistering CamelContext [{}] from OSGi registry", context.getName());

Modified: camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/CamelMockBundle.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/CamelMockBundle.java?rev=1405798&r1=1405797&r2=1405798&view=diff
==============================================================================
--- camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/CamelMockBundle.java
(original)
+++ camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/CamelMockBundle.java
Mon Nov  5 14:06:56 2012
@@ -17,6 +17,7 @@
 package org.apache.camel.core.osgi;
 
 import java.net.URL;
+import java.security.cert.X509Certificate;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.List;
@@ -103,7 +104,7 @@ public class CamelMockBundle extends Moc
     }
 
     @Override
-    public Map<?, ?> getSignerCertificates(int signersType) {
+    public Map<X509Certificate, List<X509Certificate>> getSignerCertificates(int
signersType) {
         return null;
     }
 

Modified: camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/Activator.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/Activator.java?rev=1405798&r1=1405797&r2=1405798&view=diff
==============================================================================
--- camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/Activator.java
(original)
+++ camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/Activator.java
Mon Nov  5 14:06:56 2012
@@ -16,7 +16,8 @@
  */
 package org.apache.camel.component.eventadmin;
 
-import java.util.Properties;
+import java.util.Dictionary;
+import java.util.Hashtable;
 
 import org.apache.camel.spi.ComponentResolver;
 import org.osgi.framework.BundleActivator;
@@ -29,10 +30,10 @@ import org.osgi.framework.ServiceRegistr
  */
 public class Activator implements BundleActivator {
 
-    private ServiceRegistration registration;
+    private ServiceRegistration<?> registration;
 
     public void start(BundleContext bundleContext) throws Exception {
-        Properties props = new Properties();
+        Dictionary<String, String> props = new Hashtable<String, String>();
         props.put("component", EventAdminComponent.NAME);
         registration = bundleContext.registerService(
                             ComponentResolver.class.getName(),

Modified: camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminConsumer.java?rev=1405798&r1=1405797&r2=1405798&view=diff
==============================================================================
--- camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminConsumer.java
(original)
+++ camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminConsumer.java
Mon Nov  5 14:06:56 2012
@@ -16,7 +16,8 @@
  */
 package org.apache.camel.component.eventadmin;
 
-import java.util.Properties;
+import java.util.Dictionary;
+import java.util.Hashtable;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.impl.DefaultConsumer;
@@ -31,7 +32,7 @@ public class EventAdminConsumer extends 
 
     private static final transient Logger LOG = LoggerFactory.getLogger(EventAdminConsumer.class);
     private final EventAdminEndpoint endpoint;
-    private ServiceRegistration registration;
+    private ServiceRegistration<?> registration;
     
 
     public EventAdminConsumer(EventAdminEndpoint endpoint, Processor processor) {
@@ -59,7 +60,7 @@ public class EventAdminConsumer extends 
     @Override
     protected void doStart() throws Exception {
         super.doStart();
-        Properties props = new Properties();
+        Dictionary<String, String> props = new Hashtable<String, String>();
         props.put(EventConstants.EVENT_TOPIC, endpoint.getTopic());
         registration = endpoint.getComponent().getBundleContext().registerService(EventHandler.class.getName(),
this, props);
     }

Modified: camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminProducer.java?rev=1405798&r1=1405797&r2=1405798&view=diff
==============================================================================
--- camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminProducer.java
(original)
+++ camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminProducer.java
Mon Nov  5 14:06:56 2012
@@ -89,13 +89,13 @@ public class EventAdminProducer extends 
         Event event = context.getTypeConverter().convertTo(Event.class, exchange, in.getBody());
         if (event == null) {
             String topic = getTopic(exchange);
-            Dictionary<?, ?> props = getProperties(exchange);
+            Dictionary<String, ?> props = getProperties(exchange);
             event = new Event(topic, props);
         }
         return event;
     }
 
-    protected Dictionary<?, ?> getProperties(Exchange exchange) {
+    protected Dictionary<String, ?> getProperties(Exchange exchange) {
         Message in = exchange.getIn();
         CamelContext context = endpoint.getCamelContext();
         Map<?, ?> map = context.getTypeConverter().convertTo(Map.class, exchange, in.getBody());

Modified: camel/trunk/components/camel-paxlogging/src/main/java/org/apache/camel/component/paxlogging/Activator.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-paxlogging/src/main/java/org/apache/camel/component/paxlogging/Activator.java?rev=1405798&r1=1405797&r2=1405798&view=diff
==============================================================================
--- camel/trunk/components/camel-paxlogging/src/main/java/org/apache/camel/component/paxlogging/Activator.java
(original)
+++ camel/trunk/components/camel-paxlogging/src/main/java/org/apache/camel/component/paxlogging/Activator.java
Mon Nov  5 14:06:56 2012
@@ -16,7 +16,8 @@
  */
 package org.apache.camel.component.paxlogging;
 
-import java.util.Properties;
+import java.util.Dictionary;
+import java.util.Hashtable;
 
 import org.apache.camel.spi.ComponentResolver;
 import org.osgi.framework.BundleActivator;
@@ -28,10 +29,10 @@ import org.osgi.framework.ServiceRegistr
  */
 public class Activator implements BundleActivator {
 
-    private ServiceRegistration registration;
+    private ServiceRegistration<?> registration;
 
     public void start(BundleContext bundleContext) throws Exception {
-        Properties props = new Properties();
+        Dictionary<String, String> props = new Hashtable<String, String>();
         props.put("component", PaxLoggingComponent.NAME);
         registration = bundleContext.registerService(
                             ComponentResolver.class.getName(),

Modified: camel/trunk/components/camel-paxlogging/src/main/java/org/apache/camel/component/paxlogging/PaxLoggingConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-paxlogging/src/main/java/org/apache/camel/component/paxlogging/PaxLoggingConsumer.java?rev=1405798&r1=1405797&r2=1405798&view=diff
==============================================================================
--- camel/trunk/components/camel-paxlogging/src/main/java/org/apache/camel/component/paxlogging/PaxLoggingConsumer.java
(original)
+++ camel/trunk/components/camel-paxlogging/src/main/java/org/apache/camel/component/paxlogging/PaxLoggingConsumer.java
Mon Nov  5 14:06:56 2012
@@ -16,7 +16,8 @@
  */
 package org.apache.camel.component.paxlogging;
 
-import java.util.Properties;
+import java.util.Dictionary;
+import java.util.Hashtable;
 import java.util.concurrent.ExecutorService;
 
 import org.apache.camel.Exchange;
@@ -44,7 +45,7 @@ public class PaxLoggingConsumer extends 
     private static final transient Logger LOG = LoggerFactory.getLogger(PaxLoggingConsumer.class);
     private final PaxLoggingEndpoint endpoint;
     private ExecutorService executor;
-    private ServiceRegistration registration;
+    private ServiceRegistration<?> registration;
 
     public PaxLoggingConsumer(PaxLoggingEndpoint endpoint, Processor processor) {
         super(endpoint, processor);
@@ -86,7 +87,7 @@ public class PaxLoggingConsumer extends 
     @Override
     protected void doStart() throws Exception {
         super.doStart();
-        Properties props = new Properties();
+        Dictionary<String, String> props = new Hashtable<String, String>();
         props.put("org.ops4j.pax.logging.appender.name", endpoint.getName());
         registration = endpoint.getComponent().getBundleContext().registerService(PaxAppender.class.getName(),
this, props);
         executor = endpoint.getCamelContext().getExecutorServiceManager().newSingleThreadExecutor(this,
"PaxLoggingEventTask");

Modified: camel/trunk/components/camel-test-blueprint/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test-blueprint/pom.xml?rev=1405798&r1=1405797&r2=1405798&view=diff
==============================================================================
--- camel/trunk/components/camel-test-blueprint/pom.xml (original)
+++ camel/trunk/components/camel-test-blueprint/pom.xml Mon Nov  5 14:06:56 2012
@@ -54,22 +54,22 @@
         <dependency>
             <groupId>org.apache.aries.blueprint</groupId>
             <artifactId>org.apache.aries.blueprint</artifactId>
-          <version>${aries-blueprint-test-version}</version>
+          <version>${aries-blueprint-version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.aries</groupId>
             <artifactId>org.apache.aries.util</artifactId>
-            <version>${aries-blueprint-test-version}</version>
+            <version>${aries-blueprint-version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.proxy</groupId>
             <artifactId>org.apache.aries.proxy.impl</artifactId>
-            <version>${aries-blueprint-test-version}</version>
+            <version>${aries-blueprint-version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.proxy</groupId>
             <artifactId>org.apache.aries.proxy.api</artifactId>
-            <version>${aries-blueprint-test-version}</version>
+            <version>${aries-blueprint-version}</version>
         </dependency>
         <dependency>
             <groupId>com.googlecode.pojosr</groupId>

Modified: camel/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=1405798&r1=1405797&r2=1405798&view=diff
==============================================================================
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Mon Nov  5 14:06:56 2012
@@ -44,9 +44,7 @@
     <aopalliance-bundle-version>1.0_6</aopalliance-bundle-version>
     <apacheds-version>1.5.7</apacheds-version>
     <apache-mime4j-version>0.7.2</apache-mime4j-version>
-    <aries-blueprint-version>0.3</aries-blueprint-version>
-    <!-- POJOsr does not yet work with Aries 1.0.0 -->
-    <aries-blueprint-test-version>0.3</aries-blueprint-test-version>
+    <aries-blueprint-version>1.0.0</aries-blueprint-version>
     <arquillian-junit-container-version>1.0.0.CR7</arquillian-junit-container-version>
     <arquillian-weld-ee-embedded-version>1.0.0.CR3</arquillian-weld-ee-embedded-version>
     <asm-bundle-version>3.3_2</asm-bundle-version>
@@ -218,7 +216,7 @@
     <junit-version>4.10</junit-version>
     <jython-engine-version>20080611</jython-engine-version>
     <jython-version>2.2.1</jython-version>
-    <karaf-version>2.2.9</karaf-version>
+    <karaf-version>2.3.0</karaf-version>
     <krati-version>0.4.6</krati-version>
     <kxml2-bundle-version>2.3.0_2</kxml2-bundle-version>
     <leveldbjni-version>1.3</leveldbjni-version>
@@ -256,7 +254,7 @@
     <opensaml-version>2.5.1_2</opensaml-version>
     <oro-bundle-version>2.0.8_6</oro-bundle-version>
     <oscache-bundle-version>2.4_5</oscache-bundle-version>
-    <osgi-version>4.2.0</osgi-version>
+    <osgi-version>4.3.0</osgi-version>
     <paranamer-bundle-version>2.4_1</paranamer-bundle-version>
     <pax-exam-version>2.5.0</pax-exam-version>
     <paxexam-karaf-container-version>1.0.0</paxexam-karaf-container-version>

Modified: camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java?rev=1405798&r1=1405797&r2=1405798&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java
(original)
+++ camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java
Mon Nov  5 14:06:56 2012
@@ -157,7 +157,7 @@ public abstract class AbstractFeatureTes
                 karafDistributionConfiguration().frameworkUrl(
                     maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").versionAsInProject())
                     //This version doesn't affect the version of karaf we use 
-                    .karafVersion("2.2.9").name("Apache Karaf")
+                    .karafVersion("2.3.0").name("Apache Karaf")
                     .unpackDirectory(new File("target/paxexam/unpack/")),
                 
                 KarafDistributionOption.keepRuntimeFolder(),

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java?rev=1405798&r1=1405797&r2=1405798&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java
Mon Nov  5 14:06:56 2012
@@ -131,7 +131,7 @@ public class OSGiIntegrationTestSupport 
                       karafDistributionConfiguration()
                           .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").versionAsInProject())
                           // This version is not actual karaf version that we use.
-                          .karafVersion("2.2.9")
+                          .karafVersion("2.3.0")
                           .name("Apache Karaf")
                           .useDeployFolder(false).unpackDirectory(new File("target/paxexam/unpack/")),
 



Mime
View raw message