You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2011/04/21 23:59:21 UTC
svn commit: r1095828 - in /geronimo/server/trunk/plugins/aries: ./
aries-deployer/ geronimo-aries-shell/ geronimo-aries-shell/src/
geronimo-aries-shell/src/main/ geronimo-aries-shell/src/main/java/
geronimo-aries-shell/src/main/java/org/ geronimo-aries...
Author: gawor
Date: Thu Apr 21 21:59:20 2011
New Revision: 1095828
URL: http://svn.apache.org/viewvc?rev=1095828&view=rev
Log:
GERONIMO-5926: Shell command for resolving Aries applications
Added:
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/pom.xml (with props)
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/apache/
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/apache/geronimo/
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/apache/geronimo/aries/
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/apache/geronimo/aries/shell/
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/apache/geronimo/aries/shell/ResolveApplication.java (with props)
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/resources/
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/resources/OSGI-INF/
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/resources/OSGI-INF/blueprint/
geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/resources/OSGI-INF/blueprint/shell-eba.xml (with props)
Modified:
geronimo/server/trunk/plugins/aries/aries-deployer/pom.xml
geronimo/server/trunk/plugins/aries/pom.xml
Modified: geronimo/server/trunk/plugins/aries/aries-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/aries/aries-deployer/pom.xml?rev=1095828&r1=1095827&r2=1095828&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/aries/aries-deployer/pom.xml (original)
+++ geronimo/server/trunk/plugins/aries/aries-deployer/pom.xml Thu Apr 21 21:59:20 2011
@@ -47,13 +47,12 @@
<version>${project.version}</version>
<type>car</type>
</dependency>
-<!--
+
<dependency>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-aries-shell</artifactId>
<version>${project.version}</version>
</dependency>
--->
<dependency>
<groupId>org.apache.aries.blueprint</groupId>
Added: geronimo/server/trunk/plugins/aries/geronimo-aries-shell/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/aries/geronimo-aries-shell/pom.xml?rev=1095828&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/aries/geronimo-aries-shell/pom.xml (added)
+++ geronimo/server/trunk/plugins/aries/geronimo-aries-shell/pom.xml Thu Apr 21 21:59:20 2011
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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$ $Date$ -->
+
+<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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.geronimo.plugins</groupId>
+ <artifactId>aries</artifactId>
+ <version>3.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-aries-shell</artifactId>
+ <packaging>bundle</packaging>
+ <name>Geronimo Plugins, Aries :: Shell</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.aries.application</groupId>
+ <artifactId>org.apache.aries.application.api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.aries.application</groupId>
+ <artifactId>org.apache.aries.application.utils</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.karaf.shell</groupId>
+ <artifactId>org.apache.karaf.shell.console</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Import-Package>
+ org.apache.felix.service.command;version="0.4.0",
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: geronimo/server/trunk/plugins/aries/geronimo-aries-shell/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/aries/geronimo-aries-shell/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/aries/geronimo-aries-shell/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/apache/geronimo/aries/shell/ResolveApplication.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/apache/geronimo/aries/shell/ResolveApplication.java?rev=1095828&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/apache/geronimo/aries/shell/ResolveApplication.java (added)
+++ geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/apache/geronimo/aries/shell/ResolveApplication.java Thu Apr 21 21:59:20 2011
@@ -0,0 +1,87 @@
+/*
+ * 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.aries.shell;
+
+import java.io.File;
+import java.io.FileOutputStream;
+
+import org.apache.aries.application.management.AriesApplication;
+import org.apache.aries.application.management.AriesApplicationManager;
+import org.apache.aries.application.utils.filesystem.FileSystem;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Option;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Command(scope = "eba", name = "resolve", description = "Resolve Aries Application")
+public class ResolveApplication extends OsgiCommandSupport {
+
+ @Argument(required = true, description = "Aries Application location")
+ String applicationPath;
+
+ @Option(name = "-o", aliases = { "--out" }, description = "Location to output the resolved application")
+ String resovledApplicationPath;
+
+ protected AriesApplicationManager getAriesApplicationManager() {
+ ServiceReference ref =
+ bundleContext.getServiceReference(AriesApplicationManager.class.getName());
+ return getService(AriesApplicationManager.class, ref);
+ }
+
+ @Override
+ protected Object doExecute() throws Exception {
+ File sourceApplication = new File(applicationPath);
+ AriesApplicationManager manager = getAriesApplicationManager();
+ AriesApplication application = manager.createApplication(FileSystem.getFSRoot(sourceApplication));
+
+ if (application.isResolved()) {
+ System.out.println("Application " + application.getApplicationMetadata().getApplicationSymbolicName() + " is already resolved.");
+ } else {
+ System.out.println("Attempting to resolve " + application.getApplicationMetadata().getApplicationSymbolicName() + " application.");
+
+ AriesApplication resolved = manager.resolve(application);
+ File targetApplication = null;
+ if (resovledApplicationPath == null) {
+ targetApplication = new File(applicationPath + ".tmp");
+ } else {
+ targetApplication = new File(resovledApplicationPath);
+ }
+ FileOutputStream os = new FileOutputStream(targetApplication);
+ try {
+ resolved.store(os);
+ } finally {
+ os.close();
+ }
+ if (resovledApplicationPath == null) {
+ targetApplication.renameTo(sourceApplication);
+ targetApplication.delete();
+ }
+
+ System.out.println("Application " + application.getApplicationMetadata().getApplicationSymbolicName() + " is now resolved.");
+ }
+
+ return null;
+ }
+
+}
Propchange: geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/apache/geronimo/aries/shell/ResolveApplication.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/apache/geronimo/aries/shell/ResolveApplication.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/java/org/apache/geronimo/aries/shell/ResolveApplication.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/resources/OSGI-INF/blueprint/shell-eba.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/resources/OSGI-INF/blueprint/shell-eba.xml?rev=1095828&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/resources/OSGI-INF/blueprint/shell-eba.xml (added)
+++ geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/resources/OSGI-INF/blueprint/shell-eba.xml Thu Apr 21 21:59:20 2011
@@ -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"
+ default-activation="lazy">
+
+ <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
+ <command name="eba/resolve">
+ <action class="org.apache.geronimo.aries.shell.ResolveApplication"></action>
+ </command>
+ </command-bundle>
+
+</blueprint>
Propchange: geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/resources/OSGI-INF/blueprint/shell-eba.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/resources/OSGI-INF/blueprint/shell-eba.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/aries/geronimo-aries-shell/src/main/resources/OSGI-INF/blueprint/shell-eba.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: geronimo/server/trunk/plugins/aries/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/aries/pom.xml?rev=1095828&r1=1095827&r2=1095828&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/aries/pom.xml (original)
+++ geronimo/server/trunk/plugins/aries/pom.xml Thu Apr 21 21:59:20 2011
@@ -41,6 +41,7 @@
<module>aries</module>
<module>geronimo-aries-builder</module>
<module>aries-deployer</module>
+ <module>geronimo-aries-shell</module>
</modules>
<dependencyManagement>