Commit ongoing work on switching to blueprint
git-svn-id: https://svn.apache.org/repos/asf/servicemix/smx4/kernel/branches/blueprint@769394 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 22e5f1e..5c3cc2e 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -48,7 +48,7 @@
</dependency>
<dependency>
<groupId>org.apache.servicemix.kernel</groupId>
- <artifactId>org.apache.servicemix.kernel.spring</artifactId>
+ <artifactId>org.apache.servicemix.kernel.blueprint</artifactId>
</dependency>
<dependency>
<groupId>org.apache.servicemix.kernel.gshell</groupId>
@@ -83,6 +83,10 @@
<artifactId>org.apache.servicemix.kernel.gshell.packages</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.servicemix.kernel.gshell</groupId>
+ <artifactId>org.apache.servicemix.kernel.gshell.run</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.servicemix.kernel.jaas</groupId>
<artifactId>org.apache.servicemix.kernel.jaas.boot</artifactId>
</dependency>
@@ -99,34 +103,6 @@
<artifactId>org.apache.servicemix.kernel.management</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.osgi</groupId>
- <artifactId>spring-osgi-extender</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.osgi</groupId>
- <artifactId>spring-osgi-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.osgi</groupId>
- <artifactId>spring-osgi-io</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.bundlerepository</artifactId>
</dependency>
diff --git a/assembly/src/main/descriptors/unix-bin.xml b/assembly/src/main/descriptors/unix-bin.xml
index 3dd8246..52a9c51 100644
--- a/assembly/src/main/descriptors/unix-bin.xml
+++ b/assembly/src/main/descriptors/unix-bin.xml
@@ -157,23 +157,9 @@
<outputDirectory>/system</outputDirectory>
<unpack>false</unpack>
<useProjectArtifact>false</useProjectArtifact>
- <outputFileNameMapping>org/springframework/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+ <outputFileNameMapping>org/apache/geronimo/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
- <include>org.springframework:spring-aop</include>
- <include>org.springframework:spring-beans</include>
- <include>org.springframework:spring-context</include>
- <include>org.springframework:spring-core</include>
- </includes>
- </dependencySet>
- <dependencySet>
- <outputDirectory>/system</outputDirectory>
- <unpack>false</unpack>
- <useProjectArtifact>false</useProjectArtifact>
- <outputFileNameMapping>org/springframework/osgi/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
- <includes>
- <include>org.springframework.osgi:spring-osgi-core</include>
- <include>org.springframework.osgi:spring-osgi-extender</include>
- <include>org.springframework.osgi:spring-osgi-io</include>
+ <include>org.apache.geronimo:blueprint-bundle</include>
</includes>
</dependencySet>
<dependencySet>
@@ -192,8 +178,6 @@
<useProjectArtifact>false</useProjectArtifact>
<outputFileNameMapping>org/apache/servicemix/bundles/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
- <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.aopalliance</include>
- <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.cglib</include>
<include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.jaxp-ri</include>
<include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.oro</include>
<include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.commons-jexl</include>
@@ -219,7 +203,7 @@
<outputFileNameMapping>org/apache/servicemix/kernel/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>org.apache.servicemix.kernel:org.apache.servicemix.kernel.filemonitor</include>
- <include>org.apache.servicemix.kernel:org.apache.servicemix.kernel.spring</include>
+ <include>org.apache.servicemix.kernel:org.apache.servicemix.kernel.blueprint</include>
<include>org.apache.servicemix.kernel:org.apache.servicemix.kernel.management</include>
</includes>
</dependencySet>
@@ -236,6 +220,7 @@
<include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.features</include>
<include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.config</include>
<include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.packages</include>
+ <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.run</include>
</includes>
</dependencySet>
<dependencySet>
diff --git a/assembly/src/main/descriptors/windows-bin.xml b/assembly/src/main/descriptors/windows-bin.xml
index 0901795..2811441 100644
--- a/assembly/src/main/descriptors/windows-bin.xml
+++ b/assembly/src/main/descriptors/windows-bin.xml
@@ -149,29 +149,6 @@
<outputDirectory>/system</outputDirectory>
<unpack>false</unpack>
<useProjectArtifact>false</useProjectArtifact>
- <outputFileNameMapping>org/springframework/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
- <includes>
- <include>org.springframework:spring-aop</include>
- <include>org.springframework:spring-beans</include>
- <include>org.springframework:spring-context</include>
- <include>org.springframework:spring-core</include>
- </includes>
- </dependencySet>
- <dependencySet>
- <outputDirectory>/system</outputDirectory>
- <unpack>false</unpack>
- <useProjectArtifact>false</useProjectArtifact>
- <outputFileNameMapping>org/springframework/osgi/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
- <includes>
- <include>org.springframework.osgi:spring-osgi-core</include>
- <include>org.springframework.osgi:spring-osgi-extender</include>
- <include>org.springframework.osgi:spring-osgi-io</include>
- </includes>
- </dependencySet>
- <dependencySet>
- <outputDirectory>/system</outputDirectory>
- <unpack>false</unpack>
- <useProjectArtifact>false</useProjectArtifact>
<outputFileNameMapping>org/apache/geronimo/specs/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>org.apache.geronimo.specs:geronimo-servlet_2.5_spec</include>
@@ -184,8 +161,6 @@
<useProjectArtifact>false</useProjectArtifact>
<outputFileNameMapping>org/apache/servicemix/bundles/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
- <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.aopalliance</include>
- <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.cglib</include>
<include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.jaxp-ri</include>
<include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.oro</include>
<include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.commons-jexl</include>
@@ -211,7 +186,7 @@
<outputFileNameMapping>org/apache/servicemix/kernel/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>org.apache.servicemix.kernel:org.apache.servicemix.kernel.filemonitor</include>
- <include>org.apache.servicemix.kernel:org.apache.servicemix.kernel.spring</include>
+ <include>org.apache.servicemix.kernel:org.apache.servicemix.kernel.blueprint</include>
<include>org.apache.servicemix.kernel:org.apache.servicemix.kernel.management</include>
</includes>
</dependencySet>
@@ -228,6 +203,7 @@
<include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.features</include>
<include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.config</include>
<include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.packages</include>
+ <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.run</include>
</includes>
</dependencySet>
<dependencySet>
diff --git a/assembly/src/main/filtered-resources/etc/startup.properties b/assembly/src/main/filtered-resources/etc/startup.properties
index 06519d6..f67cceb 100644
--- a/assembly/src/main/filtered-resources/etc/startup.properties
+++ b/assembly/src/main/filtered-resources/etc/startup.properties
@@ -35,26 +35,19 @@
org/apache/geronimo/specs/geronimo-annotation_1.0_spec/${geronimo.annotation.version}/geronimo-annotation_1.0_spec-${geronimo.annotation.version}.jar=10
org/apache/felix/org.apache.felix.prefs/${felix.prefs.version}/org.apache.felix.prefs-${felix.prefs.version}.jar=10
org/apache/servicemix/kernel/org.apache.servicemix.kernel.filemonitor/${pom.version}/org.apache.servicemix.kernel.filemonitor-${pom.version}.jar=15
+org/apache/geronimo/blueprint-bundle/${geronimo.blueprint.version}/blueprint-bundle-${geronimo.blueprint.version}.jar=15
#
# The rest of the services..
#
+org/apache/servicemix/kernel/gshell/org.apache.servicemix.kernel.gshell.core/${pom.version}/org.apache.servicemix.kernel.gshell.core-${pom.version}.jar=30
org/apache/servicemix/bundles/org.apache.servicemix.bundles.jline/${jline.version}/org.apache.servicemix.bundles.jline-${jline.version}.jar=30
-org/apache/servicemix/bundles/org.apache.servicemix.bundles.aopalliance/${aopalliance.version}/org.apache.servicemix.bundles.aopalliance-${aopalliance.version}.jar=30
-org/apache/servicemix/bundles/org.apache.servicemix.bundles.cglib/${cglib.version}/org.apache.servicemix.bundles.cglib-${cglib.version}.jar=30
org/apache/servicemix/bundles/org.apache.servicemix.bundles.oro/${oro.version}/org.apache.servicemix.bundles.oro-${oro.version}.jar=30
org/apache/servicemix/bundles/org.apache.servicemix.bundles.commons-codec/${commons.codec.version}/org.apache.servicemix.bundles.commons-codec-${commons.codec.version}.jar=30
org/apache/servicemix/bundles/org.apache.servicemix.bundles.commons-httpclient/${commons.httpclient.version}/org.apache.servicemix.bundles.commons-httpclient-${commons.httpclient.version}.jar=30
org/apache/servicemix/bundles/org.apache.servicemix.bundles.commons-jexl/${commons.jexl.version}/org.apache.servicemix.bundles.commons-jexl-${commons.jexl.version}.jar=30
org/apache/servicemix/bundles/org.apache.servicemix.bundles.commons-vfs/${commons.vfs.version}/org.apache.servicemix.bundles.commons-vfs-${commons.vfs.version}.jar=30
-org/springframework/spring-aop/${spring.version}/spring-aop-${spring.version}.jar=30
-org/springframework/spring-beans/${spring.version}/spring-beans-${spring.version}.jar=30
-org/springframework/spring-context/${spring.version}/spring-context-${spring.version}.jar=30
-org/springframework/spring-core/${spring.version}/spring-core-${spring.version}.jar=30
-org/springframework/osgi/spring-osgi-core/${spring.osgi.version}/spring-osgi-core-${spring.osgi.version}.jar=30
-org/springframework/osgi/spring-osgi-extender/${spring.osgi.version}/spring-osgi-extender-${spring.osgi.version}.jar=30
-org/springframework/osgi/spring-osgi-io/${spring.osgi.version}/spring-osgi-io-${spring.osgi.version}.jar=30
-org/apache/servicemix/kernel/org.apache.servicemix.kernel.spring/${pom.version}/org.apache.servicemix.kernel.spring-${pom.version}.jar=30
+org/apache/servicemix/kernel/org.apache.servicemix.kernel.blueprint/${pom.version}/org.apache.servicemix.kernel.blueprint-${pom.version}.jar=30
org/apache/servicemix/kernel/org.apache.servicemix.kernel.management/${pom.version}/org.apache.servicemix.kernel.management-${pom.version}.jar=30
org/apache/servicemix/kernel/gshell/org.apache.servicemix.kernel.gshell.admin/${pom.version}/org.apache.servicemix.kernel.gshell.admin-${pom.version}.jar=30
org/apache/servicemix/kernel/gshell/org.apache.servicemix.kernel.gshell.osgi/${pom.version}/org.apache.servicemix.kernel.gshell.osgi-${pom.version}.jar=30
@@ -72,5 +65,5 @@
#
# Start console last
#
-org/apache/servicemix/kernel/gshell/org.apache.servicemix.kernel.gshell.core/${pom.version}/org.apache.servicemix.kernel.gshell.core-${pom.version}.jar=40
+org/apache/servicemix/kernel/gshell/org.apache.servicemix.kernel.gshell.run/${pom.version}/org.apache.servicemix.kernel.gshell.run-${pom.version}.jar=40
diff --git a/demos/smx4web/pom.xml b/demos/smx4web/pom.xml
index afb80f4..b3559c2 100644
--- a/demos/smx4web/pom.xml
+++ b/demos/smx4web/pom.xml
@@ -58,7 +58,7 @@
</exclusion>
<exclusion>
<groupId>org.apache.servicemix.kernel</groupId>
- <artifactId>org.apache.servicemix.kernel.spring</artifactId>
+ <artifactId>org.apache.servicemix.kernel.blueprint</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.servicemix.kernel.gshell</groupId>
diff --git a/gshell/gshell-admin/pom.xml b/gshell/gshell-admin/pom.xml
index 444963b..d180dfd 100644
--- a/gshell/gshell-admin/pom.xml
+++ b/gshell/gshell-admin/pom.xml
@@ -69,10 +69,12 @@
<scope>provided</scope>
</dependency>
+ <!--
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-core</artifactId>
</dependency>
+ -->
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
diff --git a/gshell/gshell-admin/src/main/filtered-resources/org/apache/servicemix/kernel/gshell/admin/etc/startup.properties b/gshell/gshell-admin/src/main/filtered-resources/org/apache/servicemix/kernel/gshell/admin/etc/startup.properties
index f9689b1..db285d3 100644
--- a/gshell/gshell-admin/src/main/filtered-resources/org/apache/servicemix/kernel/gshell/admin/etc/startup.properties
+++ b/gshell/gshell-admin/src/main/filtered-resources/org/apache/servicemix/kernel/gshell/admin/etc/startup.properties
@@ -55,7 +55,7 @@
org/springframework/osgi/spring-osgi-core/${spring.osgi.version}/spring-osgi-core-${spring.osgi.version}.jar=30
org/springframework/osgi/spring-osgi-extender/${spring.osgi.version}/spring-osgi-extender-${spring.osgi.version}.jar=30
org/springframework/osgi/spring-osgi-io/${spring.osgi.version}/spring-osgi-io-${spring.osgi.version}.jar=30
-org/apache/servicemix/kernel/org.apache.servicemix.kernel.spring/${pom.version}/org.apache.servicemix.kernel.spring-${pom.version}.jar=30
+org/apache/servicemix/kernel/org.apache.servicemix.kernel.blueprint/${pom.version}/org.apache.servicemix.kernel.blueprint-${pom.version}.jar=30
org/apache/servicemix/kernel/org.apache.servicemix.kernel.management/${pom.version}/org.apache.servicemix.kernel.management-${pom.version}.jar=30
org/apache/servicemix/kernel/gshell/org.apache.servicemix.kernel.gshell.admin/${pom.version}/org.apache.servicemix.kernel.gshell.admin-${pom.version}.jar=30
org/apache/servicemix/kernel/gshell/org.apache.servicemix.kernel.gshell.osgi/${pom.version}/org.apache.servicemix.kernel.gshell.osgi-${pom.version}.jar=30
diff --git a/gshell/gshell-admin/src/main/java/org/apache/servicemix/kernel/gshell/admin/internal/AdminServiceImpl.java b/gshell/gshell-admin/src/main/java/org/apache/servicemix/kernel/gshell/admin/internal/AdminServiceImpl.java
index 54283a8..cf03bd2 100644
--- a/gshell/gshell-admin/src/main/java/org/apache/servicemix/kernel/gshell/admin/internal/AdminServiceImpl.java
+++ b/gshell/gshell-admin/src/main/java/org/apache/servicemix/kernel/gshell/admin/internal/AdminServiceImpl.java
@@ -36,9 +36,8 @@
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
import org.osgi.service.prefs.PreferencesService;
-import org.springframework.beans.factory.InitializingBean;
-public class AdminServiceImpl implements AdminService, InitializingBean {
+public class AdminServiceImpl implements AdminService {
private static final Log LOGGER = LogFactory.getLog(AdminServiceImpl.class);
diff --git a/gshell/gshell-admin/src/main/resources/META-INF/spring/gshell-admin.xml b/gshell/gshell-admin/src/main/resources/META-INF/spring/gshell-admin.xml
deleted file mode 100644
index 5f05513..0000000
--- a/gshell/gshell-admin/src/main/resources/META-INF/spring/gshell-admin.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-<?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"
- xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.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
- http://www.springframework.org/schema/util
- http://www.springframework.org/schema/util/spring-util.xsd
- http://servicemix.apache.org/schema/servicemix-gshell
- http://servicemix.apache.org/schema/servicemix-gshell/servicemix-gshell.xsd">
-
- <import resource="classpath:org/apache/servicemix/kernel/gshell/core/commands.xml" />
-
- <bean id="adminCommandBundleSupport" scope="prototype">
- <property name="adminService" ref="adminService" />
- </bean>
-
- <gshell:command-bundle>
- <gshell:command name="admin/create">
- <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.CreateCommand"
- parent="adminCommandBundleSupport" />
- </gshell:command>
- <gshell:command name="admin/connect">
- <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.ConnectCommand"
- parent="adminCommandBundleSupport" />
- <gshell:completers>
- <ref bean="instanceCompleter" />
- <null/>
- </gshell:completers>
- </gshell:command>
- <gshell:command name="admin/list">
- <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.ListCommand"
- parent="adminCommandBundleSupport" />
- </gshell:command>
- <gshell:command name="admin/start">
- <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.StartCommand"
- parent="adminCommandBundleSupport" />
- <gshell:completers>
- <ref bean="instanceCompleter" />
- <null/>
- </gshell:completers>
- </gshell:command>
- <gshell:command name="admin/stop">
- <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.StopCommand"
- parent="adminCommandBundleSupport" />
- <gshell:completers>
- <ref bean="instanceCompleter" />
- <null/>
- </gshell:completers>
- </gshell:command>
- <gshell:command name="admin/destroy">
- <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.DestroyCommand"
- parent="adminCommandBundleSupport" />
- <gshell:completers>
- <ref bean="instanceCompleter" />
- <null/>
- </gshell:completers>
- </gshell:command>
- <gshell:command name="admin/change-port">
- <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.ChangePortCommand"
- parent="adminCommandBundleSupport" />
- <gshell:completers>
- <ref bean="instanceCompleter" />
- <null/>
- </gshell:completers>
- </gshell:command>
- </gshell:command-bundle>
-
- <osgi:reference id="preferences" interface="org.osgi.service.prefs.PreferencesService" cardinality="0..1" />
-
- <bean id="adminService" class="org.apache.servicemix.kernel.gshell.admin.internal.AdminServiceImpl">
- <property name="preferences" ref="preferences" />
- </bean>
-
- <bean id="instanceCompleter" class="org.apache.servicemix.kernel.gshell.admin.internal.completers.InstanceCompleter">
- <property name="adminService" ref="adminService" />
- </bean>
-
-
-</beans>
\ No newline at end of file
diff --git a/gshell/gshell-admin/src/main/resources/OSGI-INF/blueprint/gshell-admin.xml b/gshell/gshell-admin/src/main/resources/OSGI-INF/blueprint/gshell-admin.xml
new file mode 100644
index 0000000..cc5521d
--- /dev/null
+++ b/gshell/gshell-admin/src/main/resources/OSGI-INF/blueprint/gshell-admin.xml
@@ -0,0 +1,92 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell">
+
+ <gshell:command-bundle>
+ <gshell:command name="admin/create">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.CreateCommand">
+ <property name="adminService" ref="adminService" />
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="admin/connect">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.ConnectCommand">
+ <property name="adminService" ref="adminService" />
+ </gshell:action>
+ <gshell:completers>
+ <ref component="instanceCompleter" />
+ <null/>
+ </gshell:completers>
+ </gshell:command>
+ <gshell:command name="admin/list">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.ListCommand">
+ <property name="adminService" ref="adminService" />
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="admin/start">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.StartCommand">
+ <property name="adminService" ref="adminService" />
+ </gshell:action>
+ <gshell:completers>
+ <ref component="instanceCompleter" />
+ <null/>
+ </gshell:completers>
+ </gshell:command>
+ <gshell:command name="admin/stop">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.StopCommand">
+ <property name="adminService" ref="adminService" />
+ </gshell:action>
+ <gshell:completers>
+ <ref component="instanceCompleter" />
+ <null/>
+ </gshell:completers>
+ </gshell:command>
+ <gshell:command name="admin/destroy">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.DestroyCommand">
+ <property name="adminService" ref="adminService" />
+ </gshell:action>
+ <gshell:completers>
+ <ref component="instanceCompleter" />
+ <null/>
+ </gshell:completers>
+ </gshell:command>
+ <gshell:command name="admin/change-port">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.admin.internal.commands.ChangePortCommand">
+ <property name="adminService" ref="adminService" />
+ </gshell:action>
+ <gshell:completers>
+ <ref component="instanceCompleter" />
+ <null/>
+ </gshell:completers>
+ </gshell:command>
+ </gshell:command-bundle>
+
+ <reference id="preferences" interface="org.osgi.service.prefs.PreferencesService" availability="optional"/>
+
+ <bean id="adminService" class="org.apache.servicemix.kernel.gshell.admin.internal.AdminServiceImpl" init-method="afterPropertiesSet">
+ <property name="preferences" ref="preferences" />
+ </bean>
+
+ <bean id="instanceCompleter" class="org.apache.servicemix.kernel.gshell.admin.internal.completers.InstanceCompleter">
+ <property name="adminService" ref="adminService" />
+ </bean>
+
+
+</blueprint>
\ No newline at end of file
diff --git a/gshell/gshell-config/pom.xml b/gshell/gshell-config/pom.xml
index 136eee5..06c1291 100644
--- a/gshell/gshell-config/pom.xml
+++ b/gshell/gshell-config/pom.xml
@@ -55,10 +55,12 @@
<scope>provided</scope>
</dependency>
+ <!--
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-core</artifactId>
</dependency>
+ -->
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
diff --git a/gshell/gshell-config/src/main/resources/META-INF/spring/gshell-config.xml b/gshell/gshell-config/src/main/resources/OSGI-INF/blueprint/gshell-config.xml
similarity index 64%
rename from gshell/gshell-config/src/main/resources/META-INF/spring/gshell-config.xml
rename to gshell/gshell-config/src/main/resources/OSGI-INF/blueprint/gshell-config.xml
index e5c9d6d..c6fb9fa 100644
--- a/gshell/gshell-config/src/main/resources/META-INF/spring/gshell-config.xml
+++ b/gshell/gshell-config/src/main/resources/OSGI-INF/blueprint/gshell-config.xml
@@ -17,25 +17,8 @@
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"
- xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.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
- http://www.springframework.org/schema/util
- http://www.springframework.org/schema/util/spring-util.xsd
- http://servicemix.apache.org/schema/servicemix-gshell
- http://servicemix.apache.org/schema/servicemix-gshell/servicemix-gshell.xsd">
-
- <import resource="classpath:org/apache/servicemix/kernel/gshell/core/commands.xml" />
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell">
<gshell:command-bundle>
<gshell:command name="config/cancel">
@@ -44,7 +27,7 @@
<gshell:command name="config/edit">
<gshell:action class="org.apache.servicemix.kernel.gshell.config.EditCommand"/>
<gshell:completers>
- <ref bean="configCompleter" />
+ <ref component="configCompleter" />
<null/>
</gshell:completers>
</gshell:command>
@@ -54,7 +37,7 @@
<gshell:command name="config/propdel">
<gshell:action class="org.apache.servicemix.kernel.gshell.config.PropDelCommand" />
<gshell:completers>
- <ref bean="configPropertyCompleter" />
+ <ref component="configPropertyCompleter" />
<null/>
</gshell:completers>
</gshell:command>
@@ -64,7 +47,7 @@
<gshell:command name="config/propset">
<gshell:action class="org.apache.servicemix.kernel.gshell.config.PropSetCommand" />
<gshell:completers>
- <ref bean="configPropertyCompleter" />
+ <ref component="configPropertyCompleter" />
<null/>
</gshell:completers>
</gshell:command>
@@ -79,8 +62,8 @@
<bean id="configPropertyCompleter" class="org.apache.servicemix.kernel.gshell.config.completers.ConfigurationPropertyCompleter" />
- <osgi:reference id="configAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" />
+ <reference id="configAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" />
- <osgi:service ref="configCompleter" interface="org.osgi.service.cm.ConfigurationListener" />
+ <service ref="configCompleter" interface="org.osgi.service.cm.ConfigurationListener" />
-</beans>
\ No newline at end of file
+</blueprint>
\ No newline at end of file
diff --git a/gshell/gshell-core/pom.xml b/gshell/gshell-core/pom.xml
index 7bd7aed..0a760f6 100644
--- a/gshell/gshell-core/pom.xml
+++ b/gshell/gshell-core/pom.xml
@@ -39,15 +39,10 @@
<properties>
<gshell.osgi.import>
- org.springframework.aop,
- org.springframework.aop.framework,
- org.springframework.beans.factory.annotation,
- org.springframework.context.annotation,
- org.springframework.osgi.service.importer,
- org.aopalliance.aop,
org.apache.commons.vfs.provider.temp,
org.apache.commons.vfs.provider.ram,
jline*,
+ org.apache.geronimo.blueprint.beans,
org.apache.servicemix.kernel.jaas.config;resolution:=optional,
org.apache.servicemix.kernel.version;resolution:=optional,
org.apache.servicemix.kernel.main.spi;resolution:=optional;version="1.0.0",
@@ -55,6 +50,7 @@
org.apache.sshd.server.keyprovider,
org.apache.sshd.server.jaas,
org.jsecurity*;resolution:=optional,
+ org.springframework*;resolution:=optional,
*
</gshell.osgi.import>
<!-- TODO: remove plexus util package -->
@@ -68,6 +64,10 @@
<dependencies>
<dependency>
+ <groupId>org.apache.geronimo</groupId>
+ <artifactId>blueprint-bundle</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.servicemix.kernel</groupId>
<artifactId>org.apache.servicemix.kernel.main</artifactId>
</dependency>
@@ -79,10 +79,12 @@
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.cglib</artifactId>
</dependency>
+ <!--
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-core</artifactId>
</dependency>
+ -->
<dependency>
<groupId>org.apache.geronimo.gshell.commands</groupId>
<artifactId>gshell-builtin</artifactId>
@@ -139,6 +141,7 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
+ <!--
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
@@ -147,6 +150,7 @@
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</dependency>
+ -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
diff --git a/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/vfs/config/CacheStrategyConverter.java b/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/vfs/config/CacheStrategyConverter.java
new file mode 100644
index 0000000..ac1dd73
--- /dev/null
+++ b/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/vfs/config/CacheStrategyConverter.java
@@ -0,0 +1,47 @@
+/*
+ * 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.geronimo.gshell.vfs.config;
+
+import org.osgi.service.blueprint.convert.Converter;
+import org.apache.commons.vfs.CacheStrategy;
+
+public class CacheStrategyConverter implements Converter {
+
+ public Class getTargetClass() {
+ return CacheStrategy.class;
+ }
+
+ public Object convert(Object source) throws Exception {
+ assert source != null;
+ String text = source.toString();
+
+ if (text.equalsIgnoreCase("MANUAL")) {
+ return CacheStrategy.MANUAL;
+ }
+ else if (text.equalsIgnoreCase("ON_RESOLVE")) {
+ return CacheStrategy.ON_RESOLVE;
+ }
+ else if (text.equalsIgnoreCase("ON_CALL")) {
+ return CacheStrategy.ON_CALL;
+ }
+ else {
+ throw new IllegalArgumentException("Unknown cache strategy: " + text);
+ }
+ }
+}
diff --git a/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/vfs/config/FileSystemManagerFactory.java b/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/vfs/config/FileSystemManagerFactory.java
new file mode 100644
index 0000000..dbd1fce
--- /dev/null
+++ b/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/vfs/config/FileSystemManagerFactory.java
@@ -0,0 +1,139 @@
+/*
+ * 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.geronimo.gshell.vfs.config;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.commons.vfs.FilesCache;
+import org.apache.commons.vfs.CacheStrategy;
+import org.apache.commons.vfs.FileContentInfoFactory;
+import org.apache.commons.vfs.impl.DefaultFileReplicator;
+import org.apache.commons.vfs.impl.PrivilegedFileReplicator;
+import org.apache.commons.vfs.impl.FileContentInfoFilenameFactory;
+import org.apache.commons.vfs.cache.SoftRefFilesCache;
+import org.apache.commons.vfs.provider.FileReplicator;
+import org.apache.commons.vfs.provider.TemporaryFileStore;
+import org.apache.commons.vfs.provider.FileProvider;
+import org.apache.commons.vfs.provider.url.UrlFileProvider;
+
+public class FileSystemManagerFactory {
+
+ private final Logger log = LoggerFactory.getLogger(getClass());
+
+ private FilesCache filesCache;
+
+ private CacheStrategy cacheStrategy = CacheStrategy.ON_RESOLVE;
+
+ private FileReplicator fileReplicator;
+
+ private TemporaryFileStore temporaryFileStore;
+
+ private FileContentInfoFactory fileContentInfoFactory;
+
+ private FileProvider defaultProvider;
+
+ // FileObjectDecorator (Class/Constructor of DecoratedFileObject? or make a factory?)
+
+ public void setFilesCache(final FilesCache cache) {
+ this.filesCache = cache;
+ }
+
+ public void setCacheStrategy(final CacheStrategy strategy) {
+ this.cacheStrategy = strategy;
+ }
+
+ public void setFileReplicator(final FileReplicator replicator) {
+ this.fileReplicator = replicator;
+ }
+
+ public void setTemporaryFileStore(final TemporaryFileStore store) {
+ this.temporaryFileStore = store;
+ }
+
+ public void setFileContentInfoFactory(final FileContentInfoFactory factory) {
+ this.fileContentInfoFactory = factory;
+ }
+
+ public void setDefaultProvider(final FileProvider provider) {
+ this.defaultProvider = provider;
+ }
+
+ // @PostConstruct
+ public void init() {
+ if (filesCache == null) {
+ filesCache = new SoftRefFilesCache();
+ }
+
+ if (fileReplicator == null || temporaryFileStore == null) {
+ DefaultFileReplicator replicator = new DefaultFileReplicator();
+ if (fileReplicator == null) {
+ fileReplicator = new PrivilegedFileReplicator(replicator);
+ }
+ if (temporaryFileStore == null) {
+ temporaryFileStore = replicator;
+ }
+ }
+
+ if (fileContentInfoFactory == null) {
+ fileContentInfoFactory = new FileContentInfoFilenameFactory();
+ }
+
+ if (defaultProvider == null) {
+ defaultProvider = new UrlFileProvider();
+ }
+ }
+
+ //
+ // FactoryBean
+ //
+
+ public Object getObject() throws Exception {
+ ConfigurableFileSystemManager fsm = new ConfigurableFileSystemManager();
+
+ assert fileReplicator != null;
+ log.debug("File replicator: {}", fileReplicator);
+ fsm.setReplicator(fileReplicator);
+
+ assert temporaryFileStore != null;
+ log.debug("Temporary file store: {}", temporaryFileStore);
+ fsm.setTemporaryFileStore(temporaryFileStore);
+
+ assert filesCache != null;
+ log.debug("Files cache: {}", filesCache);
+ fsm.setFilesCache(filesCache);
+
+ assert cacheStrategy != null;
+ log.debug("Cache strategy: {}", cacheStrategy);
+ fsm.setCacheStrategy(cacheStrategy);
+
+ assert fileContentInfoFactory != null;
+ log.debug("File content info factory: {}", fileContentInfoFactory);
+ fsm.setFileContentInfoFactory(fileContentInfoFactory);
+
+ assert defaultProvider != null;
+ log.debug("Default provider: {}", defaultProvider);
+ fsm.setDefaultProvider(defaultProvider);
+
+ // Finally init the manager
+ fsm.init();
+
+ return fsm;
+ }
+
+}
diff --git a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/ApplicationImpl.java b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/ApplicationImpl.java
index 350fd63..1375c0d 100644
--- a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/ApplicationImpl.java
+++ b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/ApplicationImpl.java
@@ -28,9 +28,8 @@
import org.apache.geronimo.gshell.artifact.Artifact;
import org.apache.geronimo.gshell.command.Variables;
import org.apache.geronimo.gshell.io.IO;
-import org.springframework.beans.factory.InitializingBean;
-public class ApplicationImpl implements Application, InitializingBean {
+public class ApplicationImpl implements Application {
private static final String EMBEDDED_PROPS = "org/apache/servicemix/kernel/version/embedded.properties";
private static final String SERVICEMIX_VERSION ="org/apache/servicemix/kernel/gshell/core/servicemix-version.properties";
@@ -49,7 +48,7 @@
this.homeDir = detectHomeDir();
}
- public void afterPropertiesSet() throws Exception {
+ public void init() throws Exception {
Properties props = new Properties();
props.load(getClass().getClassLoader().getResourceAsStream(SERVICEMIX_VERSION));
String kernelVersion = props.getProperty(VERSION_PROPERTY);
diff --git a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/ApplicationManagerImpl.java b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/ApplicationManagerImpl.java
index 7465900..d33ebd9 100644
--- a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/ApplicationManagerImpl.java
+++ b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/ApplicationManagerImpl.java
@@ -25,12 +25,9 @@
import org.apache.geronimo.gshell.wisdom.application.ShellCreatedEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
+import org.osgi.service.blueprint.context.BlueprintContext;
-public class ApplicationManagerImpl implements ApplicationManager, ApplicationContextAware, InitializingBean, DisposableBean {
+public class ApplicationManagerImpl implements ApplicationManager {
private final Logger log = LoggerFactory.getLogger(getClass());
@@ -38,11 +35,12 @@
private Application application;
- private ApplicationContext applicationContext;
+ private BlueprintContext blueprintContext;
- public ApplicationManagerImpl(EventPublisher eventPublisher, Application application) {
+ public ApplicationManagerImpl(EventPublisher eventPublisher, Application application, BlueprintContext blueprintContext) {
this.eventPublisher = eventPublisher;
this.application = application;
+ this.blueprintContext = blueprintContext;
}
public void afterPropertiesSet() throws Exception {
@@ -56,10 +54,6 @@
SystemOutputHijacker.uninstall();
}
- public void setApplicationContext(ApplicationContext applicationContext) {
- this.applicationContext = applicationContext;
- }
-
public void configure(ApplicationConfiguration applicationConfiguration) throws Exception {
throw new UnsupportedOperationException();
}
@@ -69,7 +63,7 @@
}
public Shell create() throws Exception {
- final Shell shell = (Shell) applicationContext.getBean("shell");
+ final Shell shell = (Shell) blueprintContext.getComponent("shell");
log.debug("Created shell instance: {}", shell);
diff --git a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/BeanContainerAwareProcessor.java b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/BeanContainerAwareProcessor.java
deleted file mode 100644
index 7deacb1..0000000
--- a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/BeanContainerAwareProcessor.java
+++ /dev/null
@@ -1,55 +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.servicemix.kernel.gshell.core;
-
-import org.apache.geronimo.gshell.spring.BeanContainer;
-import org.apache.geronimo.gshell.spring.BeanContainerAware;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-
-public class BeanContainerAwareProcessor implements InitializingBean, BeanPostProcessor, ApplicationContextAware {
-
- private ApplicationContext applicationContext;
- private BeanContainer container;
-
- public void setApplicationContext(ApplicationContext applicationContext) {
- this.applicationContext = applicationContext;
- }
-
- public void afterPropertiesSet() throws Exception {
- this.container = new BeanContainerWrapper(applicationContext);
- }
-
- public Object postProcessBeforeInitialization(final Object bean, final String beanName) throws BeansException {
- assert bean != null;
-
- if (bean instanceof BeanContainerAware) {
- ((BeanContainerAware)bean).setBeanContainer(container);
- }
-
- return bean;
- }
-
- public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException {
- return bean;
- }
-}
\ No newline at end of file
diff --git a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/BeanContainerWrapper.java b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/BeanContainerWrapper.java
index edc15d7..96bb958 100644
--- a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/BeanContainerWrapper.java
+++ b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/BeanContainerWrapper.java
@@ -19,23 +19,19 @@
package org.apache.servicemix.kernel.gshell.core;
import java.net.URL;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import org.apache.geronimo.gshell.spring.BeanContainer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
-import org.springframework.context.ApplicationContext;
+import org.apache.geronimo.gshell.wisdom.command.GroupCommand;
+import org.apache.geronimo.blueprint.ExtendedBlueprintContext;
+import org.osgi.service.blueprint.context.BlueprintContext;
public class BeanContainerWrapper implements BeanContainer {
- private final Logger log = LoggerFactory.getLogger(getClass());
+ private BlueprintContext context;
- private ApplicationContext context;
-
- public BeanContainerWrapper(ApplicationContext context) {
+ public BeanContainerWrapper(BlueprintContext context) {
this.context = context;
}
@@ -44,7 +40,7 @@
}
public ClassLoader getClassLoader() {
- return context.getClassLoader();
+ return ((ExtendedBlueprintContext) context).getClassLoader();
}
public void loadBeans(String[] strings) throws Exception {
@@ -52,51 +48,26 @@
}
public <T> T getBean(Class<T> type) {
- assert type != null;
-
- log.trace("Getting bean of type: {}", type);
-
- String[] names = context.getBeanNamesForType(type);
-
- if (names.length == 0) {
- throw new NoSuchBeanDefinitionException(type, "No bean defined for type: " + type);
+ if (GroupCommand.class.isAssignableFrom(type)) {
+ return type.cast(new GroupCommand());
}
- if (names.length > 1) {
- throw new NoSuchBeanDefinitionException(type, "No unique bean defined for type: " + type + ", found matches: " + Arrays.asList(names));
- }
-
- return getBean(names[0], type);
+ throw new UnsupportedOperationException();
}
public <T> T getBean(String name, Class<T> requiredType) {
- assert name != null;
- assert requiredType != null;
-
- log.trace("Getting bean named '{}' of type: {}", name, requiredType);
-
- return (T) context.getBean(name, requiredType);
+ return requiredType.cast(context.getComponent(name));
}
public <T> Map<String, T> getBeans(Class<T> type) {
- assert type != null;
-
- log.trace("Getting beans of type: {}", type);
-
- return (Map<String,T>) context.getBeansOfType(type);
+ throw new UnsupportedOperationException();
}
public String[] getBeanNames() {
- log.trace("Getting bean names");
-
- return context.getBeanDefinitionNames();
+ throw new UnsupportedOperationException();
}
public String[] getBeanNames(Class type) {
- assert type != null;
-
- log.trace("Getting bean names of type: {}", type);
-
- return context.getBeanNamesForType(type);
+ throw new UnsupportedOperationException();
}
public BeanContainer createChild(Collection<URL> urls) {
diff --git a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/CommandBundle.java b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/CommandBundle.java
deleted file mode 100644
index 2111072..0000000
--- a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/CommandBundle.java
+++ /dev/null
@@ -1,175 +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.servicemix.kernel.gshell.core;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.geronimo.gshell.command.Alias;
-import org.apache.geronimo.gshell.command.Command;
-import org.apache.geronimo.gshell.command.Link;
-import org.apache.geronimo.gshell.registry.AliasRegistry;
-import org.apache.geronimo.gshell.registry.CommandRegistry;
-import org.apache.geronimo.gshell.wisdom.command.LinkCommand;
-import org.apache.geronimo.gshell.wisdom.registry.CommandLocationImpl;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.osgi.context.BundleContextAware;
-
-public class CommandBundle implements BundleContextAware, InitializingBean, DisposableBean, ApplicationContextAware {
-
- private final Logger log = LoggerFactory.getLogger(getClass());
-
- private CommandRegistry commandRegistry;
-
- private AliasRegistry aliasRegistry;
-
- private BundleContext bundleContext;
-
- private List<Command> commands;
-
- private List<Link> links;
-
- private List<Alias> aliases;
-
- private ApplicationContext applicationContext;
-
- private List<ServiceRegistration> registrations = new ArrayList<ServiceRegistration>();
-
- public CommandBundle() {
- }
-
- public void setApplicationContext(ApplicationContext applicationContext) {
- this.applicationContext = applicationContext;
- }
-
- public List<Command> getCommands() {
- return commands;
- }
-
- public void setCommands(final List<Command> commands) {
- assert commands != null;
-
- this.commands = commands;
- }
-
- public List<Link> getLinks() {
- return links;
- }
-
- public void setLinks(List<Link> links) {
- assert links != null;
-
- this.links = links;
- }
-
- public List<Alias> getAliases() {
- return aliases;
- }
-
- public void setAliases(List<Alias> aliases) {
- assert aliases != null;
-
- this.aliases = aliases;
- }
-
- public void setBundleContext(BundleContext bundleContext) {
- this.bundleContext = bundleContext;
- }
-
- public void afterPropertiesSet() throws Exception {
- log.debug("Initializing command bundle");
- if (commandRegistry == null) {
- String[] names = applicationContext.getBeanNamesForType(CommandRegistry.class);
- if (names.length == 1) {
- commandRegistry = (CommandRegistry) applicationContext.getBean(names[0], CommandRegistry.class);
- }
- }
- if (aliasRegistry == null) {
- String[] names = applicationContext.getBeanNamesForType(AliasRegistry.class);
- if (names.length == 1) {
- aliasRegistry = (AliasRegistry) applicationContext.getBean(names[0], AliasRegistry.class);
- }
- }
- if (commandRegistry != null && aliasRegistry != null) {
- log.debug("Command bundle is using the auto wired command/alias registry");
- if (commands != null) {
- for (Command command : commands) {
- log.debug("Registering command: {}", command.getLocation());
- commandRegistry.registerCommand(command);
- }
- }
- if (links != null) {
- for (Link link : links) {
- log.debug("Registering link: {}", link.getName());
- LinkCommand cmd = new LinkCommand(commandRegistry, link.getTarget());
- cmd.setLocation(new CommandLocationImpl(link.getName()));
- commandRegistry.registerCommand(cmd);
- }
- }
- if (aliases != null) {
- for (Alias alias : aliases) {
- log.debug("Registering alias: {}", alias.getName());
- aliasRegistry.registerAlias(alias.getName(), alias.getAlias());
- }
- }
- } else if (bundleContext != null) {
- log.debug("Command bundle is using the OSGi registry");
- if (commands != null) {
- for (Command command : commands) {
- log.debug("Registering command: {}", command.getLocation());
- Dictionary props = new Properties();
- props.put(OsgiCommandRegistry.NAME, command.getLocation().getFullPath());
- registrations.add(bundleContext.registerService(Command.class.getName(), command, props));
- }
- }
- if (links != null) {
- for (Link link : links) {
- log.debug("Registering link: {}", link.getName());
- registrations.add(bundleContext.registerService(Link.class.getName(), link, new Properties()));
- }
- }
- if (aliases != null) {
- for (Alias alias : aliases) {
- log.debug("Registering alias: {}", alias.getName());
- Dictionary props = new Properties();
- registrations.add(bundleContext.registerService(Alias.class.getName(), alias, new Properties()));
- }
- }
- } else {
- throw new Exception("Command bundle should be wired to the command/alias registry or be used in an OSGi context");
- }
- }
-
- public void destroy() {
- log.debug("Destroying command bundle");
- for (ServiceRegistration reg : registrations) {
- reg.unregister();
- }
- }
-
-}
diff --git a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/LocalConsole.java b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/LocalConsole.java
index 98c7193..0e27e54 100644
--- a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/LocalConsole.java
+++ b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/LocalConsole.java
@@ -31,9 +31,8 @@
import org.osgi.framework.FrameworkListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.osgi.context.BundleContextAware;
-public class LocalConsole implements Runnable, BundleContextAware {
+public class LocalConsole implements Runnable {
private final Logger log = LoggerFactory.getLogger(getClass());
diff --git a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/OsgiCommandSupport.java b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/OsgiCommandSupport.java
index e13940a..4bac1d7 100644
--- a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/OsgiCommandSupport.java
+++ b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/OsgiCommandSupport.java
@@ -29,9 +29,8 @@
import org.apache.geronimo.gshell.io.IO;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import org.springframework.osgi.context.BundleContextAware;
-public abstract class OsgiCommandSupport implements CommandAction, BundleContextAware {
+public abstract class OsgiCommandSupport implements CommandAction {
protected Log log = LogFactory.getLog(getClass());
protected BundleContext bundleContext;
diff --git a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/config/CommandParser.java b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/config/CommandParser.java
deleted file mode 100644
index 45d9d7d..0000000
--- a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/config/CommandParser.java
+++ /dev/null
@@ -1,474 +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.servicemix.kernel.gshell.core.config;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.w3c.dom.Element;
-
-import org.apache.geronimo.gshell.command.Alias;
-import org.apache.geronimo.gshell.command.Link;
-import org.apache.geronimo.gshell.wisdom.command.AliasImpl;
-import org.apache.geronimo.gshell.wisdom.command.ConfigurableCommandCompleter;
-import org.apache.geronimo.gshell.wisdom.command.LinkImpl;
-import org.apache.geronimo.gshell.wisdom.registry.CommandLocationImpl;
-import org.apache.servicemix.kernel.gshell.core.CommandBundle;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.BeanDefinitionStoreException;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.config.BeanDefinitionHolder;
-import org.springframework.beans.factory.config.RuntimeBeanReference;
-import org.springframework.beans.factory.support.AbstractBeanDefinition;
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.support.GenericBeanDefinition;
-import org.springframework.beans.factory.support.ManagedList;
-import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
-import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.springframework.util.StringUtils;
-import org.springframework.util.xml.DomUtils;
-
-public class CommandParser extends AbstractBeanDefinitionParser {
-
- public static final String ID = ID_ATTRIBUTE;
-
- public static final String DESCRIPTION = "description";
-
- public static final String PLUGIN_TEMPLATE = "pluginTemplate";
-
- public static final String ACTION = "action";
-
- public static final String ACTION_ID = "actionId";
-
- public static final String COMMAND_TEMPLATE_SUFFIX = "CommandTemplate";
-
- public static final String COMMAND_BUNDLE = "command-bundle";
-
- public static final String NAME = "name";
-
- public static final String LOCATION = "location";
-
- public static final String COMMANDS = "commands";
-
- public static final String COMMAND = "command";
-
- public static final String TYPE = "type";
-
- public static final String DOCUMENTER = "documenter";
-
- public static final String COMPLETER = "completer";
-
- public static final String COMPLETERS = "completers";
-
- public static final String BEAN = "bean";
-
- public static final String REF = "ref";
-
- public static final String NULL = "null";
-
- public static final String MESSAGE_SOURCE = "message-source";
-
- public static final String MESSAGES = "messages";
-
- public static final String PROTOTYPE = "prototype";
-
- public static final String ALIAS = "alias";
-
- public static final String ALIASES = "aliases";
-
- public static final String LINK = "link";
-
- public static final String LINKS = "links";
-
- public static final String TARGET = "target";
-
- @Override
- protected boolean shouldGenerateId() {
- return true;
- }
-
- @Override
- protected boolean shouldGenerateIdAsFallback() {
- return true;
- }
-
- protected AbstractBeanDefinition parseInternal(final Element element, final ParserContext context) {
- assert element != null;
- assert context != null;
-
- Builder builder = new Builder(context);
- BeanDefinitionBuilder plugin = builder.parseCommandBundle(element);
- return plugin.getBeanDefinition();
- }
-
- /**
- * Helper to deal with command type.
- */
- private enum CommandType
- {
- STATELESS,
- STATEFUL;
-
- public static CommandType parse(final String text) {
- assert text != null;
-
- return valueOf(text.toUpperCase());
- }
-
- public String getTemplateName() {
- return name().toLowerCase() + COMMAND_TEMPLATE_SUFFIX;
- }
-
- public void wire(final BeanDefinitionBuilder command, final BeanDefinitionHolder action) {
- assert command != null;
- assert action != null;
-
- switch (this) {
- case STATELESS:
- command.addPropertyReference(ACTION, action.getBeanName());
- break;
-
- case STATEFUL:
- command.addPropertyValue(ACTION_ID, action.getBeanName());
- break;
- }
- }
- }
-
- /**
- * Helper to build plugin related bean definitions.
- */
- private class Builder
- {
- private final Logger log = LoggerFactory.getLogger(getClass());
-
- private ParserContext context;
-
- public Builder(final ParserContext context) {
- assert context != null;
-
- this.context = context;
- }
-
- private String resolveId(final Element element, final BeanDefinition def) throws BeanDefinitionStoreException {
- assert element != null;
- assert def != null;
-
- if (shouldGenerateId()) {
- return context.getReaderContext().generateBeanName(def);
- }
-
- String id = element.getAttribute(ID_ATTRIBUTE);
-
- if (!StringUtils.hasText(id) && shouldGenerateIdAsFallback()) {
- id = context.getReaderContext().generateBeanName(def);
- }
-
- return id;
- }
-
- @SuppressWarnings({"unchecked"})
- private List<Element> getChildElements(final Element element, final String name) {
- assert element != null;
- assert name != null;
-
- return DomUtils.getChildElementsByTagName(element, name);
- }
-
- @SuppressWarnings({"unchecked"})
- private List<Element> getChildElements(final Element element, final String[] names) {
- assert element != null;
- assert names != null;
-
- return DomUtils.getChildElementsByTagName(element, names);
- }
-
- @SuppressWarnings({"unchecked"})
- private Element getChildElement(final Element element, final String name) {
- assert element != null;
- assert name != null;
-
- List<Element> elements = DomUtils.getChildElementsByTagName(element, name);
- if (elements != null && !elements.isEmpty()) {
- return elements.get(0);
- }
- return null;
- }
-
- private BeanDefinitionParserDelegate createBeanDefinitionParserDelegate(final Element element) {
- assert element != null;
-
- BeanDefinitionParserDelegate parser = new BeanDefinitionParserDelegate(context.getReaderContext());
- parser.initDefaults(element.getOwnerDocument().getDocumentElement());
- return parser;
- }
-
- private BeanDefinitionHolder parseBeanDefinitionElement(final Element element) {
- assert element != null;
-
- BeanDefinitionParserDelegate parser = createBeanDefinitionParserDelegate(element);
- return parser.parseBeanDefinitionElement(element);
- }
-
- private void parseAndApplyDescription(final Element element, final BeanDefinition def) {
- assert element != null;
- assert def != null;
-
- Element desc = getChildElement(element, DESCRIPTION);
- if (desc != null) {
- if (def instanceof AbstractBeanDefinition) {
- ((AbstractBeanDefinition)def).setDescription(desc.getTextContent());
- }
- }
- }
-
- private void parseAndApplyDescription(final Element element, final BeanDefinitionBuilder builder) {
- assert element != null;
- assert builder != null;
-
- parseAndApplyDescription(element, builder.getRawBeanDefinition());
- }
-
- private BeanDefinitionHolder register(final BeanDefinitionHolder holder) {
- assert holder != null;
-
- registerBeanDefinition(holder, context.getRegistry());
- return holder;
- }
-
- private BeanDefinitionHolder register(final BeanDefinition def, final String id) {
- assert def != null;
- assert id != null;
-
- BeanDefinitionHolder holder = new BeanDefinitionHolder(def, id);
- return register(holder);
- }
-
- //
- // <gshell:command-bundle>
- //
-
- private BeanDefinitionBuilder parseCommandBundle(final Element element) {
- assert element != null;
-
- log.trace("Parse command bundle; element; {}", element);
-
- BeanDefinitionBuilder bundle = BeanDefinitionBuilder.rootBeanDefinition(CommandBundle.class);
- parseAndApplyDescription(element, bundle);
-
- //
- // TODO: Figure out how we can save the order of <gshell:command> and <gshell:link> so that 'help' displays them in the order they are defined
- //
-
- ManagedList commands = new ManagedList();
- commands.addAll(parseCommands(element));
- bundle.addPropertyValue(COMMANDS, commands);
-
- ManagedList links = new ManagedList();
- links.addAll(parseLinks(element));
- bundle.addPropertyValue(LINKS, links);
-
- ManagedList aliases = new ManagedList();
- aliases.addAll(parseAliases(element));
- bundle.addPropertyValue(ALIASES, aliases);
-
- return bundle;
- }
-
- //
- // <gshell:command>
- //
-
- private List<BeanDefinition> parseCommands(final Element element) {
- assert element != null;
-
- log.trace("Parse commands; element; {}", element);
-
- List<BeanDefinition> commands = new ArrayList<BeanDefinition>();
-
- List<Element> children = getChildElements(element, COMMAND);
-
- for (Element child : children) {
- BeanDefinitionBuilder command = parseCommand(child);
- commands.add(command.getBeanDefinition());
- }
-
- return commands;
- }
-
- private BeanDefinitionBuilder parseCommand(final Element element) {
- assert element != null;
-
- log.trace("Parse command; element; {}", element);
-
- CommandType type = CommandType.parse(element.getAttribute(TYPE));
- BeanDefinitionBuilder command = BeanDefinitionBuilder.childBeanDefinition(type.getTemplateName());
- parseAndApplyDescription(element, command);
-
- Element child;
-
- // Required children elements
-
- String name = element.getAttribute(NAME);
- BeanDefinition def = new GenericBeanDefinition();
- def.setBeanClassName(CommandLocationImpl.class.getName());
- def.getConstructorArgumentValues().addGenericArgumentValue(name);
- command.addPropertyValue(LOCATION, def);
-
- child = getChildElement(element, ACTION);
- BeanDefinitionHolder action = parseCommandAction(child);
- type.wire(command, action);
-
- // Optional children elements
-
- child = getChildElement(element, DOCUMENTER);
- if (child != null) {
- BeanDefinitionHolder holder = parseBeanDefinitionElement(child);
- command.addPropertyValue(DOCUMENTER, holder.getBeanDefinition());
- }
-
- child = getChildElement(element, COMPLETER);
- if (child != null) {
- BeanDefinitionHolder holder = parseBeanDefinitionElement(child);
- command.addPropertyValue(COMPLETER, holder.getBeanDefinition());
- }
-
- child = getChildElement(element, COMPLETERS);
- if (child != null) {
- BeanDefinitionBuilder completer = parseCommandCompleters(child);
- command.addPropertyValue(COMPLETER, completer.getBeanDefinition());
- }
-
- child = getChildElement(element, MESSAGE_SOURCE);
- if (child != null) {
- BeanDefinitionHolder holder = parseBeanDefinitionElement(child);
- command.addPropertyValue(MESSAGES, holder.getBeanDefinition());
- }
-
- //String id = resolveId(element, command.getBeanDefinition());
- //BeanDefinitionHolder holder = register(command.getBeanDefinition(), id);
-
- return command;
- }
-
- //
- // <gshell:completers>
- //
-
- private BeanDefinitionBuilder parseCommandCompleters(final Element element) {
- assert element != null;
-
- BeanDefinitionBuilder completer = BeanDefinitionBuilder.rootBeanDefinition(ConfigurableCommandCompleter.class);
-
- ManagedList completers = new ManagedList();
-
- List<Element> children = getChildElements(element, new String[] {BEAN, REF, NULL});
-
- for (Element child : children) {
- if (DomUtils.nodeNameEquals(child, BEAN)) {
- BeanDefinitionHolder holder = parseBeanDefinitionElement(child);
- // noinspection unchecked
- completers.add(holder.getBeanDefinition());
- }
- else if (DomUtils.nodeNameEquals(child, REF)) {
- BeanDefinitionParserDelegate parser = createBeanDefinitionParserDelegate(child);
- RuntimeBeanReference ref = (RuntimeBeanReference) parser.parsePropertySubElement(child, completer.getRawBeanDefinition());
- // noinspection unchecked
- completers.add(ref);
- }
- else if (DomUtils.nodeNameEquals(child, NULL)) {
- // noinspection unchecked
- completers.add(null);
- }
- }
-
- completer.addConstructorArgValue(completers);
-
- return completer;
- }
-
- //
- // <gshell:action>
- //
-
- private BeanDefinitionHolder parseCommandAction(final Element element) {
- assert element != null;
-
- log.trace("Parse command action; element; {}", element);
-
- // Construct the action
- BeanDefinition action = parseBeanDefinitionElement(element).getBeanDefinition();
-
- // All actions are configured as prototypes
- action.setScope(PROTOTYPE);
-
- // Generate id and register the bean
- String id = resolveId(element, action);
- return register(action, id);
- }
-
- //
- // <gshell:link>
- //
-
- private List<Link> parseLinks(final Element element) {
- assert element != null;
-
- log.trace("Parse links; element; {}", element);
-
- List<Link> links = new ArrayList<Link>();
-
- List<Element> children = getChildElements(element, LINK);
-
- for (Element child : children) {
- String name = child.getAttribute(NAME);
- String target = child.getAttribute(TARGET);
-
- links.add(new LinkImpl(name, target));
- }
-
- return links;
- }
-
- //
- // <gshell:alias>
- //
-
- private List<Alias> parseAliases(final Element element) {
- assert element != null;
-
- log.trace("Parse aliases; element; {}", element);
-
- List<Alias> aliases = new ArrayList<Alias>();
-
- List<Element> children = getChildElements(element, ALIAS);
-
- for (Element child : children) {
- String name = child.getAttribute(NAME);
- String alias = child.getAttribute(ALIAS);
-
- aliases.add(new AliasImpl(name, alias));
- }
-
- return aliases;
- }
- }
-}
diff --git a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/config/NamespaceHandler.java b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/config/NamespaceHandler.java
index 3e464d3..19984c9 100644
--- a/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/config/NamespaceHandler.java
+++ b/gshell/gshell-core/src/main/java/org/apache/servicemix/kernel/gshell/core/config/NamespaceHandler.java
@@ -18,12 +18,258 @@
*/
package org.apache.servicemix.kernel.gshell.core.config;
-import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+import java.net.URL;
+import java.util.List;
-public class NamespaceHandler extends NamespaceHandlerSupport {
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
- public void init() {
- registerBeanDefinitionParser(CommandParser.COMMAND_BUNDLE, new CommandParser());
+import org.apache.geronimo.blueprint.ExtendedParserContext;
+import org.apache.geronimo.blueprint.mutable.MutableBeanMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableCollectionMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableIdRefMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableServiceMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableValueMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableRefMetadata;
+import org.apache.geronimo.gshell.command.Alias;
+import org.apache.geronimo.gshell.command.Command;
+import org.apache.geronimo.gshell.command.Link;
+import org.apache.geronimo.gshell.wisdom.command.AliasImpl;
+import org.apache.geronimo.gshell.wisdom.command.CommandMessageSource;
+import org.apache.geronimo.gshell.wisdom.command.LinkImpl;
+import org.apache.geronimo.gshell.wisdom.command.MessageSourceCommandDocumenter;
+import org.apache.geronimo.gshell.wisdom.command.StatefulCommand;
+import org.apache.geronimo.gshell.wisdom.command.StatelessCommand;
+import org.apache.geronimo.gshell.wisdom.command.ConfigurableCommandCompleter;
+import org.apache.geronimo.gshell.wisdom.registry.CommandLocationImpl;
+import org.apache.servicemix.kernel.gshell.core.BeanContainerWrapper;
+import org.osgi.service.blueprint.context.ComponentDefinitionException;
+import org.osgi.service.blueprint.context.BlueprintContext;
+import org.osgi.service.blueprint.namespace.ParserContext;
+import org.osgi.service.blueprint.reflect.BeanArgument;
+import org.osgi.service.blueprint.reflect.BeanProperty;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.IdRefMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.ValueMetadata;
+import org.osgi.service.blueprint.reflect.RefMetadata;
+
+
+public class NamespaceHandler implements org.osgi.service.blueprint.namespace.NamespaceHandler {
+
+ public static final String ID = "id";
+ public static final String DESCRIPTION = "description";
+ public static final String PLUGIN_TEMPLATE = "pluginTemplate";
+ public static final String ACTION = "action";
+ public static final String ACTION_ID = "actionId";
+ public static final String COMMAND_TEMPLATE_SUFFIX = "CommandTemplate";
+ public static final String COMMAND_BUNDLE = "command-bundle";
+ public static final String NAME = "name";
+ public static final String LOCATION = "location";
+ public static final String COMMANDS = "commands";
+ public static final String COMMAND = "command";
+ public static final String TYPE = "type";
+ public static final String DOCUMENTER = "documenter";
+ public static final String COMPLETER = "completer";
+ public static final String COMPLETERS = "completers";
+ public static final String BEAN = "bean";
+ public static final String REF = "ref";
+ public static final String NULL = "null";
+ public static final String MESSAGE_SOURCE = "message-source";
+ public static final String MESSAGES = "messages";
+ public static final String PROTOTYPE = "prototype";
+ public static final String ALIAS = "alias";
+ public static final String ALIASES = "aliases";
+ public static final String LINK = "link";
+ public static final String LINKS = "links";
+ public static final String TARGET = "target";
+
+ public static final String TYPE_STATEFUL = "stateful";
+ public static final String TYPE_STATELESS = "stateless";
+
+ private int nameCounter = 0;
+
+ public URL getSchemaLocation(String namespace) {
+ return getClass().getResource("/org/apache/servicemix/kernel/gshell/core/servicemix-gshell.xsd");
}
+ public ComponentMetadata decorate(Node node, ComponentMetadata component, ParserContext context) {
+ throw new ComponentDefinitionException("Bad xml syntax: node decoration is not supported");
+ }
+
+ public ComponentMetadata parse(Element element, ParserContext ctx) {
+ ExtendedParserContext context = (ExtendedParserContext) ctx;
+ if (nodeNameEquals(element, COMMAND_BUNDLE)) {
+ NodeList children = element.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if (child instanceof Element) {
+ Element childElement = (Element) child;
+ parseChildElement(childElement, context);
+ }
+ }
+ return null;
+ }
+ throw new ComponentDefinitionException("Bad xml syntax: unknown element '" + element.getNodeName() + "'");
+ }
+
+ private void parseChildElement(Element element, ExtendedParserContext context) {
+ if (nodeNameEquals(element, COMMAND)) {
+ parseCommand(element, context);
+ } else if (nodeNameEquals(element, LINK)) {
+ parseLink(element, context);
+ } else if (nodeNameEquals(element, ALIAS)) {
+ parseAlias(element, context);
+ }
+ }
+
+ private void parseCommand(Element element, ExtendedParserContext context) {
+ MutableBeanMetadata command = context.createMetadata(MutableBeanMetadata.class);
+ String type = element.hasAttribute(TYPE) ? element.getAttribute(TYPE) : TYPE_STATEFUL;
+ boolean stateful;
+ if (TYPE_STATEFUL.equals(type)) {
+ command.setClassName(StatefulCommand.class.getName());
+ stateful = true;
+ } else if (TYPE_STATELESS.equals(type)) {
+ command.setClassName(StatelessCommand.class.getName());
+ stateful = false;
+ } else {
+ throw new ComponentDefinitionException("Bad xml syntax: unknown value '" + type + "' for attribute " + TYPE);
+ }
+ MutableBeanMetadata beanContainer = context.createMetadata(MutableBeanMetadata.class);
+ beanContainer.setClassName(BeanContainerWrapper.class.getName());
+ beanContainer.addArgument(createRef(context, "blueprintContext"), BlueprintContext.class.getName(), 0);
+ command.addProperty("beanContainer", beanContainer);
+ MutableBeanMetadata documenter = context.createMetadata(MutableBeanMetadata.class);
+ documenter.setClassName(MessageSourceCommandDocumenter.class.getName());
+ command.addProperty(DOCUMENTER, documenter);
+ MutableBeanMetadata messages = context.createMetadata(MutableBeanMetadata.class);
+ messages.setClassName(CommandMessageSource.class.getName());
+ command.addProperty(MESSAGES, messages);
+ MutableBeanMetadata location = context.createMetadata(MutableBeanMetadata.class);
+ location.setClassName(CommandLocationImpl.class.getName());
+ location.addArgument(createStringValue(context, element.getAttribute(NAME)), String.class.getName(), 0);
+ command.addProperty(LOCATION, location);
+
+ boolean hasAction = false;
+ NodeList children = element.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if (child instanceof Element) {
+ Element childElement = (Element) child;
+ if (nodeNameEquals(childElement, ACTION)) {
+ if (hasAction) {
+ throw new ComponentDefinitionException("Only one " + ACTION + " element can be set for a given command");
+ }
+ hasAction = true;
+ MutableBeanMetadata action = parseAction(context, command, childElement);
+ // TODO: parse other stuff or remove it from schema
+ if (stateful) {
+ action.setId(getName());
+ context.getComponentDefinitionRegistry().registerComponentDefinition(action);
+ command.addProperty(ACTION_ID, createIdRef(context, action.getId()));
+ } else {
+ command.addProperty(ACTION, action);
+ }
+ } else if (nodeNameEquals(childElement, COMPLETERS)) {
+ command.addProperty(COMPLETER, parseCompleters(context, command, childElement));
+ } else {
+ throw new ComponentDefinitionException("Bad xml syntax: unknown element '" + childElement.getNodeName() + "'");
+ }
+ }
+ }
+
+ MutableServiceMetadata commandService = context.createMetadata(MutableServiceMetadata.class);
+ commandService.setId(getName());
+ commandService.addInterfaceName(Command.class.getName());
+ commandService.setServiceComponent(command);
+ context.getComponentDefinitionRegistry().registerComponentDefinition(commandService);
+ }
+
+ private MutableBeanMetadata parseAction(ExtendedParserContext context, ComponentMetadata enclosingComponent, Element element) {
+ MutableBeanMetadata action = context.createMetadata(MutableBeanMetadata.class);
+ action.setClassName(element.getAttribute("class"));
+ NodeList children = element.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if (child instanceof Element) {
+ Element childElement = (Element) child;
+ if (nodeNameEquals(childElement, "argument")) {
+ action.addArgument(context.parseElement(BeanArgument.class, enclosingComponent, childElement));
+ } else if (nodeNameEquals(childElement, "property")) {
+ action.addProperty(context.parseElement(BeanProperty.class, enclosingComponent, childElement));
+ }
+ }
+ }
+ return action;
+ }
+
+ private Metadata parseCompleters(ExtendedParserContext context, ComponentMetadata enclosingComponent, Element element) {
+ MutableBeanMetadata completer = context.createMetadata(MutableBeanMetadata.class);
+ completer.setClassName(ConfigurableCommandCompleter.class.getName());
+ MutableCollectionMetadata collection = context.createMetadata(MutableCollectionMetadata.class);
+ collection.setCollectionClass(List.class);
+ NodeList children = element.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if (child instanceof Element) {
+ collection.addValue(context.parseElement(Metadata.class, enclosingComponent, (Element) child));
+ }
+ }
+ completer.addArgument(collection, List.class.getName(), 0);
+ return completer;
+ }
+
+ private void parseLink(Element element, ExtendedParserContext context) {
+ MutableBeanMetadata link = context.createMetadata(MutableBeanMetadata.class);
+ link.setClassName(LinkImpl.class.getName());
+ link.addArgument(createStringValue(context, element.getAttribute(NAME)), String.class.getName(), 0);
+ link.addArgument(createStringValue(context, element.getAttribute(TARGET)), String.class.getName(), 0);
+
+ MutableServiceMetadata linkService = context.createMetadata(MutableServiceMetadata.class);
+ linkService.setId(getName());
+ linkService.addInterfaceName(Link.class.getName());
+ linkService.setServiceComponent(link);
+ context.getComponentDefinitionRegistry().registerComponentDefinition(linkService);
+ }
+
+ private void parseAlias(Element element, ExtendedParserContext context) {
+ MutableBeanMetadata alias = context.createMetadata(MutableBeanMetadata.class);
+ alias.setClassName(AliasImpl.class.getName());
+ alias.addArgument(createStringValue(context, element.getAttribute(NAME)), String.class.getName(), 0);
+ alias.addArgument(createStringValue(context, element.getAttribute(ALIAS)), String.class.getName(), 0);
+
+ MutableServiceMetadata aliasService = context.createMetadata(MutableServiceMetadata.class);
+ aliasService.setId(getName());
+ aliasService.addInterfaceName(Alias.class.getName());
+ aliasService.setServiceComponent(alias);
+ context.getComponentDefinitionRegistry().registerComponentDefinition(aliasService);
+ }
+
+ private ValueMetadata createStringValue(ExtendedParserContext context, String str) {
+ MutableValueMetadata value = context.createMetadata(MutableValueMetadata.class);
+ value.setStringValue(str);
+ return value;
+ }
+
+ private RefMetadata createRef(ExtendedParserContext context, String id) {
+ MutableRefMetadata idref = context.createMetadata(MutableRefMetadata.class);
+ idref.setComponentId(id);
+ return idref;
+ }
+
+ private IdRefMetadata createIdRef(ExtendedParserContext context, String id) {
+ MutableIdRefMetadata idref = context.createMetadata(MutableIdRefMetadata.class);
+ idref.setComponentId(id);
+ return idref;
+ }
+
+ public synchronized String getName() {
+ return "gshell-" + ++nameCounter;
+ }
+
+ private static boolean nodeNameEquals(Node node, String name) {
+ return (name.equals(node.getNodeName()) || name.equals(node.getLocalName()));
+ }
}
diff --git a/gshell/gshell-core/src/main/resources/META-INF/spring.handlers b/gshell/gshell-core/src/main/resources/META-INF/spring.handlers
deleted file mode 100644
index 2315764..0000000
--- a/gshell/gshell-core/src/main/resources/META-INF/spring.handlers
+++ /dev/null
@@ -1,24 +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.
-##
-
-##
-## $Rev: 697807 $ $Date: 2008-09-22 20:12:04 +0700 (Mon, 22 Sep 2008) $
-##
-
-http\://servicemix.apache.org/schema/servicemix-gshell=org.apache.servicemix.kernel.gshell.core.config.NamespaceHandler
\ No newline at end of file
diff --git a/gshell/gshell-core/src/main/resources/META-INF/spring.schemas b/gshell/gshell-core/src/main/resources/META-INF/spring.schemas
deleted file mode 100644
index 67eca68..0000000
--- a/gshell/gshell-core/src/main/resources/META-INF/spring.schemas
+++ /dev/null
@@ -1,24 +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.
-##
-
-##
-## $Rev: 697807 $ $Date: 2008-09-22 20:12:04 +0700 (Mon, 22 Sep 2008) $
-##
-
-http\://servicemix.apache.org/schema/servicemix-gshell/servicemix-gshell.xsd=org/apache/servicemix/kernel/gshell/core/servicemix-gshell.xsd
diff --git a/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-local.xml b/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-local.xml
deleted file mode 100644
index a047339..0000000
--- a/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-local.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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:util="http://www.springframework.org/schema/util"
- xmlns:osgi="http://www.springframework.org/schema/osgi"
- 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"
- default-autowire="no"
- default-dependency-check="none"
- default-init-method="init"
- default-destroy-method="destroy">
-
- <bean id="localShellWrapped" parent="shell" init-method="init" destroy-method="close"/>
-
- <bean id="localShell" class="org.apache.servicemix.kernel.gshell.core.ShellWrapper">
- <constructor-arg ref="localShellWrapped" />
- </bean>
-
- <osgi:reference id="mainService" interface="org.apache.servicemix.kernel.main.spi.MainService"/>
-
- <bean id="localConsole" class="org.apache.servicemix.kernel.gshell.core.LocalConsole">
- <property name="createLocalShell" value="${servicemix.startLocalConsole}"/>
- <property name="shell" ref="localShell"/>
- <property name="mainService" ref="mainService" />
- </bean>
-
-</beans>
\ No newline at end of file
diff --git a/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-osgi.xml b/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-osgi.xml
deleted file mode 100644
index b99626a..0000000
--- a/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-osgi.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?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:ctx="http://www.springframework.org/schema/context"
- 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/context
- http://www.springframework.org/schema/context/spring-context.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"
- default-autowire="no"
- default-dependency-check="none"
- default-init-method="init"
- default-destroy-method="destroy">
-
- <bean id="osgiCommandRegistry" class="org.apache.servicemix.kernel.gshell.core.OsgiCommandRegistry">
- <constructor-arg ref="commandRegistry" />
- </bean>
-
- <bean id="osgiAliasRegistry" class="org.apache.servicemix.kernel.gshell.core.OsgiAliasRegistry">
- <constructor-arg ref="aliasRegistry" />
- </bean>
-
- <osgi:list id="osgiCommands" interface="org.apache.geronimo.gshell.command.Command" cardinality="0..N">
- <osgi:listener ref="osgiCommandRegistry" bind-method="register" unbind-method="unregister" />
- </osgi:list>
-
- <osgi:list id="osgiLinkCommands" interface="org.apache.geronimo.gshell.command.Link" cardinality="0..N">
- <osgi:listener ref="osgiCommandRegistry" bind-method="register" unbind-method="unregister" />
- </osgi:list>
-
- <osgi:list id="osgiAliases" interface="org.apache.geronimo.gshell.command.Alias" cardinality="0..N">
- <osgi:listener ref="osgiAliasRegistry" bind-method="register" unbind-method="unregister" />
- </osgi:list>
-
- <osgi:service ref="localShell" interface="org.apache.geronimo.gshell.shell.Shell">
- </osgi:service>
-
- <osgi:service ref="commandLineExecutor" interface="org.apache.geronimo.gshell.commandline.CommandLineExecutor">
- </osgi:service>
-
- <osgix:cm-properties id="cmProps" persistent-id="org.apache.servicemix.shell">
- <prop key="sshPort">8101</prop>
- <prop key="sshRealm">servicemix</prop>
- <prop key="hostKey">${servicemix.base}/etc/host.key</prop>
- </osgix:cm-properties>
-
- <ctx:property-placeholder properties-ref="cmProps" />
-
-</beans>
\ No newline at end of file
diff --git a/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-remote.xml b/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-remote.xml
deleted file mode 100644
index d68ee51..0000000
--- a/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-remote.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?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:util="http://www.springframework.org/schema/util"
- xmlns:osgi="http://www.springframework.org/schema/osgi"
- xmlns:jaas="http://servicemix.apache.org/jaas"
- 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://servicemix.apache.org/jaas
- http://servicemix.apache.org/schema/servicemix-jaas.xsd"
- default-autowire="no"
- default-dependency-check="none"
- default-init-method="init"
- default-destroy-method="destroy">
-
- <bean name="sshClient" class="org.apache.sshd.SshClient" factory-method="setUpDefaultClient" init-method="start" destroy-method="stop">
- </bean>
-
- <bean name="sshServer" class="org.apache.sshd.SshServer" factory-method="setUpDefaultServer" scope="prototype">
- <property name="port" value="${sshPort}" />
- <property name="shellFactory">
- <bean class="org.apache.geronimo.gshell.commands.ssh.ShellFactoryImpl">
- <property name="application" ref="application" />
- <property name="completers">
- <list>
- <ref bean="commandsCompleter"/>
- <ref bean="aliasNameCompleter"/>
- </list>
- </property>
- <property name="executor" ref="commandLineExecutor" />
- <property name="prompter">
- <bean class="org.apache.geronimo.gshell.wisdom.shell.ConsolePrompterImpl">
- <constructor-arg ref="application"/>
- </bean>
- </property>
- <property name="errorHandler">
- <bean class="org.apache.geronimo.gshell.wisdom.shell.ConsoleErrorHandlerImpl" />
- </property>
- <property name="history">
- <bean class="org.apache.geronimo.gshell.wisdom.shell.HistoryImpl">
- <constructor-arg ref="application"/>
- </bean>
- </property>
- </bean>
- </property>
- <property name="keyPairProvider" ref="keyPairProvider" />
- <property name="passwordAuthenticator" ref="passwordAuthenticator" />
- </bean>
-
- <bean name="keyPairProvider" class="org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider">
- <property name="path" value="${hostKey}" />
- </bean>
- <bean name="passwordAuthenticator" class="org.apache.sshd.server.jaas.JaasPasswordAuthenticator">
- <property name="domain" value="${sshRealm}" />
- </bean>
-
- <bean id="sshServerFactory" class="org.apache.servicemix.kernel.gshell.core.sshd.SshServerFactory" init-method="start" destroy-method="stop">
- <constructor-arg ref="sshServer" />
- <property name="start" value="${servicemix.startRemoteShell}" />
- </bean>
-
- <!--
- <jaas:config id="SshServer" rank="-1">
- <jaas:module className="org.apache.geronimo.gshell.remote.server.auth.BogusLoginModule" flags="required" />
- </jaas:config>
- -->
-
-</beans>
\ No newline at end of file
diff --git a/gshell/gshell-core/src/main/resources/OSGI-INF/blueprint/gshell-namespacehandler.xml b/gshell/gshell-core/src/main/resources/OSGI-INF/blueprint/gshell-namespacehandler.xml
new file mode 100644
index 0000000..e381ce3
--- /dev/null
+++ b/gshell/gshell-core/src/main/resources/OSGI-INF/blueprint/gshell-namespacehandler.xml
@@ -0,0 +1,29 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+ <service interface="org.osgi.service.blueprint.namespace.NamespaceHandler">
+ <service-properties>
+ <entry key="org.osgi.blueprint.namespace" value="http://servicemix.apache.org/schema/servicemix-gshell"/>
+ </service-properties>
+ <bean class="org.apache.servicemix.kernel.gshell.core.config.NamespaceHandler"/>
+ </service>
+
+</blueprint>
diff --git a/gshell/gshell-core/src/main/resources/org/apache/servicemix/kernel/gshell/core/commands.xml b/gshell/gshell-core/src/main/resources/org/apache/servicemix/kernel/gshell/core/commands.xml
deleted file mode 100644
index 8b91ee1..0000000
--- a/gshell/gshell-core/src/main/resources/org/apache/servicemix/kernel/gshell/core/commands.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?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: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">
-
- <bean class="org.apache.servicemix.kernel.gshell.core.BeanContainerAwareProcessor" />
-
- <bean id="statelessCommandTemplate" class="org.apache.geronimo.gshell.wisdom.command.StatelessCommand" abstract="true">
- <property name="documenter">
- <bean class="org.apache.geronimo.gshell.wisdom.command.MessageSourceCommandDocumenter"/>
- </property>
-
- <property name="messages">
- <bean class="org.apache.geronimo.gshell.wisdom.command.CommandMessageSource"/>
- </property>
- </bean>
-
- <bean id="statefulCommandTemplate" class="org.apache.geronimo.gshell.wisdom.command.StatefulCommand" abstract="true">
- <property name="documenter">
- <bean class="org.apache.geronimo.gshell.wisdom.command.MessageSourceCommandDocumenter"/>
- </property>
-
- <property name="messages">
- <bean class="org.apache.geronimo.gshell.wisdom.command.CommandMessageSource"/>
- </property>
- </bean>
-
-</beans>
\ No newline at end of file
diff --git a/gshell/gshell-core/src/main/resources/org/apache/servicemix/kernel/gshell/core/servicemix-gshell.xsd b/gshell/gshell-core/src/main/resources/org/apache/servicemix/kernel/gshell/core/servicemix-gshell.xsd
index 36a1e1d..9dfa4c9 100644
--- a/gshell/gshell-core/src/main/resources/org/apache/servicemix/kernel/gshell/core/servicemix-gshell.xsd
+++ b/gshell/gshell-core/src/main/resources/org/apache/servicemix/kernel/gshell/core/servicemix-gshell.xsd
@@ -21,29 +21,17 @@
<!-- $Rev: 699828 $ $Date: 2008-09-28 16:35:27 +0200 (Sun, 28 Sep 2008) $ -->
<xsd:schema xmlns="http://servicemix.apache.org/schema/servicemix-gshell"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:beans="http://www.springframework.org/schema/beans"
- targetNamespace="http://servicemix.apache.org/schema/servicemix-gshell"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified">
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:beans="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ targetNamespace="http://servicemix.apache.org/schema/servicemix-gshell"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified">
- <xsd:import namespace="http://www.springframework.org/schema/beans"/>
-
- <xsd:annotation>
- <xsd:documentation>
- Defines the configuration elements for Apache ServiceMix Kernel commands support.
- </xsd:documentation>
- </xsd:annotation>
+ <xsd:import namespace="http://www.osgi.org/xmlns/blueprint/v1.0.0"/>
<xsd:element name="command-bundle">
<xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
- Defines a command bundle.
- </xsd:documentation>
- </xsd:annotation>
<xsd:sequence>
- <xsd:element ref="beans:description" minOccurs="0" maxOccurs="1"/>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="command"/>
<xsd:element ref="alias"/>
@@ -55,33 +43,14 @@
<xsd:element name="command">
<xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
- Defines a command.
- </xsd:documentation>
- </xsd:annotation>
<xsd:sequence>
- <xsd:element ref="beans:description" minOccurs="0" maxOccurs="1"/>
- <!--
- NOTE: Not using an xsd:choice here, as I can't seem to figure out how to get it to properly
- validate the min/max of the containted elements. W/o the xsd:choice the validation
- works, though have to define elements in order :-(
- -->
- <xsd:element ref="action" minOccurs="1" maxOccurs="1"/>
- <xsd:element ref="documenter" minOccurs="0" maxOccurs="1"/>
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element ref="completer"/>
- <xsd:element ref="completers"/>
- </xsd:choice>
- <xsd:element ref="message-source" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="action" type="beans:Tbean" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="documenter" type="beans:Tbean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="completers" type="beans:Tcollection" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="message-source" type="beans:Tbean" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="type" use="optional" default="stateful">
- <xsd:annotation>
- <xsd:documentation>
- The command type.
- </xsd:documentation>
- </xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="stateless"/>
@@ -94,174 +63,13 @@
<xsd:element name="link">
<xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
- Defines a link command.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element ref="beans:description" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="target" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
- <xsd:group name="commandComponentElements">
- <xsd:annotation>
- <xsd:documentation>
- Defines the valid elements for command components. This is based on beans:beanElements,
- stripping off the bits which are not valid in the command component context.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element ref="beans:description" minOccurs="0"/>
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element ref="beans:meta"/>
- <xsd:element ref="beans:constructor-arg"/>
- <xsd:element ref="beans:property"/>
- <xsd:element ref="beans:qualifier"/>
- <xsd:element ref="beans:lookup-method"/>
- <xsd:element ref="beans:replaced-method"/>
- <!--
- NOTE: This seems to cause schema validation problems... not really sure why
- <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
- -->
- </xsd:choice>
- </xsd:sequence>
- </xsd:group>
-
- <xsd:attributeGroup name="commandComponentAttributes">
- <xsd:annotation>
- <xsd:documentation>
- Defines the valid attributes for command components. This is based on beans:beanAttributes,
- stripping off the bits which are not valid in the command component context.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string"/>
- <xsd:attribute name="parent" type="xsd:string"/>
- <xsd:attribute name="autowire" default="default">
- <xsd:simpleType>
- <xsd:restriction base="xsd:NMTOKEN">
- <xsd:enumeration value="default"/>
- <xsd:enumeration value="no"/>
- <xsd:enumeration value="byName"/>
- <xsd:enumeration value="byType"/>
- <xsd:enumeration value="constructor"/>
- <xsd:enumeration value="autodetect"/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="dependency-check" default="default">
- <xsd:simpleType>
- <xsd:restriction base="xsd:NMTOKEN">
- <xsd:enumeration value="default"/>
- <xsd:enumeration value="none"/>
- <xsd:enumeration value="simple"/>
- <xsd:enumeration value="objects"/>
- <xsd:enumeration value="all"/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="depends-on" type="xsd:string"/>
- <xsd:attribute name="autowire-candidate" default="default" type="beans:defaultable-boolean"/>
- <xsd:attribute name="primary" type="xsd:boolean"/>
- <xsd:attribute name="init-method" type="xsd:string"/>
- <xsd:attribute name="destroy-method" type="xsd:string"/>
- <xsd:attribute name="factory-method" type="xsd:string"/>
- <xsd:attribute name="factory-bean" type="xsd:string"/>
- <xsd:anyAttribute namespace="##other" processContents="lax"/>
- </xsd:attributeGroup>
-
- <xsd:complexType name="commandComponent" abstract="true">
- <xsd:annotation>
- <xsd:documentation>
- Support for command component elements, which are all basically just beans.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:group ref="commandComponentElements"/>
- <xsd:attributeGroup ref="commandComponentAttributes"/>
- </xsd:complexType>
-
- <xsd:element name="action">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
- Defines a command action.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="commandComponent"/>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="documenter">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
- Defines a command documenter.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="commandComponent"/>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="completer">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
- Defines a command completer.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="commandComponent"/>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="completers">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
- Defines a configurable command completer with a set of completers.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice minOccurs="1" maxOccurs="unbounded">
- <xsd:element ref="beans:bean"/>
- <xsd:element ref="beans:ref"/>
- <xsd:element ref="beans:null"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="message-source">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
- Defines a command message source.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="commandComponent"/>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
-
<xsd:element name="alias">
<xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
- Defines a command alias.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element ref="beans:description" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="alias" type="xsd:string" use="required"/>
</xsd:complexType>
diff --git a/gshell/gshell-core/src/test/java/org/apache/servicemix/kernel/gshell/core/Test.java b/gshell/gshell-core/src/test/java/org/apache/servicemix/kernel/gshell/core/Test.java
index 0983b12..5504db4 100644
--- a/gshell/gshell-core/src/test/java/org/apache/servicemix/kernel/gshell/core/Test.java
+++ b/gshell/gshell-core/src/test/java/org/apache/servicemix/kernel/gshell/core/Test.java
@@ -30,9 +30,9 @@
ClassPathXmlApplicationContext context = null;
try {
context = new ClassPathXmlApplicationContext(
- new String[] { "META-INF/spring/gshell.xml",
- "META-INF/spring/gshell-vfs.xml",
- "META-INF/spring/gshell-commands.xml",
+ new String[] {"OSGI-INF/blueprint/gshell.xml",
+ "OSGI-INF/blueprint/gshell-vfs.xml",
+ "OSGI-INF/blueprint/gshell-commands.xml",
"org/apache/servicemix/kernel/gshell/core/gshell-test.xml" });
ApplicationManager appMgr = (ApplicationManager) context.getBean("applicationManager");
assertNotNull(appMgr);
@@ -53,9 +53,9 @@
ClassPathXmlApplicationContext context = null;
try {
context = new ClassPathXmlApplicationContext(
- new String[] { "META-INF/spring/gshell.xml",
- "META-INF/spring/gshell-vfs.xml",
- "META-INF/spring/gshell-commands.xml",
+ new String[] {"OSGI-INF/blueprint/gshell.xml",
+ "OSGI-INF/blueprint/gshell-vfs.xml",
+ "OSGI-INF/blueprint/gshell-commands.xml",
"org/apache/servicemix/kernel/gshell/core/gshell-test.xml"});
ApplicationManager appMgr = (ApplicationManager) context.getBean("applicationManager");
assertNotNull(appMgr);
@@ -79,8 +79,8 @@
ClassPathXmlApplicationContext context = null;
try {
context = new ClassPathXmlApplicationContext(
- new String[] { "META-INF/spring/gshell.xml",
- "META-INF/spring/gshell-vfs.xml",
+ new String[] {"OSGI-INF/blueprint/gshell.xml",
+ "OSGI-INF/blueprint/gshell-vfs.xml",
"org/apache/servicemix/kernel/gshell/core/gshell-test-commands.xml",
"org/apache/servicemix/kernel/gshell/core/gshell-test.xml"});
ApplicationManager appMgr = (ApplicationManager) context.getBean("applicationManager");
@@ -105,8 +105,8 @@
ClassPathXmlApplicationContext context = null;
try {
context = new ClassPathXmlApplicationContext(
- new String[] { "META-INF/spring/gshell.xml",
- "META-INF/spring/gshell-vfs.xml",
+ new String[] {"OSGI-INF/blueprint/gshell.xml",
+ "OSGI-INF/blueprint/gshell-vfs.xml",
"org/apache/servicemix/kernel/gshell/core/gshell-test-commands.xml",
"org/apache/servicemix/kernel/gshell/core/gshell-test.xml"});
ApplicationManager appMgr = (ApplicationManager) context.getBean("applicationManager");
@@ -134,8 +134,8 @@
ClassPathXmlApplicationContext context = null;
try {
context = new ClassPathXmlApplicationContext(
- new String[] { "META-INF/spring/gshell.xml",
- "META-INF/spring/gshell-vfs.xml",
+ new String[] {"OSGI-INF/blueprint/gshell.xml",
+ "OSGI-INF/blueprint/gshell-vfs.xml",
"org/apache/servicemix/kernel/gshell/core/gshell-test-commands.xml",
"org/apache/servicemix/kernel/gshell/core/gshell-test.xml"});
ApplicationManager appMgr = (ApplicationManager) context.getBean("applicationManager");
diff --git a/gshell/gshell-features/pom.xml b/gshell/gshell-features/pom.xml
index 22b1c9e..40fd8ad 100644
--- a/gshell/gshell-features/pom.xml
+++ b/gshell/gshell-features/pom.xml
@@ -69,11 +69,13 @@
<groupId>org.apache.servicemix.kernel</groupId>
<artifactId>org.apache.servicemix.kernel.filemonitor</artifactId>
</dependency>
-
+
+ <!--
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-core</artifactId>
</dependency>
+ -->
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
@@ -101,7 +103,6 @@
org.apache.geronimo.gshell.wisdom.command,
org.apache.servicemix.kernel.gshell.core,
org.apache.geronimo.gshell.wisdom.registry,
- org.springframework.beans.factory.config,
*
</Import-Package>
<Private-Package>!*</Private-Package>
diff --git a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureDeploymentListener.java b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureDeploymentListener.java
index e4a036b..ef0ef46 100644
--- a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureDeploymentListener.java
+++ b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureDeploymentListener.java
@@ -47,15 +47,11 @@
import org.osgi.framework.BundleEvent;
import org.osgi.framework.Constants;
import org.osgi.framework.SynchronousBundleListener;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.osgi.context.BundleContextAware;
/**
* A deployment listener able to hot deploy a feature descriptor
*/
-public class FeatureDeploymentListener implements DeploymentListener, SynchronousBundleListener, BundleContextAware,
- InitializingBean, DisposableBean {
+public class FeatureDeploymentListener implements DeploymentListener, SynchronousBundleListener {
public static final String FEATURE_PATH = "org.apache.servicemix.kernel.gshell.features";
diff --git a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureImpl.java b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureImpl.java
index 07806d3..faac694 100644
--- a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureImpl.java
+++ b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureImpl.java
@@ -22,13 +22,11 @@
import java.util.Map;
import org.apache.servicemix.kernel.gshell.features.Feature;
-import org.springframework.jmx.export.annotation.ManagedAttribute;
-import org.springframework.jmx.export.annotation.ManagedResource;
/**
* A feature
*/
-@ManagedResource(description = "Managed Feature", currencyTimeLimit = 15)
+//@ManagedResource(description = "Managed Feature", currencyTimeLimit = 15)
public class FeatureImpl implements Feature {
private String id;
@@ -50,17 +48,17 @@
this.id = name + "-" + version;
}
- @ManagedAttribute(description = "Feature Unique ID")
+// @ManagedAttribute(description = "Feature Unique ID")
public String getId() {
return id;
}
- @ManagedAttribute(description = "Feature Name")
+// @ManagedAttribute(description = "Feature Name")
public String getName() {
return name;
}
- @ManagedAttribute(description = "Feature Version")
+// @ManagedAttribute(description = "Feature Version")
public String getVersion() {
return version;
}
@@ -69,7 +67,7 @@
this.version = version;
}
- @ManagedAttribute(description = "List of Dependencies")
+// @ManagedAttribute(description = "List of Dependencies")
public List<Feature> getDependencies() {
return dependencies;
}
diff --git a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeaturesServiceImpl.java b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeaturesServiceImpl.java
index 1c03515..61c794c 100644
--- a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeaturesServiceImpl.java
+++ b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeaturesServiceImpl.java
@@ -53,7 +53,6 @@
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
import org.osgi.service.prefs.PreferencesService;
-import org.springframework.osgi.context.BundleContextAware;
/**
* The Features service implementation.
@@ -62,7 +61,7 @@
* installing the needed bundles.
*
*/
-public class FeaturesServiceImpl implements FeaturesService, BundleContextAware {
+public class FeaturesServiceImpl implements FeaturesService {
private static final String ALIAS_KEY = "_alias_factory_pid";
diff --git a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/RepositoryImpl.java b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/RepositoryImpl.java
index 485c3d4..4d39e39 100644
--- a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/RepositoryImpl.java
+++ b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/RepositoryImpl.java
@@ -39,15 +39,12 @@
import org.apache.servicemix.kernel.gshell.features.Feature;
import org.apache.servicemix.kernel.gshell.features.Repository;
-import org.springframework.jmx.export.annotation.ManagedAttribute;
-import org.springframework.jmx.export.annotation.ManagedOperation;
-import org.springframework.jmx.export.annotation.ManagedResource;
import org.xml.sax.SAXException;
/**
* The repository implementation.
*/
-@ManagedResource
+//@ManagedResource
public class RepositoryImpl implements Repository {
private URI uri;
@@ -58,12 +55,12 @@
this.uri = uri;
}
- @ManagedAttribute
+// @ManagedAttribute
public URI getURI() {
return uri;
}
- @ManagedOperation
+// @ManagedOperation
public URI[] getRepositories() throws Exception {
if (repositories == null) {
load();
@@ -71,7 +68,7 @@
return repositories.toArray(new URI[repositories.size()]);
}
- @ManagedOperation(description = "List of Features provided by this repository")
+// @ManagedOperation(description = "List of Features provided by this repository")
public Feature[] getFeatures() throws Exception {
if (features == null) {
load();
diff --git a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagedFeature.java b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagedFeature.java
index 1da589b..111bbda 100644
--- a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagedFeature.java
+++ b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagedFeature.java
@@ -20,14 +20,11 @@
import org.apache.servicemix.kernel.gshell.features.Feature;
import org.apache.servicemix.kernel.gshell.features.FeaturesService;
-import org.springframework.jmx.export.annotation.ManagedAttribute;
-import org.springframework.jmx.export.annotation.ManagedOperation;
-import org.springframework.jmx.export.annotation.ManagedResource;
/**
* Managed Repository MBean
*/
-@ManagedResource(description = "Feature")
+//@ManagedResource(description = "Feature")
public class ManagedFeature {
private Feature feature;
private FeaturesService featuresService;
@@ -39,37 +36,37 @@
this.featuresService = featuresService;
}
- @ManagedAttribute
+// @ManagedAttribute
public String getId() {
return id;
}
- @ManagedAttribute
+// @ManagedAttribute
public String getName() {
return feature.getName();
}
- @ManagedAttribute
+// @ManagedAttribute
public String getVersion() {
return feature.getVersion();
}
- @ManagedAttribute
+// @ManagedAttribute
public List<Feature> getDependencies() {
return feature.getDependencies();
}
- @ManagedAttribute
+// @ManagedAttribute
public List<String> getBundles() {
return feature.getBundles();
}
- @ManagedOperation
+// @ManagedOperation
public void uninstallFeature() throws Exception {
featuresService.uninstallFeature(feature.getName(), feature.getVersion());
}
- @ManagedOperation
+// @ManagedOperation
public void installFeature() throws Exception {
featuresService.installFeature(feature.getName(), feature.getVersion());
}
diff --git a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagedFeaturesRegistry.java b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagedFeaturesRegistry.java
index 9fbdb46..758d995 100644
--- a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagedFeaturesRegistry.java
+++ b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagedFeaturesRegistry.java
@@ -28,16 +28,13 @@
import org.apache.servicemix.kernel.gshell.features.FeaturesRegistry;
import org.apache.servicemix.kernel.gshell.features.FeaturesService;
import org.apache.servicemix.kernel.gshell.features.Repository;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.jmx.export.annotation.ManagedOperation;
-import org.springframework.jmx.export.annotation.ManagedResource;
/**
* The FeaturesServiceRegistry maintains the managed Features and Repositories
* for JMX management.
*/
-@ManagedResource(description = "Features Service Registry and Management")
-public class ManagedFeaturesRegistry implements InitializingBean, FeaturesRegistry {
+//@ManagedResource(description = "Features Service Registry and Management")
+public class ManagedFeaturesRegistry implements FeaturesRegistry {
private static final transient Log LOG = LogFactory.getLog(ManagedFeaturesRegistry.class);
@@ -49,17 +46,17 @@
private boolean mbeanServerInitialized;
private FeaturesService featuresService;
- @ManagedOperation
+// @ManagedOperation
public void installFeature(String name) throws Exception {
featuresService.installFeature(name);
}
- @ManagedOperation
+// @ManagedOperation
public void installFeature(String name, String version) throws Exception {
featuresService.installFeature(name, version);
}
- @ManagedOperation
+// @ManagedOperation
public void installRepository(String repositoryUri) throws Exception {
featuresService.addRepository(new URI(repositoryUri));
}
diff --git a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagedRepository.java b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagedRepository.java
index 2d3ae17..606959f 100644
--- a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagedRepository.java
+++ b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagedRepository.java
@@ -21,11 +21,8 @@
import org.apache.servicemix.kernel.gshell.features.Feature;
import org.apache.servicemix.kernel.gshell.features.FeaturesService;
import org.apache.servicemix.kernel.gshell.features.Repository;
-import org.springframework.jmx.export.annotation.ManagedAttribute;
-import org.springframework.jmx.export.annotation.ManagedOperation;
-import org.springframework.jmx.export.annotation.ManagedResource;
-@ManagedResource(description = "Features Repository")
+//@ManagedResource(description = "Features Repository")
public class ManagedRepository {
private Repository repository;
private FeaturesService featuresService;
@@ -35,22 +32,22 @@
this.featuresService = featuresService;
}
- @ManagedAttribute
+// @ManagedAttribute
public URI getUri() {
return repository.getURI();
}
- @ManagedAttribute
+// @ManagedAttribute
public URI[] getRepositories() throws Exception {
return repository.getRepositories();
}
- @ManagedAttribute
+// @ManagedAttribute
public Feature[] getFeatures() throws Exception {
return repository.getFeatures();
}
- @ManagedOperation
+// @ManagedOperation
public void removeRepository() throws Exception {
featuresService.removeRepository(repository.getURI());
}
diff --git a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagementAgent.java b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagementAgent.java
index 611ec6b..6369915 100644
--- a/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagementAgent.java
+++ b/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/management/ManagementAgent.java
@@ -31,24 +31,21 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource;
-import org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler;
/**
* Management Agent that registers MBeans with JMX MBeanServer.
*/
-public class ManagementAgent implements DisposableBean {
+public class ManagementAgent {
private static final transient Log LOG = LogFactory.getLog(ManagementAgent.class);
private MBeanServer mbeanServer;
- private MetadataMBeanInfoAssembler assembler;
+// private MetadataMBeanInfoAssembler assembler;
private Set<ObjectName> mbeans = new HashSet<ObjectName>();
public ManagementAgent() {
- assembler = new MetadataMBeanInfoAssembler();
- assembler.setAttributeSource(new AnnotationJmxAttributeSource());
+// assembler = new MetadataMBeanInfoAssembler();
+// assembler.setAttributeSource(new AnnotationJmxAttributeSource());
}
public MBeanServer getMbeanServer() {
@@ -85,21 +82,21 @@
}
public void register(Object obj, ObjectName name, boolean forceRegistration) throws JMException {
- try {
- registerMBeanWithServer(obj, name, forceRegistration);
- } catch (NotCompliantMBeanException e) {
- // If this is not a "normal" MBean, then try to deploy it using JMX
- // annotations
- ModelMBeanInfo mbi = assembler.getMBeanInfo(obj, name.toString());
- RequiredModelMBean mbean = (RequiredModelMBean) mbeanServer.instantiate(RequiredModelMBean.class.getName());
- mbean.setModelMBeanInfo(mbi);
- try {
- mbean.setManagedResource(obj, "ObjectReference");
- } catch (InvalidTargetObjectTypeException itotex) {
- throw new JMException(itotex.getMessage());
- }
- registerMBeanWithServer(mbean, name, forceRegistration);
- }
+// try {
+// registerMBeanWithServer(obj, name, forceRegistration);
+// } catch (NotCompliantMBeanException e) {
+// // If this is not a "normal" MBean, then try to deploy it using JMX
+// // annotations
+// ModelMBeanInfo mbi = assembler.getMBeanInfo(obj, name.toString());
+// RequiredModelMBean mbean = (RequiredModelMBean) mbeanServer.instantiate(RequiredModelMBean.class.getName());
+// mbean.setModelMBeanInfo(mbi);
+// try {
+// mbean.setManagedResource(obj, "ObjectReference");
+// } catch (InvalidTargetObjectTypeException itotex) {
+// throw new JMException(itotex.getMessage());
+// }
+// registerMBeanWithServer(mbean, name, forceRegistration);
+// }
}
public synchronized void unregister(ObjectName name) throws JMException {
diff --git a/gshell/gshell-features/src/main/resources/META-INF/spring/gshell-features.xml b/gshell/gshell-features/src/main/resources/META-INF/spring/gshell-features.xml
deleted file mode 100644
index d45b6be..0000000
--- a/gshell/gshell-features/src/main/resources/META-INF/spring/gshell-features.xml
+++ /dev/null
@@ -1,139 +0,0 @@
-<?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:ctx="http://www.springframework.org/schema/context"
- 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"
- xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.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
- http://www.springframework.org/schema/util
- http://www.springframework.org/schema/util/spring-util.xsd
- http://servicemix.apache.org/schema/servicemix-gshell
- http://servicemix.apache.org/schema/servicemix-gshell/servicemix-gshell.xsd">
-
- <import resource="classpath:org/apache/servicemix/kernel/gshell/core/commands.xml" />
-
- <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="location" value="file:${servicemix.home}/etc/org.apache.servicemix.features.cfg"/>
- </bean>
-
- <gshell:command-bundle>
- <gshell:command name="features/addUrl">
- <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.AddUrlCommand" />
- </gshell:command>
- <gshell:command name="features/listUrl">
- <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.ListUrlCommand" />
- </gshell:command>
- <gshell:command name="features/removeUrl">
- <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.RemoveUrlCommand" />
- <gshell:completers>
- <ref bean="removeUrlCompleter" />
- </gshell:completers>
- </gshell:command>
- <gshell:command name="features/refreshUrl">
- <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.RefreshUrlCommand" />
- </gshell:command>
- <gshell:command name="features/install">
- <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.InstallFeatureCommand" />
- <gshell:completers>
- <ref bean="installFeatureCompleter" />
- </gshell:completers>
- </gshell:command>
- <gshell:command name="features/uninstall">
- <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.UninstallFeatureCommand" />
- <gshell:completers>
- <ref bean="uninstallFeatureCompleter" />
- </gshell:completers>
- </gshell:command>
- <gshell:command name="features/list">
- <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.ListFeaturesCommand" />
- </gshell:command>
- </gshell:command-bundle>
-
- <bean id="featuresService" class="org.apache.servicemix.kernel.gshell.features.internal.FeaturesServiceImpl" init-method="start" destroy-method="stop">
- <property name="urls" value="${featuresRepositories}" />
- <property name="boot" value="${featuresBoot}" />
- <property name="configAdmin" ref="configAdmin" />
- <property name="preferences" ref="preferences" />
- <property name="featuresServiceRegistry" ref="featureServiceRegistry" />
- </bean>
-
- <bean id="featureDeploymentListener" class="org.apache.servicemix.kernel.gshell.features.internal.FeatureDeploymentListener">
- <property name="featuresService" ref="featuresService" />
- </bean>
-
- <bean id="namingStrategy" class="org.apache.servicemix.kernel.gshell.features.management.DefaultNamingStrategy">
- <property name="jmxDomainName" value="org.apache.servicemix" />
- </bean>
-
- <bean id="managementAgent" class="org.apache.servicemix.kernel.gshell.features.management.ManagementAgent">
- <property name="mbeanServer" ref="mbeanServer" />
- </bean>
-
- <bean id="featureServiceRegistry" class="org.apache.servicemix.kernel.gshell.features.management.ManagedFeaturesRegistry">
- <property name="managementAgent" ref="managementAgent" />
- <property name="namingStrategy" ref="namingStrategy" />
- <property name="featuresService" ref="featuresService" />
- </bean>
-
- <osgi:reference id="configAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" />
-
- <osgi:reference id="preferences" interface="org.osgi.service.prefs.PreferencesService" cardinality="0..1" />
-
- <osgi:service ref="featuresService" interface="org.apache.servicemix.kernel.gshell.features.FeaturesService" />
-
- <osgi:service ref="featureDeploymentListener" interface="org.apache.servicemix.kernel.filemonitor.DeploymentListener" />
-
- <osgix:cm-properties id="cmProps" persistent-id="org.apache.servicemix.features">
- <prop key="featuresRepositories"></prop>
- <prop key="featuresBoot"></prop>
- </osgix:cm-properties>
-
- <!-- <ctx:property-placeholder properties-ref="cmProps" /> -->
-
- <osgi:reference id="mbeanServer"
- interface="javax.management.MBeanServer"
- cardinality="0..1" >
- <osgi:listener ref="featureServiceRegistry" bind-method="registerMBeanServer" />
- </osgi:reference>
-
- <bean id="installFeatureCompleter" class="org.apache.servicemix.kernel.gshell.features.completers.AvailableFeatureCompleter">
- <property name="featuresRegistry" ref="featureServiceRegistry" />
- </bean>
-
- <bean id="uninstallFeatureCompleter" class="org.apache.servicemix.kernel.gshell.features.completers.InstalledFeatureCompleter">
- <property name="featuresRegistry" ref="featureServiceRegistry" />
- </bean>
-
- <bean id="removeUrlCompleter" class="org.apache.servicemix.kernel.gshell.features.completers.FeatureRepositoryCompleter">
- <property name="featuresRegistry" ref="featureServiceRegistry" />
- </bean>
-
-</beans>
\ No newline at end of file
diff --git a/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml b/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml
new file mode 100644
index 0000000..6441c69
--- /dev/null
+++ b/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml
@@ -0,0 +1,126 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell"
+ xmlns:osgix="http://www.osgi.org/xmlns/blueprint-compendium/v1.0.0">
+
+ <osgix:property-placeholder persistent-id="org.apache.servicemix.features">
+ <osgix:default-properties>
+ <osgix:property name="featuresRepositories" value=""/>
+ <osgix:property name="featuresBoot" value=""/>
+ </osgix:default-properties>
+ </osgix:property-placeholder>
+
+ <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="location" value="file:${servicemix.home}/etc/org.apache.servicemix.features.cfg"/>
+ </bean>
+
+ <gshell:command-bundle>
+ <gshell:command name="features/addUrl">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.AddUrlCommand"/>
+ </gshell:command>
+ <gshell:command name="features/listUrl">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.ListUrlCommand"/>
+ </gshell:command>
+ <gshell:command name="features/removeUrl">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.RemoveUrlCommand"/>
+ <gshell:completers>
+ <ref component="removeUrlCompleter"/>
+ </gshell:completers>
+ </gshell:command>
+ <gshell:command name="features/refreshUrl">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.RefreshUrlCommand"/>
+ </gshell:command>
+ <gshell:command name="features/install">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.InstallFeatureCommand"/>
+ <gshell:completers>
+ <ref component="installFeatureCompleter"/>
+ </gshell:completers>
+ </gshell:command>
+ <gshell:command name="features/uninstall">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.UninstallFeatureCommand"/>
+ <gshell:completers>
+ <ref component="uninstallFeatureCompleter"/>
+ </gshell:completers>
+ </gshell:command>
+ <gshell:command name="features/list">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.ListFeaturesCommand"/>
+ </gshell:command>
+ </gshell:command-bundle>
+
+ <bean id="featuresService" class="org.apache.servicemix.kernel.gshell.features.internal.FeaturesServiceImpl"
+ init-method="start" destroy-method="stop">
+ <property name="bundleContext" ref="bundleContext"/>
+ <property name="urls" value="${featuresRepositories}"/>
+ <property name="boot" value="${featuresBoot}"/>
+ <property name="configAdmin" ref="configAdmin"/>
+ <property name="preferences" ref="preferences"/>
+ <property name="featuresServiceRegistry" ref="featureServiceRegistry"/>
+ </bean>
+
+ <bean id="featureDeploymentListener" class="org.apache.servicemix.kernel.gshell.features.internal.FeatureDeploymentListener" init-method="afterPropertiesSet" destroy-method="destroy">
+ <property name="bundleContext" ref="bundleContext"/>
+ <property name="featuresService" ref="featuresService"/>
+ </bean>
+
+ <bean id="namingStrategy" class="org.apache.servicemix.kernel.gshell.features.management.DefaultNamingStrategy">
+ <property name="jmxDomainName" value="org.apache.servicemix"/>
+ </bean>
+
+ <bean id="managementAgent" class="org.apache.servicemix.kernel.gshell.features.management.ManagementAgent">
+ <property name="mbeanServer" ref="mbeanServer"/>
+ </bean>
+
+ <bean id="featureServiceRegistry"
+ class="org.apache.servicemix.kernel.gshell.features.management.ManagedFeaturesRegistry"
+ init-method="afterPropertiesSet">
+ <property name="managementAgent" ref="managementAgent"/>
+ <property name="namingStrategy" ref="namingStrategy"/>
+ <property name="featuresService" ref="featuresService"/>
+ </bean>
+
+ <reference id="configAdmin" interface="org.osgi.service.cm.ConfigurationAdmin"/>
+
+ <reference id="preferences" interface="org.osgi.service.prefs.PreferencesService" availability="optional"/>
+
+ <service ref="featuresService" interface="org.apache.servicemix.kernel.gshell.features.FeaturesService"/>
+
+ <service ref="featureDeploymentListener" interface="org.apache.servicemix.kernel.filemonitor.DeploymentListener"/>
+
+ <reference id="mbeanServer" interface="javax.management.MBeanServer" availability="optional">
+ <listener ref="featureServiceRegistry" bind-method="registerMBeanServer" unbind-method=""/>
+ </reference>
+
+ <bean id="installFeatureCompleter"
+ class="org.apache.servicemix.kernel.gshell.features.completers.AvailableFeatureCompleter">
+ <property name="featuresRegistry" ref="featureServiceRegistry"/>
+ </bean>
+
+ <bean id="uninstallFeatureCompleter"
+ class="org.apache.servicemix.kernel.gshell.features.completers.InstalledFeatureCompleter">
+ <property name="featuresRegistry" ref="featureServiceRegistry"/>
+ </bean>
+
+ <bean id="removeUrlCompleter"
+ class="org.apache.servicemix.kernel.gshell.features.completers.FeatureRepositoryCompleter">
+ <property name="featuresRegistry" ref="featureServiceRegistry"/>
+ </bean>
+
+</blueprint>
\ No newline at end of file
diff --git a/gshell/gshell-log/pom.xml b/gshell/gshell-log/pom.xml
index d597f8b..0a2b6ed 100644
--- a/gshell/gshell-log/pom.xml
+++ b/gshell/gshell-log/pom.xml
@@ -55,10 +55,12 @@
<scope>provided</scope>
</dependency>
+ <!--
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-core</artifactId>
</dependency>
+ -->
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
diff --git a/gshell/gshell-obr/pom.xml b/gshell/gshell-obr/pom.xml
index 384ce8f..d367770 100644
--- a/gshell/gshell-obr/pom.xml
+++ b/gshell/gshell-obr/pom.xml
@@ -54,10 +54,12 @@
<artifactId>org.apache.servicemix.kernel.gshell.core</artifactId>
</dependency>
+ <!--
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-core</artifactId>
</dependency>
+ -->
</dependencies>
<build>
diff --git a/gshell/gshell-obr/src/main/resources/META-INF/spring/gshell-obr.xml b/gshell/gshell-obr/src/main/resources/OSGI-INF/blueprint/gshell-obr.xml
similarity index 67%
rename from gshell/gshell-obr/src/main/resources/META-INF/spring/gshell-obr.xml
rename to gshell/gshell-obr/src/main/resources/OSGI-INF/blueprint/gshell-obr.xml
index 250051f..2593da5 100644
--- a/gshell/gshell-obr/src/main/resources/META-INF/spring/gshell-obr.xml
+++ b/gshell/gshell-obr/src/main/resources/OSGI-INF/blueprint/gshell-obr.xml
@@ -17,25 +17,8 @@
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"
- xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.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
- http://www.springframework.org/schema/util
- http://www.springframework.org/schema/util/spring-util.xsd
- http://servicemix.apache.org/schema/servicemix-gshell
- http://servicemix.apache.org/schema/servicemix-gshell/servicemix-gshell.xsd">
-
- <import resource="classpath:org/apache/servicemix/kernel/gshell/core/commands.xml" />
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell">
<gshell:command-bundle>
<gshell:command name="obr/addUrl">
@@ -67,4 +50,4 @@
</gshell:command>
</gshell:command-bundle>
-</beans>
\ No newline at end of file
+</blueprint>
\ No newline at end of file
diff --git a/gshell/gshell-osgi/pom.xml b/gshell/gshell-osgi/pom.xml
index c4bafcc..2ced6ee 100644
--- a/gshell/gshell-osgi/pom.xml
+++ b/gshell/gshell-osgi/pom.xml
@@ -49,6 +49,7 @@
<scope>provided</scope>
</dependency>
+ <!--
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-core</artifactId>
@@ -58,6 +59,7 @@
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-extender</artifactId>
</dependency>
+ -->
</dependencies>
<build>
diff --git a/gshell/gshell-osgi/src/main/java/org/apache/servicemix/kernel/gshell/osgi/GShellBlueprintContextListener.java b/gshell/gshell-osgi/src/main/java/org/apache/servicemix/kernel/gshell/osgi/GShellBlueprintContextListener.java
new file mode 100644
index 0000000..34ff6b7
--- /dev/null
+++ b/gshell/gshell-osgi/src/main/java/org/apache/servicemix/kernel/gshell/osgi/GShellBlueprintContextListener.java
@@ -0,0 +1,88 @@
+/*
+ * 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.servicemix.kernel.gshell.osgi;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.framework.BundleListener;
+import org.osgi.service.blueprint.context.BlueprintContextListener;
+
+/**
+ *
+ * TODO: use event admin to receive WAIT topics notifications from blueprint extender
+ *
+ */
+public class GShellBlueprintContextListener implements BlueprintContextListener, BundleListener {
+
+ public static enum BlueprintState {
+ Unknown,
+ Waiting,
+ Started,
+ Failed,
+ }
+
+ private static final Log LOG = LogFactory.getLog(GShellBlueprintContextListener.class);
+
+ private final Map<Long, BlueprintState> states;
+ private BundleContext bundleContext;
+
+ public GShellBlueprintContextListener() {
+ this.states = new ConcurrentHashMap<Long, BlueprintState>();
+ }
+
+ public BlueprintState getBlueprintState(Bundle bundle) {
+ BlueprintState state = states.get(bundle.getBundleId());
+ if (state == null || bundle.getState() != Bundle.ACTIVE) {
+ state = BlueprintState.Unknown;
+ }
+ return state;
+ }
+
+ public void contextCreated(Bundle bundle) {
+ LOG.debug("Blueprint app state changed to " + BlueprintState.Started + " for bundle " + bundle.getBundleId());
+ states.put(bundle.getBundleId(), BlueprintState.Started);
+ }
+
+ public void contextCreationFailed(Bundle bundle, Throwable rootCause) {
+ LOG.debug("Blueprint app state changed to " + BlueprintState.Failed + " for bundle " + bundle.getBundleId());
+ states.put(bundle.getBundleId(), BlueprintState.Failed);
+ }
+
+ public void bundleChanged(BundleEvent event) {
+ if (event.getType() == BundleEvent.UNINSTALLED) {
+ states.remove(event.getBundle().getBundleId());
+ }
+ }
+
+ public void setBundleContext(BundleContext bundleContext) {
+ this.bundleContext = bundleContext;
+ }
+
+ public void afterPropertiesSet() throws Exception {
+ bundleContext.addBundleListener(this);
+ }
+
+ public void destroy() throws Exception {
+ bundleContext.removeBundleListener(this);
+ }
+}
diff --git a/gshell/gshell-osgi/src/main/java/org/apache/servicemix/kernel/gshell/osgi/ListBundles.java b/gshell/gshell-osgi/src/main/java/org/apache/servicemix/kernel/gshell/osgi/ListBundles.java
index 00604f3..5b5c42c 100644
--- a/gshell/gshell-osgi/src/main/java/org/apache/servicemix/kernel/gshell/osgi/ListBundles.java
+++ b/gshell/gshell-osgi/src/main/java/org/apache/servicemix/kernel/gshell/osgi/ListBundles.java
@@ -35,14 +35,14 @@
@Option(name = "-u", description = "Show update")
boolean showUpdate;
- private SpringApplicationListener springApplicationListener;
+ private GShellBlueprintContextListener blueprintApplicationListener;
- public SpringApplicationListener getSpringApplicationListener() {
- return springApplicationListener;
+ public GShellBlueprintContextListener getBlueprintApplicationListener() {
+ return blueprintApplicationListener;
}
- public void setSpringApplicationListener(SpringApplicationListener springApplicationListener) {
- this.springApplicationListener = springApplicationListener;
+ public void setBlueprintApplicationListener(GShellBlueprintContextListener blueprintApplicationListener) {
+ this.blueprintApplicationListener = blueprintApplicationListener;
}
protected Object doExecute() throws Exception {
@@ -189,12 +189,12 @@
}
public String getSpringStateString(Bundle bundle) {
- SpringApplicationListener.SpringState state = springApplicationListener.getSpringState(bundle);
- if (state == SpringApplicationListener.SpringState.Waiting) {
+ GShellBlueprintContextListener.BlueprintState state = blueprintApplicationListener.getBlueprintState(bundle);
+ if (state == GShellBlueprintContextListener.BlueprintState.Waiting) {
return "Waiting";
- } else if (state == SpringApplicationListener.SpringState.Started) {
+ } else if (state == GShellBlueprintContextListener.BlueprintState.Started) {
return "Started";
- } else if (state == SpringApplicationListener.SpringState.Failed) {
+ } else if (state == GShellBlueprintContextListener.BlueprintState.Failed) {
return "Failed ";
} else {
return " ";
diff --git a/gshell/gshell-osgi/src/main/java/org/apache/servicemix/kernel/gshell/osgi/SpringApplicationListener.java b/gshell/gshell-osgi/src/main/java/org/apache/servicemix/kernel/gshell/osgi/SpringApplicationListener.java
deleted file mode 100644
index 240bd0a..0000000
--- a/gshell/gshell-osgi/src/main/java/org/apache/servicemix/kernel/gshell/osgi/SpringApplicationListener.java
+++ /dev/null
@@ -1,102 +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.servicemix.kernel.gshell.osgi;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.BundleListener;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.osgi.context.BundleContextAware;
-import org.springframework.osgi.context.event.OsgiBundleApplicationContextEvent;
-import org.springframework.osgi.context.event.OsgiBundleApplicationContextListener;
-import org.springframework.osgi.context.event.OsgiBundleContextFailedEvent;
-import org.springframework.osgi.context.event.OsgiBundleContextRefreshedEvent;
-import org.springframework.osgi.extender.event.BootstrappingDependencyEvent;
-import org.springframework.osgi.service.importer.event.OsgiServiceDependencyEvent;
-import org.springframework.osgi.service.importer.event.OsgiServiceDependencyWaitStartingEvent;
-
-public class SpringApplicationListener implements OsgiBundleApplicationContextListener,
- BundleListener, BundleContextAware,
- InitializingBean, DisposableBean {
-
- public static enum SpringState {
- Unknown,
- Waiting,
- Started,
- Failed,
- }
-
- private static final Log LOG = LogFactory.getLog(SpringApplicationListener.class);
-
- private final Map<Long, SpringState> states;
- private BundleContext bundleContext;
-
- public SpringApplicationListener() {
- this.states = new ConcurrentHashMap<Long, SpringState>();
- }
-
- public SpringState getSpringState(Bundle bundle) {
- SpringState state = states.get(bundle.getBundleId());
- if (state == null || bundle.getState() != Bundle.ACTIVE) {
- state = SpringState.Unknown;
- }
- return state;
- }
-
- public void onOsgiApplicationEvent(OsgiBundleApplicationContextEvent event) {
- SpringState state = null;
- if (event instanceof BootstrappingDependencyEvent) {
- OsgiServiceDependencyEvent de = ((BootstrappingDependencyEvent) event).getDependencyEvent();
- if (de instanceof OsgiServiceDependencyWaitStartingEvent) {
- state = SpringState.Waiting;
- }
- } else if (event instanceof OsgiBundleContextFailedEvent) {
- state = SpringState.Failed;
- } else if (event instanceof OsgiBundleContextRefreshedEvent) {
- state = SpringState.Started;
- }
- if (state != null) {
- LOG.debug("Spring app state changed to " + state + " for bundle " + event.getBundle().getBundleId());
- states.put(event.getBundle().getBundleId(), state);
- }
- }
-
- public void bundleChanged(BundleEvent event) {
- if (event.getType() == BundleEvent.UNINSTALLED) {
- states.remove(event.getBundle().getBundleId());
- }
- }
-
- public void setBundleContext(BundleContext bundleContext) {
- this.bundleContext = bundleContext;
- }
-
- public void afterPropertiesSet() throws Exception {
- bundleContext.addBundleListener(this);
- }
-
- public void destroy() throws Exception {
- bundleContext.removeBundleListener(this);
- }
-}
diff --git a/gshell/gshell-osgi/src/main/resources/META-INF/spring/gshell-osgi.xml b/gshell/gshell-osgi/src/main/resources/META-INF/spring/gshell-osgi.xml
deleted file mode 100644
index 7f06ebf..0000000
--- a/gshell/gshell-osgi/src/main/resources/META-INF/spring/gshell-osgi.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?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:util="http://www.springframework.org/schema/util"
- xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell"
- 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://servicemix.apache.org/schema/servicemix-gshell
- http://servicemix.apache.org/schema/servicemix-gshell/servicemix-gshell.xsd">
-
- <import resource="classpath:org/apache/servicemix/kernel/gshell/core/commands.xml" />
-
- <gshell:command-bundle>
- <gshell:command name="osgi/bundle-level">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.BundleLevel" />
- </gshell:command>
- <gshell:command name="osgi/headers">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.Headers" />
- </gshell:command>
- <gshell:command name="osgi/install">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.InstallBundle" />
- </gshell:command>
- <gshell:command name="osgi/list">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.ListBundles">
- <property name="springApplicationListener" ref="springApplicationListener" />
- </gshell:action>
- </gshell:command>
- <gshell:command name="osgi/ls">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.ListServices" />
- </gshell:command>
- <gshell:command name="osgi/refresh">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.RefreshBundle" />
- </gshell:command>
- <gshell:command name="osgi/update">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.UpdateBundle" />
- </gshell:command>
- <gshell:command name="osgi/resolve">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.ResolveBundle" />
- </gshell:command>
- <gshell:command name="osgi/restart">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.RestartBundle" />
- </gshell:command>
- <gshell:command name="osgi/shutdown">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.Shutdown" />
- </gshell:command>
- <gshell:command name="osgi/start">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.StartBundle" />
- </gshell:command>
- <gshell:command name="osgi/start-level">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.StartLevel" />
- </gshell:command>
- <gshell:command name="osgi/stop">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.StopBundle" />
- </gshell:command>
- <gshell:command name="osgi/uninstall">
- <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.UninstallBundle" />
- </gshell:command>
- </gshell:command-bundle>
-
- <bean id="springApplicationListener" class="org.apache.servicemix.kernel.gshell.osgi.SpringApplicationListener" />
-
- <osgi:service ref="springApplicationListener" interface="org.springframework.osgi.context.event.OsgiBundleApplicationContextListener" />
-
-</beans>
\ No newline at end of file
diff --git a/gshell/gshell-osgi/src/main/resources/OSGI-INF/blueprint/gshell-osgi.xml b/gshell/gshell-osgi/src/main/resources/OSGI-INF/blueprint/gshell-osgi.xml
new file mode 100644
index 0000000..35b949f
--- /dev/null
+++ b/gshell/gshell-osgi/src/main/resources/OSGI-INF/blueprint/gshell-osgi.xml
@@ -0,0 +1,101 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell">
+
+ <gshell:command-bundle>
+ <gshell:command name="osgi/bundle-level">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.BundleLevel">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/headers">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.Headers">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/install">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.InstallBundle">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/list">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.ListBundles">
+ <property name="bundleContext" ref="bundleContext"/>
+ <property name="blueprintApplicationListener" ref="blueprintApplicationListener"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/ls">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.ListServices">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/refresh">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.RefreshBundle">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/update">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.UpdateBundle">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/resolve">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.ResolveBundle">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/restart">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.RestartBundle">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/shutdown">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.Shutdown">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/start">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.StartBundle">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/start-level">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.StartLevel">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/stop">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.StopBundle">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ <gshell:command name="osgi/uninstall">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.osgi.UninstallBundle">
+ <property name="bundleContext" ref="bundleContext"/>
+ </gshell:action>
+ </gshell:command>
+ </gshell:command-bundle>
+
+ <bean id="blueprintApplicationListener" class="org.apache.servicemix.kernel.gshell.osgi.GShellBlueprintContextListener" />
+
+ <service ref="blueprintApplicationListener" interface="org.osgi.service.blueprint.context.BlueprintContextListener" />
+
+</blueprint>
\ No newline at end of file
diff --git a/gshell/gshell-packages/pom.xml b/gshell/gshell-packages/pom.xml
index cdb92c5..4540bec 100644
--- a/gshell/gshell-packages/pom.xml
+++ b/gshell/gshell-packages/pom.xml
@@ -55,10 +55,12 @@
<scope>provided</scope>
</dependency>
+ <!--
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-core</artifactId>
</dependency>
+ -->
</dependencies>
<build>
diff --git a/gshell/gshell-packages/src/main/resources/META-INF/spring/gshell-packages.xml b/gshell/gshell-packages/src/main/resources/META-INF/spring/gshell-packages.xml
deleted file mode 100644
index 9e3060d..0000000
--- a/gshell/gshell-packages/src/main/resources/META-INF/spring/gshell-packages.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?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:util="http://www.springframework.org/schema/util"
- xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell"
- 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://servicemix.apache.org/schema/servicemix-gshell
- http://servicemix.apache.org/schema/servicemix-gshell/servicemix-gshell.xsd">
-
- <import resource="classpath:org/apache/servicemix/kernel/gshell/core/commands.xml" />
-
- <gshell:command-bundle>
- <gshell:command name="packages/exports">
- <gshell:action class="org.apache.servicemix.kernel.gshell.packages.ExportsCommand" />
- </gshell:command>
- <gshell:command name="packages/imports">
- <gshell:action class="org.apache.servicemix.kernel.gshell.packages.ImportsCommand" />
- </gshell:command>
- </gshell:command-bundle>
-
-</beans>
diff --git a/gshell/gshell-packages/src/main/resources/OSGI-INF/blueprint/gshell-packages.xml b/gshell/gshell-packages/src/main/resources/OSGI-INF/blueprint/gshell-packages.xml
new file mode 100644
index 0000000..3b9ab63
--- /dev/null
+++ b/gshell/gshell-packages/src/main/resources/OSGI-INF/blueprint/gshell-packages.xml
@@ -0,0 +1,33 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell">
+
+ <gshell:command-bundle>
+ <gshell:command name="packages/exports">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.packages.ExportsCommand" />
+ </gshell:command>
+
+ <gshell:command name="packages/imports">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.packages.ImportsCommand" />
+ </gshell:command>
+ </gshell:command-bundle>
+
+</blueprint>
diff --git a/gshell/gshell-run/pom.xml b/gshell/gshell-run/pom.xml
new file mode 100644
index 0000000..666526c
--- /dev/null
+++ b/gshell/gshell-run/pom.xml
@@ -0,0 +1,93 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <!--
+
+ 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.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.kernel.gshell</groupId>
+ <artifactId>gshell</artifactId>
+ <version>1.2.0-blueprint-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.kernel.gshell</groupId>
+ <artifactId>org.apache.servicemix.kernel.gshell.run</artifactId>
+ <packaging>bundle</packaging>
+ <version>1.2.0-blueprint-SNAPSHOT</version>
+ <name>Apache ServiceMix Kernel :: GShell Run</name>
+
+ <description>
+ Provides the OSGi GShell integration
+ </description>
+
+ <properties>
+ <gshell.osgi.import>
+ jline*,
+ org.apache.commons.vfs.cache,
+ org.apache.commons.vfs.provider.temp,
+ org.apache.commons.vfs.provider.ram,
+ org.apache.geronimo.gshell.io,
+ org.apache.geronimo.gshell.parser,
+ org.apache.servicemix.kernel.gshell.core.sshd,
+ org.apache.servicemix.kernel.jaas.config;resolution:=optional,
+ org.apache.servicemix.kernel.version;resolution:=optional,
+ org.apache.servicemix.kernel.main.spi;resolution:=optional;version="1.0.0",
+ org.apache.sshd,
+ org.codehaus.plexus*;resolution:=optional,
+ org.apache.sshd.server.keyprovider,
+ org.apache.sshd.server.jaas,
+ org.jsecurity*;resolution:=optional,
+ *
+ </gshell.osgi.import>
+ <!-- TODO: remove plexus util package -->
+ <gshell.osgi.export>
+ </gshell.osgi.export>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.servicemix.kernel.gshell</groupId>
+ <artifactId>org.apache.servicemix.kernel.gshell.core</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+ <Import-Package>${gshell.osgi.import}</Import-Package>
+ <Export-Package>${gshell.osgi.export}</Export-Package>
+ <DynamicImport-Package>
+ org.apache.geronimo.gshell.*,
+ org.apache.servicemix.kernel.gshell.core.*,
+ org.apache.commons.vfs.*,
+ org.apache.sshd.*
+ </DynamicImport-Package>
+ </instructions>
+ <unpackBundle>true</unpackBundle>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-commands.xml b/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-commands.xml
similarity index 74%
rename from gshell/gshell-core/src/main/resources/META-INF/spring/gshell-commands.xml
rename to gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-commands.xml
index dbcafd3..1e5592b 100644
--- a/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-commands.xml
+++ b/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-commands.xml
@@ -17,47 +17,28 @@
limitations under the License.
-->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:util="http://www.springframework.org/schema/util"
- xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell"
- 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://servicemix.apache.org/schema/servicemix-gshell
- http://servicemix.apache.org/schema/servicemix-gshell/servicemix-gshell.xsd"
- default-autowire="no"
- default-dependency-check="none"
- default-init-method="init"
- default-destroy-method="destroy">
-
- <import resource="classpath:org/apache/servicemix/kernel/gshell/core/commands.xml" />
-
- <bean id="vfsCommandActionTemplate" abstract="true">
- <property name="fileSystemAccess" ref="fileSystemAccess"/>
- </bean>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell">
<gshell:command-bundle>
<gshell:command name="about">
<gshell:action class="org.apache.geronimo.gshell.commands.builtin.AboutAction">
- <constructor-arg ref="application"/>
+ <argument ref="application"/>
</gshell:action>
</gshell:command>
<gshell:command name="help">
<gshell:action class="org.apache.geronimo.gshell.commands.builtin.HelpAction">
- <constructor-arg ref="commandResolver"/>
+ <argument ref="commandResolver"/>
</gshell:action>
<gshell:completers>
<bean class="org.apache.geronimo.gshell.console.completer.AggregateCompleter">
- <constructor-arg>
+ <argument>
<list>
- <ref bean="aliasNameCompleter"/>
- <ref bean="commandNameCompleter"/>
+ <ref component="aliasNameCompleter"/>
+ <ref component="commandNameCompleter"/>
</list>
- </constructor-arg>
+ </argument>
</bean>
<null/>
</gshell:completers>
@@ -79,11 +60,11 @@
<gshell:command name="source">
<gshell:action class="org.apache.geronimo.gshell.commands.builtin.SourceAction">
- <constructor-arg ref="commandLineExecutor"/>
- <constructor-arg ref="fileSystemAccess"/>
+ <argument ref="commandLineExecutor"/>
+ <argument ref="fileSystemAccess"/>
</gshell:action>
<gshell:completers>
- <ref bean="fileObjectNameCompleter"/>
+ <ref component="fileObjectNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
@@ -95,23 +76,23 @@
<gshell:command name="unset">
<gshell:action class="org.apache.geronimo.gshell.commands.builtin.UnsetAction"/>
<gshell:completers>
- <ref bean="variableNameCompleter"/>
+ <ref component="variableNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
<gshell:command name="alias">
<gshell:action class="org.apache.geronimo.gshell.commands.builtin.AliasAction">
- <constructor-arg ref="aliasRegistry"/>
+ <argument ref="aliasRegistry"/>
</gshell:action>
</gshell:command>
<gshell:command name="unalias">
<gshell:action class="org.apache.geronimo.gshell.commands.builtin.UnaliasAction">
- <constructor-arg ref="aliasRegistry"/>
+ <argument ref="aliasRegistry"/>
</gshell:action>
<gshell:completers>
- <ref bean="aliasNameCompleter"/>
+ <ref component="aliasNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
@@ -122,7 +103,7 @@
<gshell:command name="info">
<gshell:action class="org.apache.servicemix.kernel.gshell.core.commands.InfoAction">
- <constructor-arg ref="branding" />
+ <argument ref="branding" />
</gshell:action>
</gshell:command>
</gshell:command-bundle>
@@ -159,7 +140,7 @@
<property name="fileSystemAccess" ref="fileSystemAccess"/>
</gshell:action>
<gshell:completers>
- <ref bean="fileObjectNameCompleter"/>
+ <ref component="fileObjectNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
@@ -169,7 +150,7 @@
<property name="fileSystemAccess" ref="fileSystemAccess"/>
</gshell:action>
<gshell:completers>
- <ref bean="fileObjectNameCompleter"/>
+ <ref component="fileObjectNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
@@ -179,7 +160,7 @@
<property name="fileSystemAccess" ref="fileSystemAccess"/>
</gshell:action>
<gshell:completers>
- <ref bean="fileObjectNameCompleter"/>
+ <ref component="fileObjectNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
@@ -203,7 +184,7 @@
<property name="fileSystemAccess" ref="fileSystemAccess"/>
</gshell:action>
<gshell:completers>
- <ref bean="fileObjectNameCompleter"/>
+ <ref component="fileObjectNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
@@ -215,21 +196,27 @@
<gshell:command-bundle>
<gshell:command name="cd">
- <gshell:action class="org.apache.geronimo.gshell.commands.file.ChangeDirectoryAction" parent="vfsCommandActionTemplate"/>
+ <gshell:action class="org.apache.geronimo.gshell.commands.file.ChangeDirectoryAction">
+ <property name="fileSystemAccess" ref="fileSystemAccess"/>
+ </gshell:action>
<gshell:completers>
- <ref bean="fileObjectNameCompleter"/>
+ <ref component="fileObjectNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
<gshell:command name="pwd" type="stateless">
- <gshell:action class="org.apache.geronimo.gshell.commands.file.CurrentDirectoryAction" parent="vfsCommandActionTemplate"/>
+ <gshell:action class="org.apache.geronimo.gshell.commands.file.CurrentDirectoryAction">
+ <property name="fileSystemAccess" ref="fileSystemAccess"/>
+ </gshell:action>
</gshell:command>
<gshell:command name="ls">
- <gshell:action class="org.apache.geronimo.gshell.commands.file.ListDirectoryAction" parent="vfsCommandActionTemplate"/>
+ <gshell:action class="org.apache.geronimo.gshell.commands.file.ListDirectoryAction">
+ <property name="fileSystemAccess" ref="fileSystemAccess"/>
+ </gshell:action>
<gshell:completers>
- <ref bean="fileObjectNameCompleter"/>
+ <ref component="fileObjectNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
@@ -237,10 +224,12 @@
<gshell:link name="dir" target="ls"/>
<gshell:command name="cp">
- <gshell:action class="org.apache.geronimo.gshell.commands.file.CopyAction" parent="vfsCommandActionTemplate"/>
+ <gshell:action class="org.apache.geronimo.gshell.commands.file.CopyAction">
+ <property name="fileSystemAccess" ref="fileSystemAccess"/>
+ </gshell:action>
<gshell:completers>
- <ref bean="fileObjectNameCompleter"/>
- <ref bean="fileObjectNameCompleter"/>
+ <ref component="fileObjectNameCompleter"/>
+ <ref component="fileObjectNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
@@ -248,9 +237,11 @@
<gshell:link name="copy" target="cp"/>
<gshell:command name="rm">
- <gshell:action class="org.apache.geronimo.gshell.commands.file.RemoveAction" parent="vfsCommandActionTemplate"/>
+ <gshell:action class="org.apache.geronimo.gshell.commands.file.RemoveAction">
+ <property name="fileSystemAccess" ref="fileSystemAccess"/>
+ </gshell:action>
<gshell:completers>
- <ref bean="fileObjectNameCompleter"/>
+ <ref component="fileObjectNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
@@ -258,20 +249,24 @@
<gshell:link name="del" target="rm"/>
<gshell:command name="fileinfo">
- <gshell:action class="org.apache.geronimo.gshell.commands.file.FileInfoAction" parent="vfsCommandActionTemplate"/>
+ <gshell:action class="org.apache.geronimo.gshell.commands.file.FileInfoAction">
+ <property name="fileSystemAccess" ref="fileSystemAccess"/>
+ </gshell:action>
<gshell:completers>
- <ref bean="fileObjectNameCompleter"/>
+ <ref component="fileObjectNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
<gshell:command name="touch">
- <gshell:action class="org.apache.geronimo.gshell.commands.file.TouchAction" parent="vfsCommandActionTemplate"/>
+ <gshell:action class="org.apache.geronimo.gshell.commands.file.TouchAction">
+ <property name="fileSystemAccess" ref="fileSystemAccess"/>
+ </gshell:action>
<gshell:completers>
- <ref bean="fileObjectNameCompleter"/>
+ <ref component="fileObjectNameCompleter"/>
<null/>
</gshell:completers>
</gshell:command>
</gshell:command-bundle>
-</beans>
+</blueprint>
diff --git a/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-local.xml b/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-local.xml
new file mode 100644
index 0000000..ea8358b
--- /dev/null
+++ b/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-local.xml
@@ -0,0 +1,37 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ default-init-method="init"
+ default-destroy-method="destroy">
+
+ <bean id="localShell" class="org.apache.servicemix.kernel.gshell.core.ShellWrapper">
+ <argument ref="shell" />
+ </bean>
+
+ <reference id="mainService" interface="org.apache.servicemix.kernel.main.spi.MainService"/>
+
+ <bean id="localConsole" class="org.apache.servicemix.kernel.gshell.core.LocalConsole">
+ <property name="createLocalShell" value="${servicemix.startLocalConsole}"/>
+ <property name="shell" ref="localShell"/>
+ <property name="mainService" ref="mainService" />
+ <property name="bundleContext" ref="bundleContext"/>
+ </bean>
+
+</blueprint>
\ No newline at end of file
diff --git a/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-osgi.xml b/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-osgi.xml
new file mode 100644
index 0000000..acdf1a3
--- /dev/null
+++ b/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-osgi.xml
@@ -0,0 +1,60 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:cm="http://www.osgi.org/xmlns/blueprint-cm/v1.0.0"
+ default-init-method="init"
+ default-destroy-method="destroy"
+ default-availability="optional">
+
+ <type-converters>
+ <cm:property-placeholder persistent-id="org.apache.servicemix.shell">
+ <cm:default-properties>
+ <cm:property name="sshPort" value="8101"/>
+ <cm:property name="sshRealm" value="servicemix"/>
+ <cm:property name="hostKey" value="${servicemix.base}/etc/host.key"/>
+ </cm:default-properties>
+ </cm:property-placeholder>
+ </type-converters>
+
+ <bean id="osgiCommandRegistry" class="org.apache.servicemix.kernel.gshell.core.OsgiCommandRegistry">
+ <argument ref="commandRegistry"/>
+ </bean>
+
+ <bean id="osgiAliasRegistry" class="org.apache.servicemix.kernel.gshell.core.OsgiAliasRegistry">
+ <argument ref="aliasRegistry"/>
+ </bean>
+
+ <ref-list id="osgiCommands" interface="org.apache.geronimo.gshell.command.Command">
+ <listener ref="osgiCommandRegistry" bind-method="register" unbind-method="unregister"/>
+ </ref-list>
+
+ <ref-list id="osgiLinkCommands" interface="org.apache.geronimo.gshell.command.Link">
+ <listener ref="osgiCommandRegistry" bind-method="register" unbind-method="unregister"/>
+ </ref-list>
+
+ <ref-list id="osgiAliases" interface="org.apache.geronimo.gshell.command.Alias">
+ <listener ref="osgiAliasRegistry" bind-method="register" unbind-method="unregister"/>
+ </ref-list>
+
+ <service ref="localShell" interface="org.apache.geronimo.gshell.shell.Shell"/>
+
+ <service ref="commandLineExecutor" interface="org.apache.geronimo.gshell.commandline.CommandLineExecutor"/>
+
+</blueprint>
\ No newline at end of file
diff --git a/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-remote.xml b/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-remote.xml
new file mode 100644
index 0000000..059c564
--- /dev/null
+++ b/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-remote.xml
@@ -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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ default-init-method="init"
+ default-destroy-method="destroy">
+
+ <type-converters>
+ <bean class="org.apache.geronimo.blueprint.beans.SystemPropertyPlaceholder"/>
+ </type-converters>
+
+ <bean id="sshClient" class="org.apache.sshd.SshClient" factory-method="setUpDefaultClient" init-method="start" destroy-method="stop">
+ </bean>
+
+ <bean id="sshServer" class="org.apache.sshd.SshServer" factory-method="setUpDefaultServer" scope="prototype">
+ <property name="port" value="${sshPort}" />
+ <property name="shellFactory">
+ <bean class="org.apache.geronimo.gshell.commands.ssh.ShellFactoryImpl">
+ <property name="application" ref="application" />
+ <property name="completers">
+ <list>
+ <ref component="commandsCompleter"/>
+ <ref component="aliasNameCompleter"/>
+ </list>
+ </property>
+ <property name="executor" ref="commandLineExecutor" />
+ <property name="prompter">
+ <bean class="org.apache.geronimo.gshell.wisdom.shell.ConsolePrompterImpl">
+ <argument ref="application"/>
+ </bean>
+ </property>
+ <property name="errorHandler">
+ <bean class="org.apache.geronimo.gshell.wisdom.shell.ConsoleErrorHandlerImpl" />
+ </property>
+ <property name="history">
+ <bean class="org.apache.geronimo.gshell.wisdom.shell.HistoryImpl">
+ <argument ref="application"/>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="keyPairProvider" ref="keyPairProvider" />
+ <property name="passwordAuthenticator" ref="passwordAuthenticator" />
+ </bean>
+
+ <bean id="keyPairProvider" class="org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider">
+ <property name="path" value="${hostKey}" />
+ </bean>
+ <bean id="passwordAuthenticator" class="org.apache.sshd.server.jaas.JaasPasswordAuthenticator">
+ <property name="domain" value="${sshRealm}" />
+ </bean>
+
+ <bean id="sshServerFactory" class="org.apache.servicemix.kernel.gshell.core.sshd.SshServerFactory" init-method="start" destroy-method="stop">
+ <argument ref="sshServer" />
+ <property name="start" value="${servicemix.startRemoteShell}" />
+ </bean>
+
+</blueprint>
\ No newline at end of file
diff --git a/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-vfs.xml b/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-vfs.xml
similarity index 74%
rename from gshell/gshell-core/src/main/resources/META-INF/spring/gshell-vfs.xml
rename to gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-vfs.xml
index 3992f54..92ca3fd 100644
--- a/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-vfs.xml
+++ b/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell-vfs.xml
@@ -17,37 +17,20 @@
limitations under the License.
-->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- 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://servicemix.apache.org/schema/servicemix-gshell
- http://servicemix.apache.org/schema/servicemix-gshell/servicemix-gshell.xsd"
- default-autowire="no"
- default-dependency-check="none"
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
default-init-method="init"
default-destroy-method="destroy">
+ <type-converters>
+ <bean class="org.apache.geronimo.gshell.vfs.config.CacheStrategyConverter"/>
+ </type-converters>
+
<bean id="fileSystemAccess" class="org.apache.geronimo.gshell.vfs.FileSystemAccessImpl">
- <constructor-arg ref="fileSystemManager"/>
+ <argument ref="fileSystemManager"/>
</bean>
<bean id="fileObjectNameCompleter" class="org.apache.geronimo.gshell.vfs.FileObjectNameCompleter">
- <constructor-arg ref="fileSystemAccess"/>
- </bean>
-
- <bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
- <property name="customEditors">
- <map>
- <entry key="org.apache.commons.vfs.CacheStrategy">
- <bean class="org.apache.geronimo.gshell.vfs.config.CacheStrategyEditor"/>
- </entry>
- </map>
- </property>
+ <argument ref="fileSystemAccess"/>
</bean>
<!--
@@ -55,7 +38,7 @@
-->
<bean id="defaultFileReplicator" class="org.apache.commons.vfs.impl.DefaultFileReplicator"/>
- <bean id="fileSystemManager" class="org.apache.geronimo.gshell.vfs.config.FileSystemManagerFactoryBean">
+ <bean id="fileSystemManagerFactory" class="org.apache.geronimo.gshell.vfs.config.FileSystemManagerFactory">
<property name="filesCache">
<bean class="org.apache.commons.vfs.cache.SoftRefFilesCache"/>
</property>
@@ -64,7 +47,7 @@
<property name="fileReplicator">
<bean class="org.apache.commons.vfs.impl.PrivilegedFileReplicator">
- <constructor-arg ref="defaultFileReplicator"/>
+ <argument ref="defaultFileReplicator"/>
</bean>
</property>
@@ -72,7 +55,7 @@
TODO: Try and root the temporary store under ${gshell.home}/tmp or something
-->
<property name="temporaryFileStore">
- <ref bean="defaultFileReplicator"/>
+ <ref component="defaultFileReplicator"/>
</property>
<property name="fileContentInfoFactory">
@@ -84,6 +67,8 @@
</property>
</bean>
+ <bean id="fileSystemManager" factory-component="fileSystemManagerFactory" factory-method="getObject"/>
+
<bean class="org.apache.geronimo.gshell.vfs.config.FileProviderConfigurer">
<property name="fileSystemManager" ref="fileSystemManager"/>
<property name="scheme" value="tmp"/>
@@ -117,7 +102,7 @@
</bean>
<bean id="metaDataRegistry" class="org.apache.geronimo.gshell.vfs.provider.meta.data.MetaDataRegistryImpl">
- <constructor-arg ref="eventManager" />
+ <argument ref="eventManager" />
</bean>
<bean id="metaFileProviderConfigurer" class="org.apache.geronimo.gshell.vfs.config.FileProviderConfigurer">
@@ -125,9 +110,9 @@
<property name="scheme" value="meta"/>
<property name="provider">
<bean class="org.apache.geronimo.gshell.vfs.provider.meta.MetaFileProvider">
- <constructor-arg ref="metaDataRegistry"/>
+ <argument ref="metaDataRegistry"/>
</bean>
</property>
</bean>
-</beans>
\ No newline at end of file
+</blueprint>
\ No newline at end of file
diff --git a/gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml b/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell.xml
similarity index 65%
rename from gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml
rename to gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell.xml
index 8bc494e..889f925 100644
--- a/gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml
+++ b/gshell/gshell-run/src/main/resources/OSGI-INF/blueprint/gshell.xml
@@ -17,21 +17,9 @@
limitations under the License.
-->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:util="http://www.springframework.org/schema/util" xmlns:osgi="http://www.springframework.org/schema/osgi"
- 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://servicemix.apache.org/schema/servicemix-gshell
- http://servicemix.apache.org/schema/servicemix-gshell/servicemix-gshell.xsd
- http://www.springframework.org/schema/osgi
- http://www.springframework.org/schema/osgi/spring-osgi-1.0.xsd"
- default-autowire="no"
- default-dependency-check="none"
- default-init-method="init"
- default-destroy-method="destroy">
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ default-init-method="init"
+ default-destroy-method="destroy">
<bean id="io" class="org.apache.geronimo.gshell.io.IO">
<property name="verbosity" value="DEBUG"/>
@@ -41,7 +29,7 @@
<property name="prompt" value="@|bold %{gshell.username}|@%{application.id}:@|bold %{gshell.group}|> " />
</bean>
- <bean id="application" class="org.apache.servicemix.kernel.gshell.core.ApplicationImpl">
+ <bean id="application" class="org.apache.servicemix.kernel.gshell.core.ApplicationImpl" init-method="init">
<property name="id" value="${servicemix.name}"/>
<property name="io" ref="io"/>
<property name="model">
@@ -54,72 +42,78 @@
</property>
</bean>
+ <bean id="beanContainer" class="org.apache.servicemix.kernel.gshell.core.BeanContainerWrapper">
+ <argument ref="blueprintContext"/>
+ </bean>
+
<bean id="eventManager" class="org.apache.geronimo.gshell.event.EventManagerImpl"/>
- <bean id="applicationManager" class="org.apache.servicemix.kernel.gshell.core.ApplicationManagerImpl">
- <constructor-arg ref="eventManager" />
- <constructor-arg ref="application" />
+ <bean id="applicationManager" class="org.apache.servicemix.kernel.gshell.core.ApplicationManagerImpl" init-method="afterPropertiesSet" destroy-method="destroy">
+ <argument ref="eventManager" />
+ <argument ref="application" />
+ <argument ref="blueprintContext"/>
</bean>
<bean id="commandLineParser" class="org.apache.geronimo.gshell.parser.CommandLineParser"/>
<bean id="aliasRegistry" class="org.apache.geronimo.gshell.wisdom.registry.AliasRegistryImpl">
- <constructor-arg ref="eventManager"/>
+ <argument ref="eventManager"/>
</bean>
<bean id="aliasMetaMapper" class="org.apache.geronimo.gshell.wisdom.registry.AliasMetaMapper">
- <constructor-arg ref="eventManager"/>
- <constructor-arg ref="metaDataRegistry"/>
- <constructor-arg ref="aliasRegistry"/>
+ <argument ref="eventManager"/>
+ <argument ref="metaDataRegistry"/>
+ <argument ref="aliasRegistry"/>
</bean>
<bean id="commandRegistry" class="org.apache.geronimo.gshell.wisdom.registry.CommandRegistryImpl">
- <constructor-arg ref="eventManager"/>
+ <argument ref="eventManager"/>
</bean>
<bean id="commandMetaMapper" class="org.apache.geronimo.gshell.wisdom.registry.CommandMetaMapper">
- <constructor-arg ref="eventManager"/>
- <constructor-arg ref="metaDataRegistry"/>
- <constructor-arg ref="commandRegistry"/>
+ <argument ref="eventManager"/>
+ <argument ref="metaDataRegistry"/>
+ <argument ref="commandRegistry"/>
</bean>
<bean id="groupDirResolver" class="org.apache.geronimo.gshell.wisdom.registry.GroupDirectoryResolver">
- <constructor-arg ref="fileSystemAccess"/>
+ <argument ref="fileSystemAccess"/>
</bean>
<bean id="commandResolver" class="org.apache.geronimo.gshell.wisdom.registry.CommandResolverImpl">
- <constructor-arg ref="fileSystemAccess"/>
- <constructor-arg ref="groupDirResolver"/>
+ <argument ref="fileSystemAccess"/>
+ <argument ref="groupDirResolver"/>
+ <property name="beanContainer" ref="beanContainer"/>
</bean>
<bean class="org.apache.servicemix.kernel.gshell.core.WorkAroundAliasCommand" scope="prototype">
- <constructor-arg ref="commandLineExecutor"/>
+ <argument ref="commandLineExecutor"/>
</bean>
<bean class="org.apache.geronimo.gshell.wisdom.command.GroupCommand" scope="prototype"/>
<bean id="commandLineBuilder" class="org.apache.geronimo.gshell.wisdom.shell.CommandLineBuilderImpl">
- <constructor-arg ref="commandLineParser"/>
+ <argument ref="commandLineParser"/>
</bean>
<bean id="commandLineExecutor" class="org.apache.geronimo.gshell.wisdom.shell.CommandLineExecutorImpl">
- <constructor-arg ref="commandResolver"/>
- <constructor-arg ref="commandLineBuilder"/>
+ <argument ref="commandResolver"/>
+ <argument ref="commandLineBuilder"/>
</bean>
<bean id="shell" class="org.apache.geronimo.gshell.wisdom.shell.ShellImpl" scope="prototype" init-method="init" destroy-method="close">
- <constructor-arg ref="application"/>
- <constructor-arg ref="commandLineExecutor"/>
+ <argument ref="application"/>
+ <argument ref="commandLineExecutor"/>
<property name="completers">
<list>
- <ref bean="commandsCompleter"/>
- <ref bean="aliasNameCompleter"/>
+ <ref component="commandsCompleter"/>
+ <ref component="aliasNameCompleter"/>
</list>
</property>
<property name="prompter">
<bean class="org.apache.geronimo.gshell.wisdom.shell.ConsolePrompterImpl">
- <constructor-arg ref="application"/>
+ <argument ref="application"/>
</bean>
</property>
<property name="errorHandler">
@@ -127,29 +121,29 @@
</property>
<property name="history">
<bean class="org.apache.geronimo.gshell.wisdom.shell.HistoryImpl">
- <constructor-arg ref="application"/>
+ <argument ref="application"/>
</bean>
</property>
</bean>
<bean id="commandNameCompleter" class="org.apache.geronimo.gshell.wisdom.completer.CommandNameCompleter"
lazy-init="true">
- <constructor-arg ref="eventManager"/>
- <constructor-arg ref="commandRegistry"/>
+ <argument ref="eventManager"/>
+ <argument ref="commandRegistry"/>
</bean>
<bean id="aliasNameCompleter" class="org.apache.geronimo.gshell.wisdom.completer.AliasNameCompleter"
lazy-init="true">
- <constructor-arg ref="eventManager"/>
- <constructor-arg ref="aliasRegistry"/>
+ <argument ref="eventManager"/>
+ <argument ref="aliasRegistry"/>
</bean>
<bean id="commandsCompleter" class="org.apache.geronimo.gshell.wisdom.completer.CommandsCompleter" lazy-init="true">
- <constructor-arg ref="eventManager"/>
- <constructor-arg ref="commandRegistry"/>
+ <argument ref="eventManager"/>
+ <argument ref="commandRegistry"/>
</bean>
<bean id="variableNameCompleter" class="org.apache.geronimo.gshell.wisdom.completer.VariableNameCompleter" lazy-init="true">
</bean>
-</beans>
\ No newline at end of file
+</blueprint>
\ No newline at end of file
diff --git a/gshell/gshell-wrapper/pom.xml b/gshell/gshell-wrapper/pom.xml
index 765c349..99cb76e 100644
--- a/gshell/gshell-wrapper/pom.xml
+++ b/gshell/gshell-wrapper/pom.xml
@@ -61,10 +61,12 @@
<scope>provided</scope>
</dependency>
+ <!--
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-core</artifactId>
</dependency>
+ -->
</dependencies>
<build>
diff --git a/gshell/gshell-wrapper/src/main/resources/META-INF/spring/gshell-wrapper.xml b/gshell/gshell-wrapper/src/main/resources/META-INF/spring/gshell-wrapper.xml
deleted file mode 100644
index 3eb5a60..0000000
--- a/gshell/gshell-wrapper/src/main/resources/META-INF/spring/gshell-wrapper.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?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:util="http://www.springframework.org/schema/util"
- xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell"
- 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://servicemix.apache.org/schema/servicemix-gshell
- http://servicemix.apache.org/schema/servicemix-gshell/servicemix-gshell.xsd">
-
- <import resource="classpath:org/apache/servicemix/kernel/gshell/core/commands.xml" />
-
- <gshell:command-bundle>
- <gshell:command name="wrapper/install">
- <gshell:action class="org.apache.servicemix.kernel.gshell.wrapper.InstallCommand" />
- </gshell:command>
- </gshell:command-bundle>
-
-</beans>
diff --git a/gshell/gshell-wrapper/src/main/resources/OSGI-INF/blueprint/gshell-wrapper.xml b/gshell/gshell-wrapper/src/main/resources/OSGI-INF/blueprint/gshell-wrapper.xml
new file mode 100644
index 0000000..9a57128
--- /dev/null
+++ b/gshell/gshell-wrapper/src/main/resources/OSGI-INF/blueprint/gshell-wrapper.xml
@@ -0,0 +1,31 @@
+<?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.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:gshell="">
+
+ <import resource="classpath:org/apache/servicemix/kernel/gshell/core/commands.xml" />
+
+ <gshell:command-bundle>
+ <gshell:command name="wrapper/install">
+ <gshell:action class="org.apache.servicemix.kernel.gshell.wrapper.InstallCommand" />
+ </gshell:command>
+ </gshell:command-bundle>
+
+</beans>
diff --git a/gshell/pom.xml b/gshell/pom.xml
index 871644a..bcf4032 100644
--- a/gshell/pom.xml
+++ b/gshell/pom.xml
@@ -35,6 +35,7 @@
<modules>
<module>gshell-core</module>
+ <module>gshell-run</module>
<module>gshell-osgi</module>
<module>gshell-admin</module>
<module>gshell-features</module>
diff --git a/jaas/jaas-config/pom.xml b/jaas/jaas-config/pom.xml
index b1a51ac..126d412 100644
--- a/jaas/jaas-config/pom.xml
+++ b/jaas/jaas-config/pom.xml
@@ -49,8 +49,8 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.springframework.osgi</groupId>
- <artifactId>spring-osgi-core</artifactId>
+ <groupId>org.apache.geronimo</groupId>
+ <artifactId>blueprint-bundle</artifactId>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
@@ -62,11 +62,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.servicemix.bundles</groupId>
- <artifactId>org.apache.servicemix.bundles.aopalliance</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<scope>test</scope>
diff --git a/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/Config.java b/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/Config.java
index 7ad0b04..764c266 100644
--- a/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/Config.java
+++ b/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/Config.java
@@ -24,13 +24,12 @@
import org.apache.servicemix.kernel.jaas.boot.ProxyLoginModule;
import org.apache.servicemix.kernel.jaas.config.JaasRealm;
import org.osgi.framework.BundleContext;
-import org.springframework.osgi.context.BundleContextAware;
/**
* An implementation of JaasRealm which is created
* by the spring namespace handler.
*/
-public class Config implements JaasRealm, BundleContextAware {
+public class Config implements JaasRealm {
private String name;
private int rank;
diff --git a/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ConfigParser.java b/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ConfigParser.java
deleted file mode 100644
index 5f8e16a..0000000
--- a/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ConfigParser.java
+++ /dev/null
@@ -1,102 +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.servicemix.kernel.jaas.config.impl;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.w3c.dom.Element;
-
-import org.apache.servicemix.kernel.jaas.boot.ProxyLoginModule;
-import org.apache.servicemix.kernel.jaas.config.JaasRealm;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.config.BeanDefinitionHolder;
-import org.springframework.beans.factory.parsing.BeanComponentDefinition;
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.support.ManagedList;
-import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean;
-import org.springframework.util.xml.DomUtils;
-
-public class ConfigParser extends AbstractSingleBeanDefinitionParser {
-
- protected Class getBeanClass(Element element) {
- return Config.class;
- }
-
- protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
- String name = element.getAttribute("name");
- if (name == null || name.length() == 0) {
- name = element.getAttribute("id");
- }
- builder.addPropertyValue("name", name);
- String rank = element.getAttribute("rank");
- if (rank != null && rank.length() > 0) {
- builder.addPropertyValue("rank", Integer.parseInt(rank));
- }
- List childElements = DomUtils.getChildElementsByTagName(element, "module");
- if (childElements != null && childElements.size() > 0) {
- ManagedList children = new ManagedList(childElements.size());
- for (int i = 0; i < childElements.size(); ++i) {
- Element childElement = (Element) childElements.get(i);
- BeanDefinitionBuilder bd = BeanDefinitionBuilder.genericBeanDefinition(Module.class);
- bd.addPropertyValue("className", childElement.getAttribute("className"));
- if (childElement.getAttribute("flags") != null) {
- bd.addPropertyValue("flags", childElement.getAttribute("flags"));
- }
- String options = DomUtils.getTextValue(childElement);
- if (options != null && options.length() > 0) {
- Properties props = new Properties();
- try {
- props.load(new ByteArrayInputStream(options.getBytes()));
- } catch (IOException e) {
- throw new IllegalStateException("Can not load options for JAAS module "
- + childElement.getAttribute("className") + " in config " + name);
- }
- bd.addPropertyValue("options", props);
- }
- children.add(bd.getBeanDefinition());
- }
- builder.addPropertyValue("modules", children);
- }
- // Publish to OSGi
- String publish = element.getAttribute("publish");
- if (Boolean.valueOf(publish)) {
- // Publish Config
- BeanDefinitionBuilder bd = BeanDefinitionBuilder.genericBeanDefinition(OsgiServiceFactoryBean.class);
- bd.addPropertyValue("target", builder.getBeanDefinition());
- bd.addPropertyValue("interfaces", new Class[] { JaasRealm.class });
- Map<String,String> props = new HashMap<String,String>();
- props.put(ProxyLoginModule.PROPERTY_MODULE, name);
- bd.addPropertyValue("serviceProperties", props);
- BeanDefinition def = bd.getBeanDefinition();
- String id = parserContext.getReaderContext().generateBeanName(def);
- BeanDefinitionHolder holder = new BeanDefinitionHolder(def, id);
- registerBeanDefinition(holder, parserContext.getRegistry());
- if (shouldFireEvents()) {
- BeanComponentDefinition componentDefinition = new BeanComponentDefinition(holder);
- postProcessComponentDefinition(componentDefinition);
- parserContext.registerComponent(componentDefinition);
- }
- }
- }
-}
diff --git a/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/NamespaceHandler.java b/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/NamespaceHandler.java
index d1b8192..7b2696e 100644
--- a/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/NamespaceHandler.java
+++ b/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/NamespaceHandler.java
@@ -16,14 +16,160 @@
*/
package org.apache.servicemix.kernel.jaas.config.impl;
-import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+import java.net.URL;
-public class NamespaceHandler extends NamespaceHandlerSupport {
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.CharacterData;
+import org.w3c.dom.Comment;
+import org.w3c.dom.EntityReference;
- public void init() {
- registerBeanDefinitionParser("config", new ConfigParser());
- registerBeanDefinitionParser("keystore", new ResourceKeystoreInstanceParser());
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.ValueMetadata;
+import org.osgi.service.blueprint.reflect.RefMetadata;
+import org.osgi.service.blueprint.namespace.ParserContext;
+import org.osgi.service.blueprint.context.ComponentDefinitionException;
+import org.apache.servicemix.kernel.jaas.config.JaasRealm;
+import org.apache.servicemix.kernel.jaas.config.KeystoreInstance;
+import org.apache.servicemix.kernel.jaas.boot.ProxyLoginModule;
+import org.apache.geronimo.blueprint.mutable.MutableBeanMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableValueMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableRefMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableCollectionMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableServiceMetadata;
+import org.apache.geronimo.blueprint.ExtendedParserContext;
+
+public class NamespaceHandler implements org.osgi.service.blueprint.namespace.NamespaceHandler {
+
+ public URL getSchemaLocation(String namespace) {
+ return getClass().getResource("/org/apache/servicemix/kernel/jaas/config/servicemix-jaas.xsd");
}
+ public ComponentMetadata parse(Element element, ParserContext ctx) {
+ ExtendedParserContext context = (ExtendedParserContext) ctx;
+ if ("config".equals(element.getNodeName())) {
+ return parseConfig(element, context);
+ } else if ("keystore".equals(element.getNodeName())) {
+ return parseKeystore(element, context);
+ }
+ throw new ComponentDefinitionException("Bad xml syntax: unknown element '" + element.getNodeName() + "'");
+ }
+ public ComponentMetadata decorate(Node node, ComponentMetadata component, ParserContext context) {
+ throw new ComponentDefinitionException("Bad xml syntax: node decoration is not supported");
+ }
+
+ public ComponentMetadata parseConfig(Element element, ExtendedParserContext context) {
+ MutableBeanMetadata bean = context.createMetadata(MutableBeanMetadata.class);
+ bean.setClassName(Config.class.getName());
+ String name = element.getAttribute("name");
+ if (name == null || name.length() == 0) {
+ name = element.getAttribute("id");
+ }
+ bean.setId(name);
+ bean.addProperty("bundleContext", createRef(context, "bundleContext"));
+ bean.addProperty("name", createValue(context, name));
+ String rank = element.getAttribute("rank");
+ if (rank != null && rank.length() > 0) {
+ bean.addProperty("rank", createValue(context, rank));
+ }
+ NodeList childElements = element.getElementsByTagName("module");
+ if (childElements != null && childElements.getLength() > 0) {
+ MutableCollectionMetadata children = context.createMetadata(MutableCollectionMetadata.class);
+ for (int i = 0; i < childElements.getLength(); ++i) {
+ Element childElement = (Element) childElements.item(i);
+ MutableBeanMetadata md = context.createMetadata(MutableBeanMetadata.class);
+ md.setClassName(Module.class.getName());
+ md.addProperty("className", createValue(context, childElement.getAttribute("className")));
+ if (childElement.getAttribute("flags") != null) {
+ md.addProperty("flags", createValue(context, childElement.getAttribute("flags")));
+ }
+ String options = getTextValue(childElement);
+ if (options != null && options.length() > 0) {
+ md.addProperty("options", createValue(context, options));
+ }
+ children.addValue(md);
+ }
+ bean.addProperty("modules", children);
+ }
+ // Publish to OSGi
+ String publish = element.getAttribute("publish");
+ if (Boolean.valueOf(publish)) {
+ // Publish Config
+ MutableServiceMetadata service = context.createMetadata(MutableServiceMetadata.class);
+ service.setServiceComponent(createRef(context, name));
+ service.addInterfaceName(JaasRealm.class.getName());
+ service.addServiceProperty(createValue(context, ProxyLoginModule.PROPERTY_MODULE), createValue(context, name));
+ context.getComponentDefinitionRegistry().registerComponentDefinition(service);
+ }
+ return bean;
+ }
+
+ public ComponentMetadata parseKeystore(Element element, ExtendedParserContext context) {
+ MutableBeanMetadata bean = context.createMetadata(MutableBeanMetadata.class);
+ bean.setClassName(ResourceKeystoreInstance.class.getName());
+ // Parse name
+ String name = element.getAttribute("name");
+ if (name == null || name.length() == 0) {
+ name = element.getAttribute("id");
+ }
+ if (name != null && name.length() > 0) {
+ bean.addProperty("name", createValue(context, name));
+ }
+ // Parse rank
+ String rank = element.getAttribute("rank");
+ if (rank != null && rank.length() > 0) {
+ bean.addProperty("rank", createValue(context, rank));
+ }
+ // Parse path
+ String path = element.getAttribute("path");
+ if (path != null && path.length() > 0) {
+ bean.addProperty("path", createValue(context, path));
+ }
+ // Parse keystorePassword
+ String keystorePassword = element.getAttribute("keystorePassword");
+ if (keystorePassword != null && keystorePassword.length() > 0) {
+ bean.addProperty("keystorePassword", createValue(context, keystorePassword));
+ }
+ // Parse keyPasswords
+ String keyPasswords = element.getAttribute("keyPasswords");
+ if (keyPasswords != null && keyPasswords.length() > 0) {
+ bean.addProperty("keyPasswords", createValue(context, keyPasswords));
+ }
+ // Parse publish
+ String publish = element.getAttribute("publish");
+ if (Boolean.valueOf(publish)) {
+ // Publish Config
+ MutableServiceMetadata service = context.createMetadata(MutableServiceMetadata.class);
+ service.setServiceComponent(createRef(context, name));
+ service.addInterfaceName(KeystoreInstance.class.getName());
+ context.getComponentDefinitionRegistry().registerComponentDefinition(service);
+ }
+ return bean;
+ }
+
+ private ValueMetadata createValue(ExtendedParserContext context, String value) {
+ MutableValueMetadata v = context.createMetadata(MutableValueMetadata.class);
+ v.setStringValue(value);
+ return v;
+ }
+
+ private RefMetadata createRef(ExtendedParserContext context, String value) {
+ MutableRefMetadata r = context.createMetadata(MutableRefMetadata.class);
+ r.setComponentId(value);
+ return r;
+ }
+
+ private static String getTextValue(Element element) {
+ StringBuffer value = new StringBuffer();
+ NodeList nl = element.getChildNodes();
+ for (int i = 0; i < nl.getLength(); i++) {
+ Node item = nl.item(i);
+ if ((item instanceof CharacterData && !(item instanceof Comment)) || item instanceof EntityReference) {
+ value.append(item.getNodeValue());
+ }
+ }
+ return value.toString();
+ }
}
diff --git a/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ProxyLoginModuleInitializer.java b/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ProxyLoginModuleInitializer.java
index f2b8c32..19df778 100644
--- a/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ProxyLoginModuleInitializer.java
+++ b/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ProxyLoginModuleInitializer.java
@@ -18,9 +18,8 @@
import org.apache.servicemix.kernel.jaas.boot.ProxyLoginModule;
import org.osgi.framework.BundleContext;
-import org.springframework.osgi.context.BundleContextAware;
-public class ProxyLoginModuleInitializer implements BundleContextAware {
+public class ProxyLoginModuleInitializer {
private BundleContext bundleContext;
diff --git a/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ResourceKeystoreInstance.java b/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ResourceKeystoreInstance.java
index 7974ed6..716d59d 100644
--- a/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ResourceKeystoreInstance.java
+++ b/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ResourceKeystoreInstance.java
@@ -33,6 +33,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.net.URL;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
@@ -43,7 +44,6 @@
import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.kernel.jaas.config.KeystoreInstance;
import org.apache.servicemix.kernel.jaas.config.KeystoreIsLocked;
-import org.springframework.core.io.Resource;
/**
*
@@ -55,7 +55,7 @@
private String name;
private int rank;
- private Resource path;
+ private URL path;
private String keystorePassword;
private Map keyPasswords = new HashMap();
private File keystoreFile; // Only valid after startup and if the resource points to a file
@@ -97,17 +97,17 @@
/**
* @return the keystorePath
*/
- public Resource getPath() {
+ public URL getPath() {
return path;
}
/**
* @param keystorePath the keystorePath to set
*/
- public void setPath(Resource keystorePath) throws IOException {
+ public void setPath(URL keystorePath) throws IOException {
this.path = keystorePath;
- if (keystorePath.getURL().getProtocol().equals("file")) {
- this.keystoreFile = keystorePath.getFile();
+ if (keystorePath.getProtocol().equals("file")) {
+ this.keystoreFile = new File(keystorePath.getPath());
}
}
@@ -261,7 +261,7 @@
if (keystore == null) {
keystore = KeyStore.getInstance(JKS);
}
- InputStream in = new BufferedInputStream(path.getInputStream());
+ InputStream in = new BufferedInputStream(path.openStream());
keystore.load(in, keystorePassword == null ? new char[0] : keystorePassword.toCharArray());
in.close();
Enumeration aliases = keystore.aliases();
diff --git a/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ResourceKeystoreInstanceParser.java b/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ResourceKeystoreInstanceParser.java
deleted file mode 100644
index 01f3531..0000000
--- a/jaas/jaas-config/src/main/java/org/apache/servicemix/kernel/jaas/config/impl/ResourceKeystoreInstanceParser.java
+++ /dev/null
@@ -1,89 +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.servicemix.kernel.jaas.config.impl;
-
-import org.w3c.dom.Element;
-
-import org.apache.servicemix.kernel.jaas.config.KeystoreInstance;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.config.BeanDefinitionHolder;
-import org.springframework.beans.factory.parsing.BeanComponentDefinition;
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean;
-
-/**
- * Spring parser for a keystore instance
- */
-public class ResourceKeystoreInstanceParser extends AbstractSingleBeanDefinitionParser {
-
- public static final String PUBLISH_ATTRIBUTE = "publish";
-
- protected Class getBeanClass(Element element) {
- return ResourceKeystoreInstance.class;
- }
-
- protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
- // Parse name
- String name = element.getAttribute("name");
- if (name == null || name.length() == 0) {
- name = element.getAttribute("id");
- }
- if (name != null && name.length() > 0) {
- builder.addPropertyValue("name", name);
- }
- // Parse rank
- String rank = element.getAttribute("rank");
- if (rank != null && rank.length() > 0) {
- builder.addPropertyValue("rank", rank);
- }
- // Parse path
- String path = element.getAttribute("path");
- if (path != null && path.length() > 0) {
- builder.addPropertyValue("path", path);
- }
- // Parse keystorePassword
- String keystorePassword = element.getAttribute("keystorePassword");
- if (keystorePassword != null && keystorePassword.length() > 0) {
- builder.addPropertyValue("keystorePassword", keystorePassword);
- }
- // Parse keyPasswords
- String keyPasswords = element.getAttribute("keyPasswords");
- if (keyPasswords != null && keyPasswords.length() > 0) {
- builder.addPropertyValue("keyPasswords", keyPasswords);
- }
- // Parse publish
- String publish = element.getAttribute("publish");
- if (Boolean.valueOf(publish)) {
- // Publish Config
- BeanDefinitionBuilder bd = BeanDefinitionBuilder.genericBeanDefinition(OsgiServiceFactoryBean.class);
- bd.addPropertyValue("target", builder.getBeanDefinition());
- bd.addPropertyValue("interfaces", new Class[] { KeystoreInstance.class });
- BeanDefinition def = bd.getBeanDefinition();
- String id = parserContext.getReaderContext().generateBeanName(def);
- BeanDefinitionHolder holder = new BeanDefinitionHolder(def, id);
- registerBeanDefinition(holder, parserContext.getRegistry());
- if (shouldFireEvents()) {
- BeanComponentDefinition componentDefinition = new BeanComponentDefinition(holder);
- postProcessComponentDefinition(componentDefinition);
- parserContext.registerComponent(componentDefinition);
- }
- }
- }
-
-}
diff --git a/jaas/jaas-config/src/main/resources/META-INF/spring.handlers b/jaas/jaas-config/src/main/resources/META-INF/spring.handlers
deleted file mode 100644
index fe59e34..0000000
--- a/jaas/jaas-config/src/main/resources/META-INF/spring.handlers
+++ /dev/null
@@ -1,20 +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.
-#
-################################################################################
-http\://servicemix.apache.org/jaas = org.apache.servicemix.kernel.jaas.config.impl.NamespaceHandler
-
\ No newline at end of file
diff --git a/jaas/jaas-config/src/main/resources/META-INF/spring.schemas b/jaas/jaas-config/src/main/resources/META-INF/spring.schemas
deleted file mode 100644
index 3001be1..0000000
--- a/jaas/jaas-config/src/main/resources/META-INF/spring.schemas
+++ /dev/null
@@ -1,19 +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.
-#
-################################################################################
-http\://servicemix.apache.org/schema/servicemix-jaas.xsd = org/apache/servicemix/kernel/jaas/config/servicemix-jaas.xsd
diff --git a/jaas/jaas-config/src/main/resources/META-INF/spring/servicemix-jaas.xml b/jaas/jaas-config/src/main/resources/META-INF/spring/servicemix-jaas.xml
deleted file mode 100644
index eca5fbd..0000000
--- a/jaas/jaas-config/src/main/resources/META-INF/spring/servicemix-jaas.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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: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">
-
- <bean id="config"
- class="org.apache.servicemix.kernel.jaas.config.impl.OsgiConfiguration"
- init-method="init"
- destroy-method="close"/>
-
- <osgi:list id="realms"
- interface="org.apache.servicemix.kernel.jaas.config.JaasRealm"
- cardinality="0..N">
- <osgi:listener ref="config" bind-method="register" unbind-method="unregister" />
- </osgi:list>
-
- <bean id="proxyLoginModuleInitializer"
- class="org.apache.servicemix.kernel.jaas.config.impl.ProxyLoginModuleInitializer"
- init-method="init"/>
-
- <!-- Register the Straight-Through flow -->
- <bean id="keystoreManager" class="org.apache.servicemix.kernel.jaas.config.impl.OsgiKeystoreManager" />
- <osgi:service ref="keystoreManager">
- <osgi:interfaces>
- <value>org.apache.servicemix.kernel.jaas.config.KeystoreManager</value>
- </osgi:interfaces>
- </osgi:service>
-
- <osgi:list id="keystores"
- interface="org.apache.servicemix.kernel.jaas.config.KeystoreInstance"
- cardinality="0..N">
- <osgi:listener ref="keystoreManager" bind-method="register" unbind-method="unregister" />
- </osgi:list>
-
-</beans>
diff --git a/jaas/jaas-config/src/main/resources/OSGI-INF/blueprint/servicemix-jaas.xml b/jaas/jaas-config/src/main/resources/OSGI-INF/blueprint/servicemix-jaas.xml
new file mode 100644
index 0000000..73f470e
--- /dev/null
+++ b/jaas/jaas-config/src/main/resources/OSGI-INF/blueprint/servicemix-jaas.xml
@@ -0,0 +1,54 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+ <bean id="config"
+ class="org.apache.servicemix.kernel.jaas.config.impl.OsgiConfiguration"
+ init-method="init"
+ destroy-method="close"/>
+
+ <ref-list id="realms"
+ interface="org.apache.servicemix.kernel.jaas.config.JaasRealm"
+ availability="optional">
+ <listener ref="config" bind-method="register" unbind-method="unregister" />
+ </ref-list>
+
+ <bean id="proxyLoginModuleInitializer" class="org.apache.servicemix.kernel.jaas.config.impl.ProxyLoginModuleInitializer" init-method="init">
+ <property name="bundleContext" ref="bundleContext"/>
+ </bean>
+
+ <!-- Register the Straight-Through flow -->
+ <bean id="keystoreManager" class="org.apache.servicemix.kernel.jaas.config.impl.OsgiKeystoreManager" />
+ <service ref="keystoreManager" interface="org.apache.servicemix.kernel.jaas.config.KeystoreManager" />
+
+ <ref-list id="keystores"
+ interface="org.apache.servicemix.kernel.jaas.config.KeystoreInstance"
+ availability="optional">
+ <listener ref="keystoreManager" bind-method="register" unbind-method="unregister" />
+ </ref-list>
+
+ <service interface="org.osgi.service.blueprint.namespace.NamespaceHandler">
+ <service-properties>
+ <entry key="org.osgi.blueprint.namespace" value="http://servicemix.apache.org/jaas"/>
+ </service-properties>
+ <bean class="org.apache.servicemix.kernel.jaas.config.impl.NamespaceHandler"/>
+ </service>
+
+</blueprint>
diff --git a/jaas/jaas-modules/pom.xml b/jaas/jaas-modules/pom.xml
index 964190f..f338339 100644
--- a/jaas/jaas-modules/pom.xml
+++ b/jaas/jaas-modules/pom.xml
@@ -60,10 +60,12 @@
<scope>provided</scope>
</dependency>
+ <!--
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-core</artifactId>
</dependency>
+ -->
</dependencies>
<build>
@@ -79,7 +81,6 @@
</Export-Package>
<Import-Package>
org.apache.servicemix.kernel.jaas.config,
- org.springframework.beans.factory.config,
*
</Import-Package>
<Spring-Context>*;publish-context:=false;create-asynchronously:=false</Spring-Context>
diff --git a/jaas/jaas-modules/src/main/resources/META-INF/spring/servicemix-jaas-module.xml b/jaas/jaas-modules/src/main/resources/META-INF/spring/servicemix-jaas-module.xml
index e8acabe..788f609 100644
--- a/jaas/jaas-modules/src/main/resources/META-INF/spring/servicemix-jaas-module.xml
+++ b/jaas/jaas-modules/src/main/resources/META-INF/spring/servicemix-jaas-module.xml
@@ -17,17 +17,13 @@
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:jaas="http://servicemix.apache.org/jaas"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/osgi
- http://www.springframework.org/schema/osgi/spring-osgi.xsd
- http://servicemix.apache.org/jaas
- http://servicemix.apache.org/schema/servicemix-jaas.xsd">
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:jaas="http://servicemix.apache.org/xmlns/jaas/v1.0.0">
+
+ <type-converters>
+ <!-- Bean to allow the ${servicemix.home} property to be correctly resolved -->
+ <bean class="org.apache.geronimo.blueprint.beans.SystemPropertyPlaceholder"/>
+ </type-converters>
<!--
- The following beans define an alternate realm which uses the OSGi Configuration Admin service
@@ -48,13 +44,10 @@
</jaas:config>
-->
- <!-- Bean to allow the ${servicemix.home} property to be correctly resolved -->
- <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
-
<jaas:config id="servicemix">
<jaas:module className="org.apache.servicemix.kernel.jaas.modules.properties.PropertiesLoginModule" flags="required">
users = ${servicemix.base}/etc/users.properties
</jaas:module>
</jaas:config>
-</beans>
\ No newline at end of file
+</blueprint>
\ No newline at end of file
diff --git a/management/pom.xml b/management/pom.xml
index 35f499f..512e4bb 100644
--- a/management/pom.xml
+++ b/management/pom.xml
@@ -35,14 +35,6 @@
<dependencies>
<dependency>
- <groupId>org.springframework.osgi</groupId>
- <artifactId>spring-osgi-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
<scope>provided</scope>
@@ -74,7 +66,6 @@
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
<Import-Package>
javax.management,
- org.springframework.jmx.support,
*
</Import-Package>
<Export-Package>org.apache.servicemix.management*</Export-Package>
diff --git a/management/src/main/java/org/apache/servicemix/management/ConnectorServerFactoryBean.java b/management/src/main/java/org/apache/servicemix/management/ConnectorServerFactoryBean.java
new file mode 100644
index 0000000..2e81438
--- /dev/null
+++ b/management/src/main/java/org/apache/servicemix/management/ConnectorServerFactoryBean.java
@@ -0,0 +1,139 @@
+/*
+ * 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.servicemix.management;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnectorServer;
+import javax.management.remote.JMXConnectorServerFactory;
+import javax.management.remote.JMXServiceURL;
+
+public class ConnectorServerFactoryBean {
+
+ private MBeanServer server;
+ private String serviceUrl;
+ private Map environment;
+ private ObjectName objectName;
+ private boolean threaded = false;
+ private boolean daemon = false;
+ private JMXConnectorServer connectorServer;
+
+ public MBeanServer getServer() {
+ return server;
+ }
+
+ public void setServer(MBeanServer server) {
+ this.server = server;
+ }
+
+ public String getServiceUrl() {
+ return serviceUrl;
+ }
+
+ public void setServiceUrl(String serviceUrl) {
+ this.serviceUrl = serviceUrl;
+ }
+
+ public Map getEnvironment() {
+ return environment;
+ }
+
+ public void setEnvironment(Map environment) {
+ this.environment = environment;
+ }
+
+ public ObjectName getObjectName() {
+ return objectName;
+ }
+
+ public void setObjectName(ObjectName objectName) {
+ this.objectName = objectName;
+ }
+
+ public boolean isThreaded() {
+ return threaded;
+ }
+
+ public void setThreaded(boolean threaded) {
+ this.threaded = threaded;
+ }
+
+ public boolean isDaemon() {
+ return daemon;
+ }
+
+ public void setDaemon(boolean daemon) {
+ this.daemon = daemon;
+ }
+
+ public void init() throws Exception {
+ if (this.server == null) {
+ throw new IllegalArgumentException("server must be set");
+ }
+ JMXServiceURL url = new JMXServiceURL(this.serviceUrl);
+ this.connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, this.environment, this.server);
+ if (this.objectName != null) {
+ this.server.registerMBean(this.connectorServer, this.objectName);
+ }
+ try {
+ if (this.threaded) {
+ // Start the connector server asynchronously (in a separate thread).
+ Thread connectorThread = new Thread() {
+ public void run() {
+ try {
+ connectorServer.start();
+ } catch (IOException ex) {
+ throw new RuntimeException("Could not start JMX connector server after delay", ex);
+ }
+ }
+ };
+ connectorThread.setName("JMX Connector Thread [" + this.serviceUrl + "]");
+ connectorThread.setDaemon(this.daemon);
+ connectorThread.start();
+ }
+ else {
+ this.connectorServer.start();
+ }
+ } catch (Exception ex) {
+ doUnregister(this.objectName);
+ throw ex;
+ }
+ }
+
+ public void destroy() throws Exception {
+ try {
+ this.connectorServer.stop();
+ } finally {
+ doUnregister(this.objectName);
+ }
+ }
+
+ protected void doUnregister(ObjectName objectName) {
+ try {
+ if (this.objectName != null && this.server.isRegistered(objectName)) {
+ this.server.unregisterMBean(objectName);
+ }
+ }
+ catch (JMException ex) {
+ // Ignore
+ }
+ }
+}
diff --git a/management/src/main/java/org/apache/servicemix/management/MBeanServerFactoryBean.java b/management/src/main/java/org/apache/servicemix/management/MBeanServerFactoryBean.java
new file mode 100644
index 0000000..e18925a
--- /dev/null
+++ b/management/src/main/java/org/apache/servicemix/management/MBeanServerFactoryBean.java
@@ -0,0 +1,117 @@
+/*
+ * 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.servicemix.management;
+
+import java.lang.management.ManagementFactory;
+import java.util.List;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
+public class MBeanServerFactoryBean {
+
+ private boolean locateExistingServerIfPossible = false;
+ private String agentId;
+ private String defaultDomain;
+ private boolean registerWithFactory = true;
+ private MBeanServer server;
+ private boolean newlyRegistered = false;
+
+ public boolean isLocateExistingServerIfPossible() {
+ return locateExistingServerIfPossible;
+ }
+
+ public void setLocateExistingServerIfPossible(boolean locateExistingServerIfPossible) {
+ this.locateExistingServerIfPossible = locateExistingServerIfPossible;
+ }
+
+ public String getAgentId() {
+ return agentId;
+ }
+
+ public void setAgentId(String agentId) {
+ this.agentId = agentId;
+ }
+
+ public String getDefaultDomain() {
+ return defaultDomain;
+ }
+
+ public void setDefaultDomain(String defaultDomain) {
+ this.defaultDomain = defaultDomain;
+ }
+
+ public boolean isRegisterWithFactory() {
+ return registerWithFactory;
+ }
+
+ public void setRegisterWithFactory(boolean registerWithFactory) {
+ this.registerWithFactory = registerWithFactory;
+ }
+
+ public boolean isNewlyRegistered() {
+ return newlyRegistered;
+ }
+
+ public void setNewlyRegistered(boolean newlyRegistered) {
+ this.newlyRegistered = newlyRegistered;
+ }
+
+ public MBeanServer getServer() throws Exception {
+ if (this.server == null) {
+ init();
+ }
+ return server;
+ }
+
+ public void init() throws Exception {
+ if (this.locateExistingServerIfPossible || this.agentId != null) {
+ try {
+ List servers = MBeanServerFactory.findMBeanServer(agentId);
+ MBeanServer server = null;
+ if (servers != null && servers.size() > 0) {
+ this.server = (MBeanServer) servers.get(0);
+ }
+ if (server == null && agentId == null) {
+ this.server = ManagementFactory.getPlatformMBeanServer();
+ }
+ if (this.server == null) {
+ throw new Exception("Unable to locate MBeanServer");
+ }
+ } catch (Exception ex) {
+ if (this.agentId != null) {
+ throw ex;
+ }
+ }
+ }
+ if (this.server == null) {
+ if (this.registerWithFactory) {
+ this.server = MBeanServerFactory.createMBeanServer(this.defaultDomain);
+ } else {
+ this.server = MBeanServerFactory.newMBeanServer(this.defaultDomain);
+ }
+ this.newlyRegistered = this.registerWithFactory;
+ }
+ }
+
+ public void destroy() throws Exception {
+ if (this.newlyRegistered) {
+ MBeanServerFactory.releaseMBeanServer(this.server);
+ }
+ }
+
+}
diff --git a/management/src/main/java/org/apache/servicemix/management/RmiRegistryFactoryBean.java b/management/src/main/java/org/apache/servicemix/management/RmiRegistryFactoryBean.java
index 1a5a995..c58b30e 100644
--- a/management/src/main/java/org/apache/servicemix/management/RmiRegistryFactoryBean.java
+++ b/management/src/main/java/org/apache/servicemix/management/RmiRegistryFactoryBean.java
@@ -21,15 +21,11 @@
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.FactoryBean;
-import org.springframework.beans.factory.InitializingBean;
-
/**
*
* @author gnodet
*/
-public class RmiRegistryFactoryBean implements FactoryBean, InitializingBean, DisposableBean {
+public class RmiRegistryFactoryBean {
private int port = Registry.REGISTRY_PORT;
private Registry registry;
@@ -91,7 +87,7 @@
return true;
}
- public void afterPropertiesSet() throws RemoteException {
+ public void init() throws RemoteException {
if (registry == null && locate) {
try {
Registry reg = LocateRegistry.getRegistry(getPort());
diff --git a/management/src/main/resources/META-INF/spring/servicemix-management.xml b/management/src/main/resources/META-INF/spring/servicemix-management.xml
deleted file mode 100644
index 6a9bcc3..0000000
--- a/management/src/main/resources/META-INF/spring/servicemix-management.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?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:ctx="http://www.springframework.org/schema/context"
- 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/context
- http://www.springframework.org/schema/context/spring-context.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">
-
- <!-- MBeanServer bean -->
- <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
- <property name="locateExistingServerIfPossible" value="true"/>
- </bean>
-
- <!-- Export the MBeanServer as an OSGi service -->
- <osgi:service ref="mbeanServer">
- <osgi:interfaces>
- <value>javax.management.MBeanServer</value>
- </osgi:interfaces>
- </osgi:service>
-
- <!-- Create a RMI registry -->
- <bean id="rmiRegistry" class="org.apache.servicemix.management.RmiRegistryFactoryBean">
- <property name="create" value="true" />
- <property name="locate" value="true" />
- <property name="port" value="${rmiRegistryPort}" />
- </bean>
-
- <!-- Create a JMX connector ServiceFactory -->
- <bean id="jmxConnectorService" class="org.springframework.jmx.support.ConnectorServerFactoryBean">
- <property name="server" ref="mbeanServer" />
- <property name="serviceUrl" value="${serviceUrl}" />
- <property name="daemon" value="${daemon}" />
- <property name="threaded" value="${threaded}" />
- <property name="objectName" value="${objectName}" />
- <property name="environment" ref="jmxConnectorEnvironment" />
- </bean>
-
- <!-- Environment map for connectors -->
- <util:map id="jmxConnectorEnvironment">
- <entry key="jmx.remote.authenticator" value-ref="jaasAuthenticator" />
- </util:map>
-
- <!-- JAAS authenticator -->
- <bean id="jaasAuthenticator" class="org.apache.servicemix.management.JaasAuthenticator">
- <property name="realm" value="${jmxRealm}" />
- </bean>
-
- <!-- Property place holder -->
- <osgix:cm-properties id="cmProps" persistent-id="org.apache.servicemix.management">
- <prop key="rmiRegistryPort">1099</prop>
- <prop key="jmxRealm">servicemix</prop>
- <prop key="serviceUrl">service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi</prop>
- <prop key="daemon">true</prop>
- <prop key="threaded">true</prop>
- <prop key="objectName">connector:name=rmi</prop>
- </osgix:cm-properties>
-
- <ctx:property-placeholder properties-ref="cmProps" />
-
-</beans>
-
diff --git a/management/src/main/resources/OSGI-INF/blueprint/servicemix-management.xml b/management/src/main/resources/OSGI-INF/blueprint/servicemix-management.xml
new file mode 100644
index 0000000..decded7
--- /dev/null
+++ b/management/src/main/resources/OSGI-INF/blueprint/servicemix-management.xml
@@ -0,0 +1,73 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:cm="http://www.osgi.org/xmlns/blueprint-cm/v1.0.0">
+
+ <type-converters>
+ <!-- Property place holder -->
+ <cm:property-placeholder persistent-id="org.apache.servicemix.management">
+ <cm:default-properties>
+ <cm:property name="rmiRegistryPort" value="1099"/>
+ <cm:property name="jmxRealm" value="servicemix"/>
+ <cm:property name="serviceUrl" value="service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"/>
+ <cm:property name="daemon" value="true"/>
+ <cm:property name="threaded" value="true"/>
+ <cm:property name="objectName" value="connector:name=rmi"/>
+ </cm:default-properties>
+ </cm:property-placeholder>
+ </type-converters>
+
+ <!-- MBeanServer bean -->
+ <bean id="mbeanServerFactory" class="org.apache.servicemix.management.MBeanServerFactoryBean" init-method="init" destroy-method="destroy">
+ <property name="locateExistingServerIfPossible" value="true"/>
+ </bean>
+ <bean id="mbeanServer" factory-component="mbeanServerFactory" factory-method="getServer"/>
+
+ <!-- Export the MBeanServer as an OSGi service -->
+ <service ref="mbeanServer" interface="javax.management.MBeanServer"/>
+
+ <!-- Create a RMI registry -->
+ <bean id="rmiRegistryFactory" class="org.apache.servicemix.management.RmiRegistryFactoryBean" init-method="init" destroy-method="destroy">
+ <property name="create" value="true"/>
+ <property name="locate" value="true"/>
+ <property name="port" value="${rmiRegistryPort}"/>
+ </bean>
+
+ <!-- Create a JMX connector ServiceFactory -->
+ <bean id="connectorFactory" class="org.apache.servicemix.management.ConnectorServerFactoryBean" init-method="init" destroy-method="destroy">
+ <property name="server" ref="mbeanServer"/>
+ <property name="serviceUrl" value="${serviceUrl}"/>
+ <property name="daemon" value="${daemon}"/>
+ <property name="threaded" value="${threaded}"/>
+ <property name="objectName" value="${objectName}"/>
+ <property name="environment">
+ <map>
+ <entry key="jmx.remote.authenticator" value-ref="jaasAuthenticator"/>
+ </map>
+ </property>
+ </bean>
+
+ <!-- JAAS authenticator -->
+ <bean id="jaasAuthenticator" class="org.apache.servicemix.management.JaasAuthenticator">
+ <property name="realm" value="${jmxRealm}"/>
+ </bean>
+
+</blueprint>
+
diff --git a/pom.xml b/pom.xml
index cb536fb..3934101 100644
--- a/pom.xml
+++ b/pom.xml
@@ -39,12 +39,16 @@
<module>filemonitor</module>
<module>gshell</module>
<module>spring</module>
+ <!--
<module>testing</module>
+ -->
<module>jaas</module>
<module>client</module>
<module>management</module>
<module>assembly</module>
+ <!--
<module>demos</module>
+ -->
</modules>
<scm>
@@ -84,6 +88,7 @@
<felix.bundlerepository.version>1.2.1</felix.bundlerepository.version>
<felix.prefs.version>1.0.2</felix.prefs.version>
<geronimo.annotation.version>1.1.1</geronimo.annotation.version>
+ <geronimo.blueprint.version>1.0.0-SNAPSHOT</geronimo.blueprint.version>
<geronimo.servlet.version>1.1.2</geronimo.servlet.version>
<gshell.version>1.0-alpha-2</gshell.version>
<jaxp.ri.version>1.4.2_1</jaxp.ri.version>
@@ -197,7 +202,7 @@
</dependency>
<dependency>
<groupId>org.apache.servicemix.kernel</groupId>
- <artifactId>org.apache.servicemix.kernel.spring</artifactId>
+ <artifactId>org.apache.servicemix.kernel.blueprint</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
@@ -251,6 +256,11 @@
<version>${pom.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.servicemix.kernel.gshell</groupId>
+ <artifactId>org.apache.servicemix.kernel.gshell.run</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.servicemix.kernel.jaas</groupId>
<artifactId>org.apache.servicemix.kernel.jaas.boot</artifactId>
<version>${pom.version}</version>
@@ -352,6 +362,12 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.apache.geronimo</groupId>
+ <artifactId>blueprint-bundle</artifactId>
+ <version>${geronimo.blueprint.version}</version>
+ </dependency>
+ <!--
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
@@ -420,6 +436,7 @@
<artifactId>spring-osgi-annotation</artifactId>
<version>${spring.osgi.version}</version>
</dependency>
+ -->
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
diff --git a/spring/pom.xml b/spring/pom.xml
index f4ad017..e46b269 100644
--- a/spring/pom.xml
+++ b/spring/pom.xml
@@ -28,7 +28,7 @@
</parent>
<groupId>org.apache.servicemix.kernel</groupId>
- <artifactId>org.apache.servicemix.kernel.spring</artifactId>
+ <artifactId>org.apache.servicemix.kernel.blueprint</artifactId>
<packaging>bundle</packaging>
<version>1.2.0-blueprint-SNAPSHOT</version>
<name>Apache ServiceMix Kernel :: Spring Deployer</name>
@@ -41,10 +41,12 @@
<artifactId>org.osgi.core</artifactId>
<scope>provided</scope>
</dependency>
+ <!--
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-core</artifactId>
</dependency>
+ -->
<dependency>
<groupId>org.apache.servicemix.kernel</groupId>
<artifactId>org.apache.servicemix.kernel.filemonitor</artifactId>
@@ -63,7 +65,7 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
- <Private-Package>org.apache.servicemix.kernel.spring</Private-Package>
+ <Private-Package>org.apache.servicemix.kernel.blueprint</Private-Package>
<Spring-Context>*;publish-context:=false;create-asynchronously:=false</Spring-Context>
</instructions>
</configuration>
diff --git a/spring/src/main/java/org/apache/servicemix/kernel/spring/SpringDeploymentListener.java b/spring/src/main/java/org/apache/servicemix/kernel/blueprint/BlueprintDeploymentListener.java
similarity index 84%
rename from spring/src/main/java/org/apache/servicemix/kernel/spring/SpringDeploymentListener.java
rename to spring/src/main/java/org/apache/servicemix/kernel/blueprint/BlueprintDeploymentListener.java
index ce0c1e0..6748b2a 100644
--- a/spring/src/main/java/org/apache/servicemix/kernel/spring/SpringDeploymentListener.java
+++ b/spring/src/main/java/org/apache/servicemix/kernel/blueprint/BlueprintDeploymentListener.java
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.servicemix.kernel.spring;
+package org.apache.servicemix.kernel.blueprint;
import java.io.File;
import java.io.FileOutputStream;
@@ -33,10 +33,10 @@
* A deployment listener that listens for spring xml applications
* and creates bundles for these.
*/
-public class SpringDeploymentListener implements DeploymentListener {
+public class BlueprintDeploymentListener implements DeploymentListener {
- private static final Log LOGGER = LogFactory.getLog(SpringDeploymentListener.class);
+ private static final Log LOGGER = LogFactory.getLog(BlueprintDeploymentListener.class);
private DocumentBuilderFactory dbf;
@@ -46,7 +46,7 @@
Document doc = parse(artifact);
String name = doc.getDocumentElement().getLocalName();
String uri = doc.getDocumentElement().getNamespaceURI();
- if ("beans".equals(name) && "http://www.springframework.org/schema/beans".equals(uri)) {
+ if ("beans".equals(name) && "http://www.osgi.org/xmlns/blueprint/v1.0.0".equals(uri)) {
return true;
}
}
@@ -60,11 +60,11 @@
try {
File destFile = new File(tmpDir, artifact.getName() + ".jar");
FileOutputStream os = new FileOutputStream(destFile);
- SpringTransformer.transform(artifact.toURL(), os);
+ BlueprintTransformer.transform(artifact.toURL(), os);
os.close();
return destFile;
} catch (Exception e) {
- LOGGER.error("Unable to build spring application bundle", e);
+ LOGGER.error("Unable to build blueprint application bundle", e);
return null;
}
}
diff --git a/spring/src/main/java/org/apache/servicemix/kernel/spring/SpringTransformer.java b/spring/src/main/java/org/apache/servicemix/kernel/blueprint/BlueprintTransformer.java
similarity index 94%
rename from spring/src/main/java/org/apache/servicemix/kernel/spring/SpringTransformer.java
rename to spring/src/main/java/org/apache/servicemix/kernel/blueprint/BlueprintTransformer.java
index 982fbc9..ac14939 100644
--- a/spring/src/main/java/org/apache/servicemix/kernel/spring/SpringTransformer.java
+++ b/spring/src/main/java/org/apache/servicemix/kernel/blueprint/BlueprintTransformer.java
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.servicemix.kernel.spring;
+package org.apache.servicemix.kernel.blueprint;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
@@ -51,7 +51,7 @@
import org.osgi.framework.Constants;
-public class SpringTransformer {
+public class BlueprintTransformer {
static Transformer transformer;
static DocumentBuilderFactory dbf;
@@ -74,7 +74,6 @@
m.getMainAttributes().putValue(Constants.BUNDLE_MANIFESTVERSION, "2");
m.getMainAttributes().putValue(Constants.BUNDLE_SYMBOLICNAME, str[0]);
m.getMainAttributes().putValue(Constants.BUNDLE_VERSION, str[1]);
- m.getMainAttributes().putValue("Spring-Context", "*;publish-context:=false;create-asynchronously:=true");
String importPkgs = getImportPackages(analyze(new DOMSource(doc)));
if (importPkgs != null && importPkgs.length() > 0) {
m.getMainAttributes().putValue(Constants.IMPORT_PACKAGE, importPkgs);
@@ -103,12 +102,12 @@
out.putNextEntry(e);
m.write(out);
out.closeEntry();
- e = new ZipEntry("META-INF/");
+ e = new ZipEntry("OSGI-INF/");
out.putNextEntry(e);
- e = new ZipEntry("META-INF/spring/");
+ e = new ZipEntry("OSGI-INF/blueprint/");
out.putNextEntry(e);
out.closeEntry();
- e = new ZipEntry("META-INF/spring/" + name);
+ e = new ZipEntry("META-INF/blueprint/" + name);
out.putNextEntry(e);
// Copy the new DOM
if (tf == null) {
@@ -185,7 +184,7 @@
if (tf == null) {
tf = TransformerFactory.newInstance();
}
- Source s = new StreamSource(SpringTransformer.class.getResourceAsStream("extract.xsl"));
+ Source s = new StreamSource(BlueprintTransformer.class.getResourceAsStream("extract.xsl"));
transformer = tf.newTransformer(s);
}
diff --git a/spring/src/main/java/org/apache/servicemix/kernel/spring/SpringURLHandler.java b/spring/src/main/java/org/apache/servicemix/kernel/blueprint/BlueprintURLHandler.java
similarity index 80%
rename from spring/src/main/java/org/apache/servicemix/kernel/spring/SpringURLHandler.java
rename to spring/src/main/java/org/apache/servicemix/kernel/blueprint/BlueprintURLHandler.java
index e9fedaf..08abb39 100644
--- a/spring/src/main/java/org/apache/servicemix/kernel/spring/SpringURLHandler.java
+++ b/spring/src/main/java/org/apache/servicemix/kernel/blueprint/BlueprintURLHandler.java
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.servicemix.kernel.spring;
+package org.apache.servicemix.kernel.blueprint;
import java.io.File;
import java.io.FileInputStream;
@@ -34,13 +34,13 @@
* A URL handler that will transform a JBI artifact to an OSGi bundle
* on the fly. Needs to be registered in the OSGi registry.
*/
-public class SpringURLHandler extends AbstractURLStreamHandlerService {
+public class BlueprintURLHandler extends AbstractURLStreamHandlerService {
- private static Log logger = LogFactory.getLog(SpringURLHandler.class);
+ private static Log logger = LogFactory.getLog(BlueprintURLHandler.class);
- private static String SYNTAX = "spring: spring-xml-uri";
+ private static String SYNTAX = "blueprint: blueprint-xml-uri";
- private URL springXmlURL;
+ private URL bueprintXmlURL;
/**
* Open the connection for the given URL.
@@ -54,14 +54,14 @@
if (url.getPath() == null || url.getPath().trim().length() == 0) {
throw new MalformedURLException ("Path can not be null or empty. Syntax: " + SYNTAX );
}
- springXmlURL = new URL(url.getPath());
+ bueprintXmlURL = new URL(url.getPath());
- logger.debug("Spring xml URL is: [" + springXmlURL + "]");
+ logger.debug("Blueprint xml URL is: [" + bueprintXmlURL + "]");
return new Connection(url);
}
- public URL getSpringXmlURL() {
- return springXmlURL;
+ public URL getBueprintXmlURL() {
+ return bueprintXmlURL;
}
public class Connection extends URLConnection {
@@ -79,7 +79,7 @@
try {
final File f = File.createTempFile("smx", "xml");
FileOutputStream os = new FileOutputStream(f);
- SpringTransformer.transform(springXmlURL, os);
+ BlueprintTransformer.transform(bueprintXmlURL, os);
os.close();
return new FileInputStream(f) {
public void close() throws IOException {
@@ -88,8 +88,8 @@
}
};
} catch (Exception e) {
- logger.error("Error opening spring xml url", e);
- throw (IOException) new IOException("Error opening spring xml url").initCause(e);
+ logger.error("Error opening blueprint xml url", e);
+ throw (IOException) new IOException("Error opening blueprint xml url").initCause(e);
}
}
}
diff --git a/spring/src/main/resources/META-INF/spring/spring-deployer.xml b/spring/src/main/resources/META-INF/spring/spring-deployer.xml
deleted file mode 100644
index 779c2af..0000000
--- a/spring/src/main/resources/META-INF/spring/spring-deployer.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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: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">
-
- <bean id="springDeploymentListener" class="org.apache.servicemix.kernel.spring.SpringDeploymentListener">
-
- </bean>
-
- <osgi:service ref="springDeploymentListener">
- <osgi:interfaces>
- <value>org.apache.servicemix.kernel.filemonitor.DeploymentListener</value>
- </osgi:interfaces>
- </osgi:service>
-
- <bean id="springHandler" class="org.apache.servicemix.kernel.spring.SpringURLHandler" />
-
- <osgi:service ref="springHandler" interface="org.osgi.service.url.URLStreamHandlerService">
- <osgi:service-properties>
- <entry key="url.handler.protocol" value="spring"/>
- </osgi:service-properties>
- </osgi:service>
-
-</beans>
\ No newline at end of file
diff --git a/spring/src/main/resources/OSGI-INF/blueprint/blueprint-deployer.xml b/spring/src/main/resources/OSGI-INF/blueprint/blueprint-deployer.xml
new file mode 100644
index 0000000..8b4c356
--- /dev/null
+++ b/spring/src/main/resources/OSGI-INF/blueprint/blueprint-deployer.xml
@@ -0,0 +1,33 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+ <service interface="org.apache.servicemix.kernel.filemonitor.DeploymentListener">
+ <bean class="org.apache.servicemix.kernel.blueprint.BlueprintDeploymentListener"/>
+ </service>
+
+ <service interface="org.osgi.service.url.URLStreamHandlerService">
+ <service-properties>
+ <entry key="url.handler.protocol" value="blueprint"/>
+ </service-properties>
+ <bean class="org.apache.servicemix.kernel.blueprint.BlueprintURLHandler" />
+ </service>
+
+</blueprint>
\ No newline at end of file
diff --git a/spring/src/main/resources/org/apache/servicemix/kernel/blueprint/extract.xsl b/spring/src/main/resources/org/apache/servicemix/kernel/blueprint/extract.xsl
new file mode 100644
index 0000000..87ceeb3
--- /dev/null
+++ b/spring/src/main/resources/org/apache/servicemix/kernel/blueprint/extract.xsl
@@ -0,0 +1,48 @@
+<?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.
+
+-->
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:osgi="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+ <xsl:output method="text" />
+
+ <xsl:template match="/">
+
+ <!-- Match all attributes that holds a class or a comma delimited
+ list of classes and print them -->
+
+ <xsl:for-each select="
+ //osgi:bean/@class
+ | //osgi:*/@value-type
+ | //osgi:*/@key-type
+ | //osgi:*/@interface
+ ">
+ <xsl:value-of select="." />
+ <xsl:text>
+ </xsl:text>
+ </xsl:for-each>
+
+ <!-- This seems some magic to get extra imports? -->
+
+ </xsl:template>
+
+
+</xsl:stylesheet>
+
diff --git a/spring/src/main/resources/org/apache/servicemix/kernel/spring/extract.xsl b/spring/src/main/resources/org/apache/servicemix/kernel/spring/extract.xsl
deleted file mode 100644
index 4b06b69..0000000
--- a/spring/src/main/resources/org/apache/servicemix/kernel/spring/extract.xsl
+++ /dev/null
@@ -1,79 +0,0 @@
-<?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.
-
--->
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:beans="http://www.springframework.org/schema/beans"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:jee="http://www.springframework.org/schema/jee"
- xmlns:jms="http://www.springframework.org/schema/jms"
- xmlns:lang="http://www.springframework.org/schema/lang"
- xmlns:osgi-compendium="http://www.springframework.org/schema/osgi-compendium"
- xmlns:osgi="http://www.springframework.org/schema/osgi"
- xmlns:tool="http://www.springframework.org/schema/tool"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:util="http://www.springframework.org/schema/util"
- xmlns:webflow-config="http://www.springframework.org/schema/webflow-config">
-
- <xsl:output method="text" />
-
- <xsl:template match="/">
-
- <!-- Match all attributes that holds a class or a comma delimited
- list of classes and print them -->
-
- <xsl:for-each select="
- //beans:bean/@class
- | //beans:*/@value-type
- | //aop:*/@implement-interface
- | //aop:*/@default-impl
- | //context:load-time-weaver/@weaver-class
- | //jee:jndi-lookup/@expected-type
- | //jee:jndi-lookup/@proxy-interface
- | //jee:remote-slsb/@ejbType
- | //jee:*/@business-interface
- | //lang:*/@script-interfaces
- | //osgi:*/@interface
- | //util:list/@list-class
- | //util:set/@set-class
- | //util:map/@map-class
- | //webflow-config:*/@class
- ">
- <xsl:value-of select="." />
- <xsl:text>
- </xsl:text>
- </xsl:for-each>
-
- <!-- This seems some magic to get extra imports? -->
-
- <xsl:for-each select="//beans:bean[@class='org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean'
- or @class='org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean']">
- <xsl:for-each select="beans:property[@name='interfaces']">
- <xsl:value-of select="@value" />
- <xsl:text>
- </xsl:text>
- </xsl:for-each>
- </xsl:for-each>
-
- </xsl:template>
-
-
-</xsl:stylesheet>
-
diff --git a/spring/src/test/java/org/apache/servicemix/kernel/spring/SpringDeploymentListenerTest.java b/spring/src/test/java/org/apache/servicemix/kernel/spring/SpringDeploymentListenerTest.java
index 38a37bb..d70fd30 100644
--- a/spring/src/test/java/org/apache/servicemix/kernel/spring/SpringDeploymentListenerTest.java
+++ b/spring/src/test/java/org/apache/servicemix/kernel/spring/SpringDeploymentListenerTest.java
@@ -29,13 +29,15 @@
import javax.xml.transform.dom.DOMSource;
import junit.framework.TestCase;
+import org.apache.servicemix.kernel.blueprint.BlueprintDeploymentListener;
+import org.apache.servicemix.kernel.blueprint.BlueprintTransformer;
public class SpringDeploymentListenerTest extends TestCase {
public void testPackagesExtraction() throws Exception {
- SpringDeploymentListener l = new SpringDeploymentListener();
- File f = new File(getClass().getClassLoader().getResource("META-INF/spring/spring-deployer.xml").toURI());
- Set<String> pkgs = SpringTransformer.analyze(new DOMSource(SpringTransformer.parse(f.toURL())));
+ BlueprintDeploymentListener l = new BlueprintDeploymentListener();
+ File f = new File(getClass().getClassLoader().getResource("OSGI-INF/blueprint/blueprint-deployer.xml").toURI());
+ Set<String> pkgs = BlueprintTransformer.analyze(new DOMSource(BlueprintTransformer.parse(f.toURL())));
assertNotNull(pkgs);
assertEquals(2, pkgs.size());
Iterator<String> it = pkgs.iterator();
@@ -47,7 +49,7 @@
File f = File.createTempFile("smx", ".jar");
try {
OutputStream os = new FileOutputStream(f);
- SpringTransformer.transform(getClass().getClassLoader().getResource("test.xml"), os);
+ BlueprintTransformer.transform(getClass().getClassLoader().getResource("test.xml"), os);
os.close();
InputStream is = new FileInputStream(f);
JarInputStream jar = new JarInputStream(is);
@@ -74,7 +76,7 @@
}
private void assertVersion(String s, String... expectedParts) {
- String[] parts = SpringTransformer.extractNameVersionType(s);
+ String[] parts = BlueprintTransformer.extractNameVersionType(s);
assertEquals(expectedParts.length, parts.length);
for (int i = 0; i < expectedParts.length; i++) {
assertEquals(expectedParts[i], parts[i]);
diff --git a/spring/src/test/resources/test.xml b/spring/src/test/resources/test.xml
index 7976cbb..0c2a856 100644
--- a/spring/src/test/resources/test.xml
+++ b/spring/src/test/resources/test.xml
@@ -34,7 +34,7 @@
Header=value
</manifest>
- <bean id="springDeploymentListener" class="org.apache.servicemix.kernel.spring.SpringDeploymentListener">
+ <bean id="springDeploymentListener" class="org.apache.servicemix.kernel.blueprint.BlueprintDeploymentListener">
</bean>
@@ -44,7 +44,7 @@
</osgi:interfaces>
</osgi:service>
- <bean id="springHandler" class="org.apache.servicemix.kernel.spring.SpringURLHandler" />
+ <bean id="springHandler" class="org.apache.servicemix.kernel.blueprint.BlueprintURLHandler" />
<osgi:service ref="springHandler" interface="org.osgi.service.url.URLStreamHandlerService">
<osgi:service-properties>