You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by gn...@apache.org on 2010/03/26 15:23:51 UTC
svn commit: r927864 - in /incubator/aries/trunk/subsystem: ./ subsystem-api/
subsystem-api/src/ subsystem-api/src/main/ subsystem-api/src/main/java/
subsystem-api/src/main/java/org/ subsystem-api/src/main/java/org/apache/
subsystem-api/src/main/java/or...
Author: gnodet
Date: Fri Mar 26 14:23:50 2010
New Revision: 927864
URL: http://svn.apache.org/viewvc?rev=927864&view=rev
Log:
[subsystem] initial commit of an api for discussion
Added:
incubator/aries/trunk/subsystem/
incubator/aries/trunk/subsystem/pom.xml
incubator/aries/trunk/subsystem/subsystem-api/
incubator/aries/trunk/subsystem/subsystem-api/pom.xml
incubator/aries/trunk/subsystem/subsystem-api/src/
incubator/aries/trunk/subsystem/subsystem-api/src/main/
incubator/aries/trunk/subsystem/subsystem-api/src/main/java/
incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/
incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/
incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/
incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/
incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/Subsystem.java
incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemAdmin.java
incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemConstants.java
incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemEvent.java
incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemListener.java
incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/jmx/
incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/jmx/SubsystemAdminMBean.java
Added: incubator/aries/trunk/subsystem/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/pom.xml?rev=927864&view=auto
==============================================================================
--- incubator/aries/trunk/subsystem/pom.xml (added)
+++ incubator/aries/trunk/subsystem/pom.xml Fri Mar 26 14:23:50 2010
@@ -0,0 +1,55 @@
+<?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.
+ --><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">
+
+ <parent>
+ <groupId>org.apache.aries</groupId>
+ <artifactId>java5-parent</artifactId>
+ <version>0.1-incubating-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.aries.subsystem</groupId>
+ <artifactId>subsystem</artifactId>
+ <name>Apache Aries Subsystem</name>
+ <version>0.1-incubating-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <description>
+ Subsystems support for Aries
+ </description>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/aries/trunk/subsystem</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/aries/trunk/subsystem</developerConnection>
+ <url>http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem</url>
+ </scm>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.aries.subsystem</groupId>
+ <artifactId>org.apache.aries.subsystem.api</artifactId>
+ <version>${version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <modules>
+ <module>subsystem-api</module>
+ </modules>
+
+</project>
Added: incubator/aries/trunk/subsystem/subsystem-api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/pom.xml?rev=927864&view=auto
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/pom.xml (added)
+++ incubator/aries/trunk/subsystem/subsystem-api/pom.xml Fri Mar 26 14:23:50 2010
@@ -0,0 +1,50 @@
+<!--
+ 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.
+-->
+<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.aries.subsystem</groupId>
+ <artifactId>subsystem</artifactId>
+ <version>0.1-incubating-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.apache.aries.subsystem.api</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Aries Subsystem API</name>
+ <description>
+ Subsystems API.
+ </description>
+
+ <properties>
+ <aries.osgi.export.pkg>
+ org.apache.aries.subsystem;
+ </aries.osgi.export.pkg>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>4.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
Added: incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/Subsystem.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/Subsystem.java?rev=927864&view=auto
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/Subsystem.java (added)
+++ incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/Subsystem.java Fri Mar 26 14:23:50 2010
@@ -0,0 +1,64 @@
+/*
+ * Licensed 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.aries.subsystem;
+
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Map;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Version;
+
+public interface Subsystem {
+
+ public enum State {
+
+ Installed,
+ Resolved,
+ Starting,
+ Stopping,
+ Active,
+ Uninstalled
+
+ }
+
+ State getState();
+
+ void resolve();
+
+ void start();
+
+ void stop();
+
+ void update();
+
+ void update(InputStream is);
+
+ void uninstall();
+
+ long getSubsystemId();
+
+ String getLocation();
+
+ String getSymbolicName();
+
+ Version getVersion();
+
+ Map<String, String> getHeaders();
+
+ Map<String, String> getHeaders(String locale);
+
+ Collection<Bundle> getConstituents();
+
+}
Added: incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemAdmin.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemAdmin.java?rev=927864&view=auto
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemAdmin.java (added)
+++ incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemAdmin.java Fri Mar 26 14:23:50 2010
@@ -0,0 +1,29 @@
+/*
+ * Licensed 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.aries.subsystem;
+
+import java.io.InputStream;
+import java.util.Collection;
+
+public interface SubsystemAdmin {
+
+ Subsystem getSubsystem(long id);
+
+ Collection<Subsystem> getSubsystems();
+
+ Subsystem install(String url);
+
+ Subsystem install(String url, InputStream content);
+
+}
Added: incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemConstants.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemConstants.java?rev=927864&view=auto
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemConstants.java (added)
+++ incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemConstants.java Fri Mar 26 14:23:50 2010
@@ -0,0 +1,41 @@
+/*
+ * Licensed 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.aries.subsystem;
+
+public interface SubsystemConstants {
+
+ String SUBSYSTEM_MANIFESTVERSION = "Subsystem-ManifestVersion";
+ String SUBSYSTEM_SYMBOLICNAME = "Subsystem-SymbolicName";
+ String SUBSYSTEM_VERSION = "Subsystem-Version";
+ String SUBSYSTEM_NAME = "Subsystem-Name";
+ String SUBSYSTEM_DESCRIPTION = "Subsystem-Description";
+ String SUBSYSTEM_CONTENT = "Subsystem-Content";
+ String SUBSYSTEM_IMPORTPACKAGE = "Subsystem-ImportPackage";
+ String SUBSYSTEM_EXPORTPACKAGE = "Subsystem-ExportPackage";
+ String SUBSYSTEM_IMPORTSERVICE = "Subsystem-ImportService";
+ String SUBSYSTEM_EXPORTSERVICE = "Subsystem-ExportService";
+ String SUBSYSTEM_REQUIREBUNDLE = "Subsystem-RequireBundle";
+ String SUBSYSTEM_LOCALIZATION = "Subsystem-Localization";
+
+ /*
+ String APPLICATION_SYMBOLICNAME = "Application-SymbolicName";
+ String APPLICATION_VERSION = "Application-Version";
+ String APPLICATION_NAME = "Application-Name";
+
+ String LIBRARY_SYMBOLICNAME = "Library-SymbolicName";
+ String LIBRARY_VERSION = "Library-Version";
+ String LIBRARY_NAME = "Library-Name";
+ */
+
+}
Added: incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemEvent.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemEvent.java?rev=927864&view=auto
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemEvent.java (added)
+++ incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemEvent.java Fri Mar 26 14:23:50 2010
@@ -0,0 +1,55 @@
+/*
+ * Licensed 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.aries.subsystem;
+
+import java.util.EventObject;
+
+public class SubsystemEvent extends EventObject {
+
+ public enum Type {
+ Installed,
+ Started,
+ Stopped,
+ Updated,
+ Uninstalled,
+ Resolved,
+ Starting,
+ Stopping
+ }
+ private final Type type;
+
+ private final long timestamp;
+
+ private final Subsystem subsystem;
+
+ public SubsystemEvent(Type type, long timestamp, Subsystem subsystem) {
+ super(subsystem);
+ this.type = type;
+ this.timestamp = timestamp;
+ this.subsystem = subsystem;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ public long getTimestamp() {
+ return timestamp;
+ }
+
+ public Subsystem getSubsystem() {
+ return subsystem;
+ }
+
+}
Added: incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemListener.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemListener.java?rev=927864&view=auto
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemListener.java (added)
+++ incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemListener.java Fri Mar 26 14:23:50 2010
@@ -0,0 +1,20 @@
+/*
+ * Licensed 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.aries.subsystem;
+
+public interface SubsystemListener {
+
+ void subsystemEvent(SubsystemEvent event);
+
+}
Added: incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/jmx/SubsystemAdminMBean.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/jmx/SubsystemAdminMBean.java?rev=927864&view=auto
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/jmx/SubsystemAdminMBean.java (added)
+++ incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/jmx/SubsystemAdminMBean.java Fri Mar 26 14:23:50 2010
@@ -0,0 +1,20 @@
+/*
+ * Licensed 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.aries.subsystem.jmx;
+
+public interface SubsystemAdminMBean {
+
+ // TODO
+
+}