Author: mnuttall
Date: Tue Dec 22 15:04:50 2009
New Revision: 893195
URL: http://svn.apache.org/viewvc?rev=893195&view=rev
Log:
ARIES-89: Implement application support: service interfaces
Added:
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/DeploymentContent.java
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/DeploymentMetadata.java
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationContext.java
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationEvent.java
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationListener.java
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/AriesApplication.java
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/AriesApplicationManager.java
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/BundleInfo.java
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ManagementException.java
Added:
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/DeploymentContent.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/DeploymentContent.java?rev=893195&view=auto
==============================================================================
---
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/DeploymentContent.java
(added)
+++
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/DeploymentContent.java
Tue Dec 22 15:04:50 2009
@@ -0,0 +1,37 @@
+/*
+ * 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 WARRANTIESOR 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.aries.application;
+
+import org.osgi.framework.Version;
+
+/**
+ * An entry in DEPLOYMENT.MF's Deployed-Content header
+ *
+ */
+public interface DeploymentContent extends Content {
+
+ /**
+ * get the exact version of the deployment content
+ * this cannot be null
+ * @return the exact version
+ */
+ public Version getExactVersion();
+
+}
Added:
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/DeploymentMetadata.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/DeploymentMetadata.java?rev=893195&view=auto
==============================================================================
---
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/DeploymentMetadata.java
(added)
+++
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/DeploymentMetadata.java
Tue Dec 22 15:04:50 2009
@@ -0,0 +1,56 @@
+/*
+ * 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 WARRANTIESOR 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.aries.application;
+
+import java.util.List;
+
+import org.osgi.framework.Version;
+
+/**
+ * Represents the parsed contents of a DEPLOYMENT.MF file
+ *
+ */
+public interface DeploymentMetadata {
+
+ /**
+ * get the value of the Application-SymbolicName header
+ * @return the value of the Application-SymbolicName header
+ */
+ public String getApplicationSymbolicName();
+
+ /**
+ * get the value of the Application-Version header
+ * @return the value of the Application-Version header
+ */
+ public Version getApplicationVersion();
+
+ /**
+ * get the value of the Deployed-Content header
+ * @return the list of the deployed content
+ */
+ public List<DeploymentContent> getApplicationDeploymentContents();
+
+ /**
+ * return the application this deployment metadata is associated with.
+ *
+ * @return the application.
+ */
+ public ApplicationMetadata getApplicationMetadata();
+}
Added:
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationContext.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationContext.java?rev=893195&view=auto
==============================================================================
---
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationContext.java
(added)
+++
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationContext.java
Tue Dec 22 15:04:50 2009
@@ -0,0 +1,41 @@
+/*
+ * 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 WARRANTIESOR 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.aries.application.management;
+
+import java.util.Set;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * Represents an Aries application in the runtime
+ */
+public interface ApplicationContext
+{
+ public ApplicationState getApplicationState();
+ public AriesApplication getApplication();
+ public void start();
+ public void stop();
+ public Set<Bundle> getApplicationContent(); //
+
+ public enum ApplicationState
+ {
+ INSTALLED, RESOLVED, STARTING, STOPPING, ACTIVE, UNINSTALLED
+ }
+}
Added:
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationEvent.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationEvent.java?rev=893195&view=auto
==============================================================================
---
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationEvent.java
(added)
+++
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationEvent.java
Tue Dec 22 15:04:50 2009
@@ -0,0 +1,31 @@
+/*
+ * 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 WARRANTIESOR 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.aries.application.management;
+
+/**
+ * Passed to ApplicationListener clients
+ *
+ */
+public abstract class ApplicationEvent {
+
+ abstract public ApplicationContext.ApplicationState getType();
+ abstract public AriesApplication getApplication();
+
+}
Added:
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationListener.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationListener.java?rev=893195&view=auto
==============================================================================
---
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationListener.java
(added)
+++
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ApplicationListener.java
Tue Dec 22 15:04:50 2009
@@ -0,0 +1,28 @@
+/*
+ * 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 WARRANTIESOR 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.aries.application.management;
+
+public interface ApplicationListener {
+
+ /**
+ * Receives notification of an application lifecycle event
+ */
+ public void applicationChanged (ApplicationEvent event);
+}
Added:
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/AriesApplication.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/AriesApplication.java?rev=893195&view=auto
==============================================================================
---
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/AriesApplication.java
(added)
+++
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/AriesApplication.java
Tue Dec 22 15:04:50 2009
@@ -0,0 +1,46 @@
+/*
+ * 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 WARRANTIESOR 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.aries.application.management;
+
+import java.io.File;
+import java.io.OutputStream;
+import java.util.Set;
+
+import org.apache.aries.application.ApplicationMetadata;
+import org.apache.aries.application.DeploymentMetadata;
+
+
+/**
+ * Metadata about an Aries application - a representation of a .eba
+ * file, as per http://incubator.apache.org/aries/applications.html
+ *
+ */
+public interface AriesApplication
+{
+ public ApplicationMetadata getApplicationMetadata();
+ public DeploymentMetadata getDeploymentMetadata();
+
+ /** the set of bundles included in the application by value */
+ public Set<BundleInfo> getBundles();
+
+ /** Stores any changes to disk using this implementations storage form */
+ public void store(File f);
+ public void store(OutputStream in);
+}
Added:
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/AriesApplicationManager.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/AriesApplicationManager.java?rev=893195&view=auto
==============================================================================
---
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/AriesApplicationManager.java
(added)
+++
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/AriesApplicationManager.java
Tue Dec 22 15:04:50 2009
@@ -0,0 +1,40 @@
+/*
+ * 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 WARRANTIESOR 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.aries.application.management;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Set;
+
+/**
+ * Create, install and uninstall applications via this service.
+ */
+public interface AriesApplicationManager
+{
+ public AriesApplication createApplication(File f) throws ManagementException;
+ public AriesApplication createApplication(URL url) throws
ManagementException;
+ public Set<ApplicationContext> getApplicationContexts();
+ public ApplicationContext getApplicationContext(AriesApplication app);
+ public ApplicationContext install(AriesApplication app);
+ public void uninstall(ApplicationContext app);
+ public void addApplicationListener(ApplicationListener l);
+ public void removeApplicationListener(ApplicationListener l);
+}
Added:
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/BundleInfo.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/BundleInfo.java?rev=893195&view=auto
==============================================================================
---
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/BundleInfo.java
(added)
+++
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/BundleInfo.java
Tue Dec 22 15:04:50 2009
@@ -0,0 +1,39 @@
+/*
+ * 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 WARRANTIESOR 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.aries.application.management;
+
+import java.util.Map;
+import java.util.Set;
+import org.osgi.framework.Version;
+import org.apache.aries.application.Content;
+
+/**
+ * Information about a bundle
+ *
+ */
+public interface BundleInfo
+{
+ public String getSymbolicName();
+ public Version getVersion();
+ public String getLocation();
+ public Set<Content> getImportPackage();
+ public Set<Content> getExportPackage();
+ public Map<String, String> getHeaders();
+}
Added:
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ManagementException.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ManagementException.java?rev=893195&view=auto
==============================================================================
---
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ManagementException.java
(added)
+++
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/management/ManagementException.java
Tue Dec 22 15:04:50 2009
@@ -0,0 +1,33 @@
+/*
+ * 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 WARRANTIESOR 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.aries.application.management;
+
+public class ManagementException extends Exception {
+
+ private static final long serialVersionUID = 6472726820228618243L;
+
+ public ManagementException (Exception e) {
+ super(e);
+ }
+
+ public ManagementException (String s) {
+ super(s);
+ }
+}