servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r680373 - in /servicemix/components/engines/servicemix-quartz/trunk: ./ src/main/java/org/apache/servicemix/quartz/support/ src/main/resources/META-INF/ src/main/resources/META-INF/spring/
Date Mon, 28 Jul 2008 14:48:43 GMT
Author: gnodet
Date: Mon Jul 28 07:48:42 2008
New Revision: 680373

URL: http://svn.apache.org/viewvc?rev=680373&view=rev
Log:
SM-1387: make servicemix-quartz OSGi friendly and no more dependant on servicemix-core

Added:
    servicemix/components/engines/servicemix-quartz/trunk/src/main/resources/META-INF/
    servicemix/components/engines/servicemix-quartz/trunk/src/main/resources/META-INF/spring/
    servicemix/components/engines/servicemix-quartz/trunk/src/main/resources/META-INF/spring/servicemix-quartz.xml
Modified:
    servicemix/components/engines/servicemix-quartz/trunk/pom.xml
    servicemix/components/engines/servicemix-quartz/trunk/src/main/java/org/apache/servicemix/quartz/support/DefaultQuartzMarshaler.java

Modified: servicemix/components/engines/servicemix-quartz/trunk/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-quartz/trunk/pom.xml?rev=680373&r1=680372&r2=680373&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-quartz/trunk/pom.xml (original)
+++ servicemix/components/engines/servicemix-quartz/trunk/pom.xml Mon Jul 28 07:48:42 2008
@@ -42,6 +42,18 @@
     <previous.releases>3.1.2,3.2,3.2.1</previous.releases>
     <servicemix-version>3.2.1</servicemix-version>
     <servicemix-shared-version>4.0-SNAPSHOT</servicemix-shared-version>
+    <servicemix.osgi.import>
+      org.apache.servicemix.common,
+      org.apache.servicemix.common.osgi,
+      org.apache.servicemix.executors.impl,
+      org.apache.xbean.spring.context.v2,
+      org.springframework.beans.factory.xml,
+      *
+    </servicemix.osgi.import>
+    <servicemix.osgi.export>
+      org.apache.servicemix.quartz*;version=${project.version},
+      META-INF.services.org.apache.xbean.spring.http.servicemix.apache.org.quartz
+    </servicemix.osgi.export>
   </properties>
 
   <dependencies>

Modified: servicemix/components/engines/servicemix-quartz/trunk/src/main/java/org/apache/servicemix/quartz/support/DefaultQuartzMarshaler.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-quartz/trunk/src/main/java/org/apache/servicemix/quartz/support/DefaultQuartzMarshaler.java?rev=680373&r1=680372&r2=680373&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-quartz/trunk/src/main/java/org/apache/servicemix/quartz/support/DefaultQuartzMarshaler.java
(original)
+++ servicemix/components/engines/servicemix-quartz/trunk/src/main/java/org/apache/servicemix/quartz/support/DefaultQuartzMarshaler.java
Mon Jul 28 07:48:42 2008
@@ -27,8 +27,8 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import org.apache.servicemix.components.util.MarshalerSupport;
-import org.apache.servicemix.jbi.util.DOMUtil;
+import org.apache.servicemix.common.util.DOMUtil;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.quartz.JobDataMap;
 import org.quartz.JobDetail;
 import org.quartz.JobExecutionContext;
@@ -39,9 +39,34 @@
  *
  * @version $Revision$
  */
-public class DefaultQuartzMarshaler extends MarshalerSupport implements QuartzMarshaler {
+public class DefaultQuartzMarshaler implements QuartzMarshaler {
 
-    public void populateNormalizedMessage(NormalizedMessage message, JobExecutionContext
context) 
+    private SourceTransformer transformer;
+
+    /**
+     * Converts the value to a String
+     *
+     * @param value the value to be coerced into a string
+     * @return the value as a string or null if it cannot be converted
+     */
+    protected String asString(Object value) {
+        return value != null ? value.toString() : null;
+    }
+
+    // Properties
+    //-------------------------------------------------------------------------
+    public SourceTransformer getTransformer() {
+        if (transformer == null) {
+            transformer = new SourceTransformer();
+        }
+        return transformer;
+    }
+
+    public void setTransformer(SourceTransformer transformer) {
+        this.transformer = transformer;
+    }
+
+    public void populateNormalizedMessage(NormalizedMessage message, JobExecutionContext
context)
         throws JobExecutionException, MessagingException {
 
         JobDetail detail = context.getJobDetail();

Added: servicemix/components/engines/servicemix-quartz/trunk/src/main/resources/META-INF/spring/servicemix-quartz.xml
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-quartz/trunk/src/main/resources/META-INF/spring/servicemix-quartz.xml?rev=680373&view=auto
==============================================================================
--- servicemix/components/engines/servicemix-quartz/trunk/src/main/resources/META-INF/spring/servicemix-quartz.xml
(added)
+++ servicemix/components/engines/servicemix-quartz/trunk/src/main/resources/META-INF/spring/servicemix-quartz.xml
Mon Jul 28 07:48:42 2008
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:osgi="http://www.springframework.org/schema/osgi"
+       xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+  http://www.springframework.org/schema/beans
+  http://www.springframework.org/schema/beans/spring-beans.xsd
+  http://www.springframework.org/schema/util
+  http://www.springframework.org/schema/util/spring-util.xsd
+  http://www.springframework.org/schema/osgi
+  http://www.springframework.org/schema/osgi/spring-osgi.xsd
+  http://www.springframework.org/schema/osgi-compendium
+  http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd">
+
+    <bean id="servicemix-quartz" class="org.apache.servicemix.quartz.QuartzComponent">
+        <property name="executorFactory" ref="executorFactory" />
+    </bean>
+
+    <bean id="executorFactory" class="org.apache.servicemix.executors.impl.ExecutorFactoryImpl">
+        <property name="defaultConfig">
+            <bean class="org.apache.servicemix.executors.impl.ExecutorConfig">
+                <property name="corePoolSize" value="${threadPoolCorePoolSize}"/>
+                <property name="maximumPoolSize" value="${threadPoolMaximumPoolSize}"/>
+                <property name="queueSize" value="${threadPoolQueueSize}"/>
+            </bean>
+        </property>
+    </bean>
+
+    <bean id="endpoint-tracker" class="org.apache.servicemix.common.osgi.EndpointTracker">
+        <property name="component" ref="servicemix-quartz" />
+    </bean>
+
+    <osgi:list id="endpoints"
+               interface="org.apache.servicemix.common.osgi.EndpointWrapper"
+               cardinality="0..N">
+        <osgi:listener ref="endpoint-tracker" bind-method="register" unbind-method="unregister"
/>
+    </osgi:list>
+
+    <osgi:service ref="servicemix-quartz" interface="javax.jbi.component.Component">
+        <osgi:service-properties>
+            <entry key="NAME" value="servicemix-quartz" />
+            <entry key="TYPE" value="service-engine" />
+        </osgi:service-properties>
+    </osgi:service>
+
+    <osgix:property-placeholder persistent-id="servicemix-quartz">
+        <osgix:default-properties>
+            <prop key="threadPoolCorePoolSize">8</prop>
+            <prop key="threadPoolMaximumPoolSize">32</prop>
+            <prop key="threadPoolQueueSize">256</prop>
+        </osgix:default-properties>
+    </osgix:property-placeholder>
+
+</beans>



Mime
View raw message