You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by jb...@apache.org on 2011/08/05 11:40:04 UTC

svn commit: r1154146 - in /servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources: META-INF/maven/ archetype-resources/src/main/resources/OSGI-INF/ archetype-resources/src/main/resources/OSGI-INF/blueprint/

Author: jbonofre
Date: Fri Aug  5 09:40:04 2011
New Revision: 1154146

URL: http://svn.apache.org/viewvc?rev=1154146&view=rev
Log:
[SM-2112] Service engine archetype now includes the blueprint description

Added:
    servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/
    servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/
    servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/my-component.xml
Modified:
    servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources/META-INF/maven/archetype.xml

Modified: servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources/META-INF/maven/archetype.xml
URL: http://svn.apache.org/viewvc/servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources/META-INF/maven/archetype.xml?rev=1154146&r1=1154145&r2=1154146&view=diff
==============================================================================
--- servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources/META-INF/maven/archetype.xml (original)
+++ servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources/META-INF/maven/archetype.xml Fri Aug  5 09:40:04 2011
@@ -23,6 +23,9 @@
     <source>src/main/java/MyComponent.java</source>
     <source>src/main/java/MyEndpoint.java</source>
   </sources>
+  <resources>
+    <resource>src/main/resources/OSGI-INF/blueprint/my-component.xml</resource>
+  </resources>
   <testSources>
     <source>src/test/java/MySpringComponentTest.java</source>
   </testSources>

Added: servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/my-component.xml
URL: http://svn.apache.org/viewvc/servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/my-component.xml?rev=1154146&view=auto
==============================================================================
--- servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/my-component.xml (added)
+++ servicemix/archetypes/trunk/servicemix-service-engine/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/my-component.xml Fri Aug  5 09:40:04 2011
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+           xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
+
+    <!-- Retrieve ManagementStrategy from OSGi service registry -->
+    <reference id="managementStrategy" interface="org.fusesource.commons.management.ManagementStrategy"/>
+
+    <bean id="my-component" class="org.apache.servicemix.exec.ExecComponent">
+        <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>
+        <property name="managementStrategy" ref="managementStrategy"/>
+    </bean>
+
+    <bean id="endpoint-tracker" class="org.apache.servicemix.common.osgi.EndpointTracker">
+        <property name="component" ref="my-component" />
+    </bean>
+
+    <reference-list id="endpoints"
+               interface="org.apache.servicemix.common.osgi.EndpointWrapper"
+               availability="optional">
+        <reference-listener ref="endpoint-tracker" bind-method="register" unbind-method="unregister" />
+    </reference-list>
+
+    <service ref="my-component" interface="javax.jbi.component.Component">
+        <service-properties>
+            <entry key="NAME" value="my-component" />
+            <entry key="TYPE" value="service-engine" />
+        </service-properties>
+    </service>
+
+    <service interface="org.apache.aries.blueprint.NamespaceHandler">
+        <service-properties>
+            <entry key="osgi.service.blueprint.namespace" value="http://servicemix.apache.org/my-component/1.0"/>
+        </service-properties>
+        <bean class="org.apache.xbean.blueprint.context.impl.XBeanNamespaceHandler">
+            <argument value="http://servicemix.apache.org/my-component/1.0"/>
+            <argument value="servicemix-my-component.xsd"/>
+            <argument ref="blueprintBundle"/>
+            <argument value="META-INF/services/org/apache/xbean/spring/http/servicemix.apache.org/my-component/1.0"/>
+        </bean>
+    </service>
+
+    <cm:property-placeholder persistent-id="org.apache.servicemix.components.my-component">
+        <cm:default-properties>
+            <cm:property name="threadPoolCorePoolSize" value="8"/>
+            <cm:property name="threadPoolMaximumPoolSize" value="32"/>
+            <cm:property name="threadPoolQueueSize" value="256"/>
+            </cm:default-properties>
+    </cm:property-placeholder>
+
+</blueprint>
\ No newline at end of file