JBoss-OSGI SVN: r95607 - in projects/jboss-osgi/trunk/reactor: blueprint and 7 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-27 06:37:26 -0400 (Tue, 27 Oct 2009)
New Revision: 95607
Modified:
projects/jboss-osgi/trunk/reactor/blueprint/impl/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml
projects/jboss-osgi/trunk/reactor/deployment/pom.xml
projects/jboss-osgi/trunk/reactor/framework/pom.xml
projects/jboss-osgi/trunk/reactor/jmx/pom.xml
projects/jboss-osgi/trunk/reactor/jmx/src/main/java/org/jboss/osgi/jmx/JMXCapability.java
projects/jboss-osgi/trunk/reactor/pom.xml
projects/jboss-osgi/trunk/reactor/testing/pom.xml
Log:
Move JMX to reactor
Modified: projects/jboss-osgi/trunk/reactor/blueprint/impl/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/impl/pom.xml 2009-10-27 10:26:58 UTC (rev 95606)
+++ projects/jboss-osgi/trunk/reactor/blueprint/impl/pom.xml 2009-10-27 10:37:26 UTC (rev 95607)
@@ -14,7 +14,7 @@
<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>
- <name>JBossOSGi Bundles - Blueprint Implementation</name>
+ <name>JBossOSGi Reactor - Blueprint Implementation</name>
<description>A JBossOSGi provided Blueprint implementation</description>
<groupId>org.jboss.osgi.bundles</groupId>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-10-27 10:26:58 UTC (rev 95606)
+++ projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-10-27 10:37:26 UTC (rev 95607)
@@ -14,7 +14,7 @@
<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>
- <name>JBossOSGi Bundles - Blueprint</name>
+ <name>JBossOSGi Reactor - Blueprint</name>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-blueprint-parent</artifactId>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml 2009-10-27 10:26:58 UTC (rev 95606)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml 2009-10-27 10:37:26 UTC (rev 95607)
@@ -19,7 +19,7 @@
<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>
- <name>JBossOSGi Bundles - Blueprint Testsuite</name>
+ <name>JBossOSGi Reactor - Blueprint Testsuite</name>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-blueprint-testsuite</artifactId>
Modified: projects/jboss-osgi/trunk/reactor/deployment/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/pom.xml 2009-10-27 10:26:58 UTC (rev 95606)
+++ projects/jboss-osgi/trunk/reactor/deployment/pom.xml 2009-10-27 10:37:26 UTC (rev 95607)
@@ -14,7 +14,7 @@
<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>
- <name>JBossOSGi Deployment</name>
+ <name>JBossOSGi Reactor - Deployment</name>
<groupId>org.jboss.osgi.runtime</groupId>
<artifactId>jboss-osgi-deployment</artifactId>
Modified: projects/jboss-osgi/trunk/reactor/framework/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/pom.xml 2009-10-27 10:26:58 UTC (rev 95606)
+++ projects/jboss-osgi/trunk/reactor/framework/pom.xml 2009-10-27 10:37:26 UTC (rev 95607)
@@ -20,7 +20,7 @@
<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>
- <name>JBossOSGi Framework</name>
+ <name>JBossOSGi Reactor - Framework</name>
<groupId>org.jboss.osgi.runtime</groupId>
<artifactId>jboss-osgi-framework</artifactId>
<packaging>bundle</packaging>
Modified: projects/jboss-osgi/trunk/reactor/jmx/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/jmx/pom.xml 2009-10-27 10:26:58 UTC (rev 95606)
+++ projects/jboss-osgi/trunk/reactor/jmx/pom.xml 2009-10-27 10:37:26 UTC (rev 95607)
@@ -14,8 +14,8 @@
<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>
- <name>JBossOSGi Bundles - JMX</name>
- <description>The JBossOSGi MBeanServer Service</description>
+ <name>JBossOSGi Reactor - JMX</name>
+ <description>The JBossOSGi Management</description>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-jmx</artifactId>
@@ -26,15 +26,12 @@
<!-- Parent -->
<parent>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <artifactId>jboss-osgi</artifactId>
+ <version>1.0.0.Beta5</version>
</parent>
<!-- Properties -->
<properties>
- <version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
- <version.jboss.osgi.jndi>1.0.1</version.jboss.osgi.jndi>
- <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
@@ -42,25 +39,21 @@
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-jndi</artifactId>
- <version>${version.jboss.osgi.jndi}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-common-core</artifactId>
- <version>${version.jboss.osgi.common.core}</version>
</dependency>
<!-- OSGi Dependencies -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
- <version>${version.osgi}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
- <version>${version.osgi}</version>
<scope>provided</scope>
</dependency>
</dependencies>
Modified: projects/jboss-osgi/trunk/reactor/jmx/src/main/java/org/jboss/osgi/jmx/JMXCapability.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/jmx/src/main/java/org/jboss/osgi/jmx/JMXCapability.java 2009-10-27 10:26:58 UTC (rev 95606)
+++ projects/jboss-osgi/trunk/reactor/jmx/src/main/java/org/jboss/osgi/jmx/JMXCapability.java 2009-10-27 10:37:26 UTC (rev 95607)
@@ -27,7 +27,6 @@
import org.jboss.osgi.jndi.JNDICapability;
import org.jboss.osgi.spi.capability.Capability;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
/**
* Adds the JMX capability to the {@link OSGiRuntime}
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2009-10-27 10:26:58 UTC (rev 95606)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2009-10-27 10:37:26 UTC (rev 95607)
@@ -46,6 +46,7 @@
<module>deployment</module>
<module>testing</module>
<module>blueprint</module>
+ <module>jmx</module>
</modules>
<profiles>
Modified: projects/jboss-osgi/trunk/reactor/testing/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/testing/pom.xml 2009-10-27 10:26:58 UTC (rev 95606)
+++ projects/jboss-osgi/trunk/reactor/testing/pom.xml 2009-10-27 10:37:26 UTC (rev 95607)
@@ -14,7 +14,7 @@
<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>
- <name>JBossOSGi Testing</name>
+ <name>JBossOSGi Reactor - Testing</name>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-testing</artifactId>
16 years, 1 month
JBoss-OSGI SVN: r95606 - in projects/jboss-osgi: trunk/reactor and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-27 06:26:58 -0400 (Tue, 27 Oct 2009)
New Revision: 95606
Added:
projects/jboss-osgi/trunk/reactor/jmx/
Removed:
projects/jboss-osgi/projects/bundles/jmx/trunk/
Log:
Move JMX to reactor
Copied: projects/jboss-osgi/trunk/reactor/jmx (from rev 95605, projects/jboss-osgi/projects/bundles/jmx/trunk)
16 years, 1 month
JBoss-OSGI SVN: r95605 - in projects/jboss-osgi/projects/bundles/jmx/trunk: src/main/java/org and 8 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-27 06:20:22 -0400 (Tue, 27 Oct 2009)
New Revision: 95605
Added:
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/Item.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/JmxConstants.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/BundleStateMBean.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/FrameworkMBean.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/PackageStateMBean.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/ServiceStateMBean.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/package.html
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/packageinfo
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/package.html
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/packageinfo
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/ConfigurationAdminMBean.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/package.html
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/packageinfo
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/PermissionAdminMBean.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/package.html
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/packageinfo
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/ProvisioningServiceMBean.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/package.html
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/packageinfo
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/package.html
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/packageinfo
Modified:
projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml
Log:
Add org.osgi JMX API
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml 2009-10-27 10:15:28 UTC (rev 95604)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml 2009-10-27 10:20:22 UTC (rev 95605)
@@ -27,14 +27,14 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.2</version>
+ <version>1.0.4-SNAPSHOT</version>
</parent>
<!-- Properties -->
<properties>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
<version.jboss.osgi.jndi>1.0.1</version.jboss.osgi.jndi>
- <version.osgi>r4v42</version.osgi>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/Item.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/Item.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/Item.java 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,164 @@
+package org.osgi.jmx;
+
+import java.util.Arrays;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import javax.management.openmbean.ArrayType;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.OpenType;
+import javax.management.openmbean.TabularType;
+
+/**
+ * The item class enables the definition of open types in the appropriate
+ * interfaces.
+ *
+ * This class contains a number of methods that make it possible to create open
+ * types for {@link CompositeType}, {@link TabularType}, and {@link ArrayType}.
+ * The normal creation throws a checked exception, making it impossible to use
+ * them in a static initializer. They constructors are also not very suitable
+ * for static construction.
+ *
+ *
+ * An Item instance describes an item in a Composite Type. It groups the triplet
+ * of name, description, and Open Type. These Item instances allows the
+ * definitions of an item to stay together.
+ *
+ * @version $Revision$
+ * @Immutable
+ */
+public class Item {
+
+ /**
+ * The name of this item.
+ */
+ private final String name;
+
+ /**
+ * The description of this item.
+ */
+ private final String description;
+
+ /**
+ * The type of this item.
+ */
+ private final OpenType type;
+
+ /**
+ * Create a triple of name, description, and type. This triplet is used in
+ * the creation of a Composite Type.
+ *
+ * @param name The name of the item.
+ * @param description The description of the item.
+ * @param type The Open Type of this item.
+ * @param restrictions Ignored, contains list of restrictions
+ */
+ public Item(String name, String description, OpenType type,
+ String... restrictions) {
+ this.name = name;
+ this.description = description;
+ this.type = type;
+ }
+
+ /**
+ *
+ */
+
+ /**
+ * Create a Tabular Type.
+ *
+ * @param name The name of the Tabular Type.
+ * @param description The description of the Tabular Type.
+ * @param rowType The Open Type for a row
+ * @param index The names of the items that form the index .
+ * @return A new Tabular Type composed from the parameters.
+ * @throws RuntimeException when the Tabular Type throws an
+ * OpenDataException
+ */
+ static public TabularType tabularType(String name, String description,
+ CompositeType rowType, String... index) {
+ try {
+ return new TabularType(name, description, rowType, index);
+ }
+ catch (OpenDataException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Create a Composite Type
+ *
+ * @param name The name of the Tabular Type.
+ * @param description The description of the Tabular Type.
+ * @param items The items that describe the composite type.
+ * @return a new Composite Type
+ * @throws RuntimeException when the Tabular Type throws an
+ * OpenDataException
+ */
+ static public CompositeType compositeType(String name, String description,
+ Item... items) {
+ return extend(null, name, description, items);
+ }
+
+ /**
+ * Return a new Array Type.
+ *
+ * @param dim The dimension
+ * @param elementType The element type
+ * @return A new Array Type
+ */
+ public static ArrayType arrayType(int dim, OpenType elementType) {
+ try {
+ return new ArrayType(dim, elementType);
+ }
+ catch (OpenDataException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Extend a Composite Type by adding new items. Items can override items in
+ * the parent type.
+ *
+ * @param parent The parent type, can be <code>null</code>
+ * @param name The name of the type
+ * @param description The description of the type
+ * @param items The items that should be added/override to the parent type
+ * @return A new Composite Type that extends the parent type
+ * @throws RuntimeException when an OpenDataException is thrown
+ */
+ public static CompositeType extend(CompositeType parent, String name,
+ String description, Item... items) {
+ Set<Item> all = new LinkedHashSet<Item>();
+
+ if (parent != null) {
+ for (Object nm : parent.keySet()) {
+ String key = (String) nm;
+ all.add(new Item((String) nm, parent.getDescription(key),
+ parent.getType(key)));
+ }
+ }
+
+ all.addAll(Arrays.asList(items));
+
+ String names[] = new String[all.size()];
+ String descriptions[] = new String[all.size()];
+ OpenType types[] = new OpenType[all.size()];
+
+ for (int n = 0; n < types.length; n++) {
+ names[n] = items[n].name;
+ descriptions[n] = items[n].description;
+ types[n] = items[n].type;
+ }
+
+ try {
+ return new CompositeType(name, description, names, descriptions,
+ types);
+ }
+ catch (OpenDataException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+}
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/Item.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/JmxConstants.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/JmxConstants.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/JmxConstants.java 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,317 @@
+/*
+ * Copyright (c) OSGi Alliance (2009). All Rights Reserved.
+ *
+ * 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.osgi.jmx;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.management.openmbean.ArrayType;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.SimpleType;
+import javax.management.openmbean.TabularType;
+
+/**
+ * Constants for OSGi JMX Specification.
+ *
+ * Additionally, this class contains a number of utility types that are used in
+ * different places in the specification. These are {@link #LONG_ARRAY_TYPE},
+ * {@link #STRING_ARRAY_TYPE}, and {@link #PROPERTIES_TYPE}.
+ *
+ * @version $Revision$
+ * @Immutable
+ */
+public class JmxConstants {
+
+ /*
+ * Empty constructor to make sure this is not used as an object.
+ */
+ private JmxConstants() {
+ // empty
+ }
+
+ /**
+ * The MBean Open type for an array of strings
+ */
+ public static final ArrayType STRING_ARRAY_TYPE = Item
+ .arrayType(
+ 1,
+ SimpleType.STRING);
+ /**
+ * The MBean Open type for an array of longs
+ */
+ public static final ArrayType LONG_ARRAY_TYPE = Item
+ .arrayType(
+ 1,
+ SimpleType.LONG);
+
+ /**
+ * For an encoded array we need to start with ARRAY_OF. This must be
+ * followed by one of the names in {@link #SCALAR}.
+ *
+ */
+ public final static String ARRAY_OF = "Array of ";
+
+ /**
+ * For an encoded vector we need to start with ARRAY_OF. This must be
+ * followed by one of the names in {@link #SCALAR}.
+ */
+ public final static String VECTOR_OF = "Vector of ";
+
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * {@link java.lang.String}
+ */
+ public static final String STRING = "String";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * {@link java.lang.Integer}
+ */
+ public static final String INTEGER = "Integer";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * {@link java.lang.Long}
+ */
+ public static final String LONG = "Long";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * {@link java.lang.Float}
+ */
+ public static final String FLOAT = "Float";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * {@link java.lang.Double}
+ */
+ public static final String DOUBLE = "Double";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * {@link java.lang.Byte}
+ */
+ public static final String BYTE = "Byte";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * {@link java.lang.Short}
+ */
+ public static final String SHORT = "Short";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * {@link java.lang.Character}
+ */
+ public static final String CHARACTER = "Character";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * {@link java.lang.Boolean}
+ */
+ public static final String BOOLEAN = "Boolean";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * {@link java.math.BigDecimal}
+ */
+ public static final String BIGDECIMAL = "BigDecimal";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * {@link java.math.BigInteger}
+ */
+ public static final String BIGINTEGER = "BigInteger";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * the <code>double</code> primitive type.
+ */
+ public static final String P_DOUBLE = "double";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * the <code>float</code> primitive type.
+ */
+ public static final String P_FLOAT = "float";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * the <code>long</code> primitive type.
+ */
+ public static final String P_LONG = "long";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * the <code>int</code> primitive type.
+ */
+ public static final String P_INT = "int";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * the <code>short</code> primitive type.
+ */
+ public static final String P_SHORT = "short";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * the <code>byte</code> primitive type.
+ */
+ public static final String P_BYTE = "byte";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * the <code>char</code> primitive type.
+ */
+ public static final String P_CHAR = "char";
+ /**
+ * Value for {@link #PROPERTY_TYPE} <code>Type</code> value in the case of
+ * the <code>boolean</code> primitive type.
+ */
+ public static final String P_BOOLEAN = "boolean";
+
+ /**
+ * A set of all scalars that can be used in the {@link #TYPE} property of a
+ * {@link #PROPERTIES_TYPE}. This contains the following names:
+ * <ul>
+ * <li>{@link #BIGDECIMAL}</li>
+ * <li>{@link #BIGINTEGER}</li>
+ * <li>{@link #BOOLEAN}</li>
+ * <li>{@link #BYTE}</li>
+ * <li>{@link #CHARACTER}</li>
+ * <li>{@link #DOUBLE}</li>
+ * <li>{@link #FLOAT}</li>
+ * <li>{@link #INTEGER}</li>
+ * <li>{@link #LONG}</li>
+ * <li>{@link #SHORT}</li>
+ * <li>{@link #STRING}</li>
+ * <li>{@link #P_BYTE}</li>
+ * <li>{@link #P_CHAR}</li>
+ * <li>{@link #P_DOUBLE}</li>
+ * <li>{@link #P_FLOAT}</li>
+ * <li>{@link #P_INT}</li>
+ * <li>{@link #P_LONG}</li>
+ * <li>{@link #P_SHORT}</li>
+ */
+ public final static Set<String> SCALAR = new HashSet<String>(
+ Arrays
+ .asList(
+ STRING,
+ INTEGER,
+ LONG,
+ FLOAT,
+ DOUBLE,
+ BYTE,
+ SHORT,
+ CHARACTER,
+ BOOLEAN,
+ BIGDECIMAL,
+ BIGINTEGER,
+ P_BYTE,
+ P_CHAR,
+ P_SHORT,
+ P_INT,
+ P_LONG,
+ P_DOUBLE,
+ P_FLOAT));
+ /**
+ * The key KEY.
+ */
+ public static final String KEY = "Key";
+ /**
+ * The key of a property. The key is {@link #KEY} and the type is
+ * {@link SimpleType#STRING}.
+ */
+ public static final Item KEY_ITEM = new Item(
+ KEY,
+ "The key of the property",
+ SimpleType.STRING);
+
+ /**
+ * The key VALUE.
+ */
+ public static final String VALUE = "Value";
+
+ /**
+ * The value of a property. The key is {@link #VALUE} and the type is
+ * {@link SimpleType#STRING}. A value will be encoded by the string given in
+ * {@link #TYPE}. The syntax for this type is given in {@link #TYPE_ITEM}.
+ */
+ public static final Item VALUE_ITEM = new Item(
+ VALUE,
+ "The value of the property",
+ SimpleType.STRING);
+
+ /**
+ * The key PROPERTY_TYPE.
+ *
+ * ### can we call this value PropertyType and service type ServiceType?
+ */
+ public static final String TYPE = "Type";
+
+ /**
+ * The type of the property. The key is {@link #TYPE} and the type is
+ * {@link SimpleType#STRING}. This string must follow the following syntax:
+ *
+ * TYPE ::= ( 'Array of ' | 'Vector of ' )? {@link #SCALAR}
+ *
+ * ### why can't we just use the class name?
+ *
+ * ### why do we have to distinguish between primitives and wrappers?
+ */
+ public static final Item TYPE_ITEM = new Item(
+ TYPE,
+ "The type of the property",
+ SimpleType.STRING, //
+ STRING,
+ INTEGER,
+ LONG,
+ FLOAT,
+ DOUBLE,
+ BYTE,
+ SHORT,
+ CHARACTER,
+ BOOLEAN,
+ BIGDECIMAL,
+ BIGINTEGER,
+ P_DOUBLE,
+ P_FLOAT,
+ P_LONG,
+ P_INT,
+ P_SHORT,
+ P_CHAR,
+ P_BYTE,
+ P_BOOLEAN);
+
+ /**
+ * A Composite Type describing a a single property. A property consists of
+ * the following items {@link #KEY_ITEM}, {@link #VALUE_ITEM}, and
+ * {@link #TYPE_ITEM}.
+ */
+ public static final CompositeType PROPERTY_TYPE = Item
+ .compositeType(
+ "PROPERTY",
+ "This type encapsulates a key/value pair",
+ KEY_ITEM,
+ VALUE_ITEM,
+ TYPE_ITEM);
+
+ /**
+ * Describes a map with properties. The row type is {@link #PROPERTY_TYPE}.
+ * The index is defined to the {@link #KEY} of the property.
+ */
+ public static final TabularType PROPERTIES_TYPE = Item
+ .tabularType(
+ "PROPERTIES",
+ "A table of PROPERTY",
+ PROPERTY_TYPE,
+ KEY);
+
+ /**
+ * The domain name of the core OSGi MBeans
+ */
+ public static final String OSGI_CORE = "osgi.core";
+
+ /**
+ * The domain name of the selected OSGi compendium MBeans
+ */
+ public static final String OSGI_COMPENDIUM = "osgi.compendium";
+}
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/JmxConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/BundleStateMBean.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/BundleStateMBean.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/BundleStateMBean.java 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,676 @@
+/*
+ * Copyright (c) OSGi Alliance (2009). All Rights Reserved.
+ *
+ * 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.osgi.jmx.framework;
+
+import java.io.IOException;
+
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.SimpleType;
+import javax.management.openmbean.TabularData;
+import javax.management.openmbean.TabularType;
+
+import org.osgi.jmx.Item;
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean represents the Bundle state of the framework. This MBean also
+ * emits events that clients can use to get notified of the changes in the
+ * bundle state of the framework.
+ *
+ * @version $Revision$
+ */
+public interface BundleStateMBean {
+ /**
+ * The Object Name for a Bundle State MBean.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_CORE
+ + ":type=bundleState,version=1.5";
+
+ /**
+ * The key KEY, used in {@link #KEY_ITEM}.
+ */
+ String KEY = "Key";
+
+ /**
+ * The item describing the key of a bundle header entry. The key is
+ * {@link #KEY} and the type is {@link SimpleType#STRING}.
+ */
+ Item KEY_ITEM = new Item(
+ KEY,
+ "The bundle header key",
+ SimpleType.STRING);
+ /**
+ * The key VALUE, used in {@link #VALUE_ITEM}.
+ */
+ String VALUE = "Value";
+ /**
+ * The item describing the value of a bundle header entry. The key is
+ * {@link #VALUE} and the type is {@link SimpleType#STRING}.
+ */
+ Item VALUE_ITEM = new Item(
+ VALUE,
+ "The bundle header value",
+ SimpleType.STRING);
+
+ /**
+ * The Composite Type describing an entry in bundle headers. It consists of
+ * {@link #KEY_ITEM} and {@link #VALUE_ITEM}.
+ */
+ CompositeType HEADER_TYPE = Item
+ .compositeType(
+ "HEADER",
+ "This type encapsulates OSGi bundle header key/value pairs",
+ KEY_ITEM,
+ VALUE_ITEM);
+
+ /**
+ * The Tabular Type describing the type of the Tabular Data value that is
+ * returned from {@link #getHeaders(long)} method. The primary item is
+ * {@link #KEY_ITEM}.
+ */
+ TabularType HEADERS_TYPE = Item
+ .tabularType(
+ "HEADERS",
+ "The table of bundle headers",
+ HEADER_TYPE,
+ new String[] {KEY});
+
+ /**
+ * The key LOCATION, used in {@link #LOCATION_ITEM}.
+ */
+ String LOCATION = "Location";
+ /**
+ * The item containing the bundle location in {@link #BUNDLE_TYPE}. The key
+ * is {@link #LOCATION} and the the type is {@link SimpleType#STRING}.
+ */
+ Item LOCATION_ITEM = new Item(
+ LOCATION,
+ "The location of the bundle",
+ SimpleType.STRING);
+
+ /**
+ * The key IDENTIFIER, used in {@link #IDENTIFIER_ITEM}.
+ */
+ String IDENTIFIER = "Identifier";
+
+ /**
+ * The item containing the bundle identifier in {@link #BUNDLE_TYPE}. The
+ * key is {@link #IDENTIFIER} and the the type is {@link SimpleType#LONG}.
+ */
+ Item IDENTIFIER_ITEM = new Item(IDENTIFIER,
+ "The id of the bundle",
+ SimpleType.LONG);
+ /**
+ * The key SYMBOLIC_NAME, used in {@link #SYMBOLIC_NAME_ITEM}.
+ */
+ String SYMBOLIC_NAME = "SymbolicName";
+
+ /**
+ * The item containing the symbolic name in {@link #BUNDLE_TYPE}. The key is
+ * {@link #SYMBOLIC_NAME} and the the type is {@link SimpleType#STRING}.
+ */
+ Item SYMBOLIC_NAME_ITEM = new Item(
+ SYMBOLIC_NAME,
+ "The symbolic name of the bundle",
+ SimpleType.STRING);
+ /**
+ * The key VERSION, used in {@link #VERSION_ITEM}.
+ */
+ String VERSION = "Version";
+
+ /**
+ * The item containing the symbolic name in {@link #BUNDLE_TYPE}. The key is
+ * {@link #SYMBOLIC_NAME} and the the type is {@link SimpleType#STRING}.
+ */
+ Item VERSION_ITEM = new Item(
+ VERSION,
+ "The version of the bundle",
+ SimpleType.STRING);
+ /**
+ * The key START_LEVEL, used in {@link #START_LEVEL_ITEM}.
+ */
+ String START_LEVEL = "StartLevel";
+
+ /**
+ * The item containing the start level in {@link #BUNDLE_TYPE}. The key is
+ * {@link #START_LEVEL} and the the type is {@link SimpleType#INTEGER}.
+ */
+ Item START_LEVEL_ITEM = new Item(
+ START_LEVEL,
+ "The start level of the bundle",
+ SimpleType.INTEGER);
+ /**
+ * The key STATE, used in {@link #STATE_ITEM}.
+ */
+ String STATE = "State";
+
+ /**
+ * Constant INSTALLED for the {@link #STATE}
+ */
+ String INSTALLED = "INSTALLED";
+ /**
+ * Constant RESOLVED for the {@link #STATE}
+ */
+ String RESOLVED = "RESOLVED";
+ /**
+ * Constant STARTING for the {@link #STATE}
+ */
+ String STARTING = "STARTING";
+ /**
+ * Constant ACTIVE for the {@link #STATE}
+ */
+ String ACTIVE = "ACTIVE";
+ /**
+ * Constant STOPPING for the {@link #STATE}
+ */
+ String STOPPING = "STOPPING";
+ /**
+ * Constant UNINSTALLED for the {@link #STATE}
+ */
+ String UNINSTALLED = "UNINSTALLED";
+ /**
+ * Constant UNKNOWN for the {@link #STATE}
+ */
+ String UNKNOWN = "UNKNOWN";
+ /**
+ * The item containing the bundle state in {@link #BUNDLE_TYPE}. The key is
+ * {@link #STATE} and the the type is {@link SimpleType#STRING}. The
+ * returned values must be one of the following strings:
+ * <ul>
+ * <li>{@link #INSTALLED}</li>
+ * <li>{@link #RESOLVED}</li>
+ * <li>{@link #STARTING}</li>
+ * <li>{@link #ACTIVE}</li>
+ * <li>{@link #STOPPING}</li>
+ * <li>{@link #UNINSTALLED}</li>
+ * <li>{@link #UNKNOWN}</li>
+ * </ul>
+ */
+ Item STATE_ITEM = new Item(
+ STATE,
+ "The state of the bundle",
+ SimpleType.STRING,
+ INSTALLED, RESOLVED,
+ STARTING, ACTIVE,
+ STOPPING, UNINSTALLED,
+ UNKNOWN);
+ /**
+ * The key LAST_MODIFIED, used in {@link #LAST_MODIFIED_ITEM}.
+ */
+ String LAST_MODIFIED = "LastModified";
+
+ /**
+ * The item containing the last modified time in the {@link #BUNDLE_TYPE}.
+ * The key is {@link #LAST_MODIFIED} and the the type is
+ * {@link SimpleType#LONG}.
+ */
+ Item LAST_MODIFIED_ITEM = new Item(
+ LAST_MODIFIED,
+ "The last modification time of the bundle",
+ SimpleType.LONG);
+ /**
+ * The key PERSISTENTLY_STARTED, used in {@link #PERSISTENTLY_STARTED_ITEM}.
+ */
+ String PERSISTENTLY_STARTED = "PeristentlyStarted";
+
+ /**
+ * The item containing the indication of persistently started in
+ * {@link #BUNDLE_TYPE}. The key is {@link #PERSISTENTLY_STARTED} and the
+ * the type is {@link SimpleType#BOOLEAN}.
+ */
+ Item PERSISTENTLY_STARTED_ITEM = new Item(
+ PERSISTENTLY_STARTED,
+ "Whether the bundle is persistently started",
+ SimpleType.BOOLEAN);
+ /**
+ * The key REMOVAL_PENDING, used in {@link #REMOVAL_PENDING_ITEM}.
+ */
+ String REMOVAL_PENDING = "RemovalPending";
+
+ /**
+ * The item containing the indication of removal pending in
+ * {@link #BUNDLE_TYPE}. The key is {@link #REMOVAL_PENDING} and the type is
+ * {@link SimpleType#BOOLEAN}.
+ */
+ Item REMOVAL_PENDING_ITEM = new Item(
+ REMOVAL_PENDING,
+ "Whether the bundle is pending removal",
+ SimpleType.BOOLEAN);
+ /**
+ * The key REQUIRED, used in {@value #REQUIRED_ITEM}.
+ */
+ String REQUIRED = "Required";
+
+ /**
+ * The item containing the required status in {@link #BUNDLE_TYPE}. The key
+ * is {@link #REQUIRED} and the the type is {@link SimpleType#BOOLEAN}.
+ */
+ Item REQUIRED_ITEM = new Item(
+ REQUIRED,
+ "Whether the bundle is required",
+ SimpleType.BOOLEAN);
+ /**
+ * The key FRAGMENT, used in {@value #FRAGMENT_ITEM}.
+ */
+ String FRAGMENT = "Fragment";
+
+ /**
+ * The item containing the fragment status in {@link #BUNDLE_TYPE}. The key
+ * is {@link #FRAGMENT} and the the type is {@link SimpleType#BOOLEAN}.
+ */
+ Item FRAGMENT_ITEM = new Item(
+ FRAGMENT,
+ "Whether the bundle is a fragment",
+ SimpleType.BOOLEAN);
+ /**
+ * The key REGISTERED_SERVICES, used in {@value #REGISTERED_SERVICES_ITEM}.
+ */
+ String REGISTERED_SERVICES = "RegisteredServices";
+
+ /**
+ * The item containing the registered services of the bundle in
+ * {@link #BUNDLE_TYPE}. The key is {@link #REGISTERED_SERVICES} and the the
+ * type is {@link JmxConstants#LONG_ARRAY_TYPE}.
+ */
+ Item REGISTERED_SERVICES_ITEM = new Item(
+ REGISTERED_SERVICES,
+ "The registered services of the bundle",
+ JmxConstants.LONG_ARRAY_TYPE);
+ /**
+ * The key SERVICES_IN_USE, used in {@value #SERVICES_IN_USE_ITEM}.
+ */
+ String SERVICES_IN_USE = "ServicesInUse";
+
+ /**
+ * The item containing the services in use by this bundle in
+ * {@link #BUNDLE_TYPE}. The key is {@link #SERVICES_IN_USE} and the the
+ * type is {@link JmxConstants#LONG_ARRAY_TYPE}.
+ */
+ Item SERVICES_IN_USE_ITEM = new Item(
+ SERVICES_IN_USE,
+ "The services in use by the bundle",
+ JmxConstants.LONG_ARRAY_TYPE);
+ /**
+ * The key HEADERS, used in {@link #HEADERS_ITEM}.
+ */
+ String HEADERS = "Headers";
+
+ /**
+ * The item containing the bundle headers in {@link #BUNDLE_TYPE}. The key
+ * is {@link #HEADERS} and the the type is {@link #HEADERS_TYPE}.
+ */
+ Item HEADERS_ITEM = new Item(
+ HEADERS,
+ "The headers of the bundle",
+ HEADERS_TYPE);
+
+ /**
+ * The key EXPORTED_PACKAGES, used in {@link #EXPORTED_PACKAGES_ITEM}.
+ */
+ String EXPORTED_PACKAGES = "ExportedPackages";
+
+ /**
+ * The item containing the exported package names in {@link #BUNDLE_TYPE}
+ * .The key is {@link #EXPORTED_PACKAGES} and the the type is
+ * {@link JmxConstants#STRING_ARRAY_TYPE}.
+ */
+ Item EXPORTED_PACKAGES_ITEM = new Item(
+ EXPORTED_PACKAGES,
+ "The exported packages of the bundle",
+ JmxConstants.STRING_ARRAY_TYPE);
+ /**
+ * The key IMPORTED_PACKAGES, used in {@link #EXPORTED_PACKAGES_ITEM}.
+ */
+ String IMPORTED_PACKAGES = "ImportedPackages";
+
+ /**
+ * The item containing the imported package names in {@link #BUNDLE_TYPE}
+ * .The key is {@link #IMPORTED_PACKAGES} and the the type is
+ * {@link JmxConstants#STRING_ARRAY_TYPE}.
+ */
+ Item IMPORTED_PACKAGES_ITEM = new Item(
+ IMPORTED_PACKAGES,
+ "The imported packages of the bundle",
+ JmxConstants.STRING_ARRAY_TYPE);
+ /**
+ * The key FRAGMENTS, used in {@link #FRAGMENTS_ITEM}.
+ */
+ String FRAGMENTS = "Fragments";
+
+ /**
+ * The item containing the list of fragments the bundle is host to in
+ * {@link #BUNDLE_TYPE}. The key is {@link #FRAGMENTS} and the type is
+ * {@link JmxConstants#LONG_ARRAY_TYPE}.
+ */
+ Item FRAGMENTS_ITEM = new Item(
+ FRAGMENTS,
+ "The fragments of which the bundle is host",
+ JmxConstants.LONG_ARRAY_TYPE);
+ /**
+ * The key HOSTS, used in {@link #HOSTS_ITEM}.
+ */
+ String HOSTS = "Hosts";
+
+ /**
+ * The item containing the bundle identifiers representing the hosts in
+ * {@link #BUNDLE_TYPE}. The key is {@link #HOSTS} and the type is
+ * {@link JmxConstants#LONG_ARRAY_TYPE}
+ */
+ Item HOSTS_ITEM = new Item(
+ HOSTS,
+ "The fragments of which the bundle is host",
+ JmxConstants.LONG_ARRAY_TYPE);
+ /**
+ * The key REQUIRED_BUNDLES, used in {@link #REQUIRED_BUNDLES_ITEM}.
+ */
+ String REQUIRED_BUNDLES = "RequiredBundles";
+
+ /**
+ * The item containing the required bundles in {@link #BUNDLE_TYPE}. The key
+ * is {@link #REQUIRED_BUNDLES} and the type is
+ * {@link JmxConstants#LONG_ARRAY_TYPE}
+ */
+ Item REQUIRED_BUNDLES_ITEM = new Item(
+ REQUIRED_BUNDLES,
+ "The required bundles the bundle",
+ JmxConstants.LONG_ARRAY_TYPE);
+ /**
+ * The key REQUIRING_BUNDLES, used in {@link #REQUIRING_BUNDLES_ITEM}.
+ */
+ String REQUIRING_BUNDLES = "RequiringBundles";
+
+ /**
+ * The item containing the bundles requiring this bundle in
+ * {@link #BUNDLE_TYPE}. The key is {@link #REQUIRING_BUNDLES} and the type
+ * is {@link JmxConstants#LONG_ARRAY_TYPE}
+ */
+ Item REQUIRING_BUNDLES_ITEM = new Item(
+ REQUIRING_BUNDLES,
+ "The bundles requiring the bundle",
+ JmxConstants.LONG_ARRAY_TYPE);
+
+ /**
+ * The Composite Type that represents a bundle. This composite consist of:
+ * <ul>
+ * <li>{@link #EXPORTED_PACKAGES}</li>
+ * <li>{@link #FRAGMENT}</li>
+ * <li>{@link #FRAGMENTS}</li>
+ * <li>{@link #HEADERS}</li>
+ * <li>{@link #HOSTS}</li>
+ * <li>{@link #IDENTIFIER}</li>
+ * <li>{@link #IMPORTED_PACKAGES}</li>
+ * <li>{@link #LAST_MODIFIED}</li>
+ * <li>{@link #LOCATION}</li>
+ * <li>{@link #PERSISTENTLY_STARTED}</li>
+ * <li>{@link #REGISTERED_SERVICES}</li>
+ * <li>{@link #REMOVAL_PENDING}</li>
+ * <li>{@link #REQUIRED}</li>
+ * <li>{@link #REQUIRED_BUNDLES}</li>
+ * <li>{@link #REQUIRING_BUNDLES}</li>
+ * <li>{@link #START_LEVEL}</li>
+ * <li>{@link #STATE}</li>
+ * <li>{@link #SERVICES_IN_USE}</li>
+ * <li>{@link #SYMBOLIC_NAME}</li>
+ * <li>{@link #VERSION}</li>
+ * </ul>
+ * It is used by {@link #BUNDLES_TYPE}.
+ */
+ CompositeType BUNDLE_TYPE = Item
+ .compositeType(
+ "BUNDLE",
+ "This type encapsulates OSGi bundles",
+ EXPORTED_PACKAGES_ITEM,
+ FRAGMENT_ITEM,
+ FRAGMENTS_ITEM,
+ HEADERS_ITEM,
+ HOSTS_ITEM,
+ IDENTIFIER_ITEM,
+ IMPORTED_PACKAGES_ITEM,
+ LAST_MODIFIED_ITEM,
+ LOCATION_ITEM,
+ PERSISTENTLY_STARTED_ITEM,
+ REGISTERED_SERVICES_ITEM,
+ REMOVAL_PENDING_ITEM,
+ REQUIRED_ITEM,
+ REQUIRED_BUNDLES_ITEM,
+ REQUIRING_BUNDLES_ITEM,
+ START_LEVEL_ITEM,
+ STATE_ITEM,
+ SERVICES_IN_USE_ITEM,
+ SYMBOLIC_NAME_ITEM,
+ VERSION_ITEM);
+
+ /**
+ * The Tabular Type for a list of bundles. The row type is
+ * {@link #BUNDLE_TYPE}.
+ */
+ TabularType BUNDLES_TYPE = Item
+ .tabularType(
+ "BUNDLES",
+ "A list of bundles",
+ BUNDLE_TYPE,
+ new String[] {IDENTIFIER});
+
+ /**
+ * Answer the list of identifiers of the bundles this bundle depends upon
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @return the list of bundle identifiers
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ long[] getRequiredBundles(long bundleIdentifier) throws IOException;
+
+ /**
+ * Answer the bundle state of the system in tabular form.
+ *
+ * Each row of the returned table represents a single bundle. The Tabular
+ * Data consists of Composite Data that is type by {@link #BUNDLES_TYPE}.
+ *
+ * @return the tabular representation of the bundle state
+ * @throws IOException
+ */
+ TabularData listBundles() throws IOException;
+
+ /**
+ * Answer the list of exported packages for this bundle.
+ *
+ * @param bundleId
+ * @return the array of package names, combined with their version in the
+ * format <packageName;version>
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ String[] getExportedPackages(long bundleId) throws IOException;
+
+ /**
+ * Answer the list of the bundle ids of the fragments associated with this
+ * bundle
+ *
+ * @param bundleId
+ * @return the array of bundle identifiers
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ long[] getFragments(long bundleId) throws IOException;
+
+ /**
+ * Answer the headers for the bundle uniquely identified by the bundle id.
+ * The Tabular Data is typed by the {@link #HEADERS_TYPE}.
+ *
+ * @param bundleId the unique identifier of the bundle
+ * @return the table of associated header key and values
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ TabularData getHeaders(long bundleId) throws IOException;
+
+ /**
+ * Answer the list of bundle ids of the bundles which host a fragment
+ *
+ * @param fragment the bundle id of the fragment
+ * @return the array of bundle identifiers
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ long[] getHosts(long fragment) throws IOException;
+
+ /**
+ * Answer the array of the packages imported by this bundle
+ *
+ * @param bundleId the bundle identifier
+ * @return the array of package names, combined with their version in the
+ * format <packageName;version>
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ String[] getImportedPackages(long bundleId) throws IOException;
+
+ /**
+ * Answer the last modified time of a bundle
+ *
+ * @param bundleId the unique identifier of a bundle
+ * @return the last modified time
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ long getLastModified(long bundleId) throws IOException;
+
+ /**
+ * Answer the list of service identifiers representing the services this
+ * bundle exports
+ *
+ * @param bundleId the bundle identifier
+ * @return the list of service identifiers
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ long[] getRegisteredServices(long bundleId) throws IOException;
+
+ /**
+ * Answer the list of identifiers of the bundles which require this bundle
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @return the list of bundle identifiers
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ long[] getRequiringBundles(long bundleIdentifier) throws IOException;
+
+ /**
+ * Answer the list of service identifiers which refer to the the services
+ * this bundle is using
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @return the list of service identifiers
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ long[] getServicesInUse(long bundleIdentifier) throws IOException;
+
+ /**
+ * Answer the start level of the bundle
+ *
+ * @param bundleId the identifier of the bundle
+ * @return the start level
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ int getStartLevel(long bundleId) throws IOException;
+
+ /**
+ * Answer the symbolic name of the state of the bundle
+ *
+ * @param bundleId the identifier of the bundle
+ * @return the string name of the bundle state
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ String getState(long bundleId) throws IOException;
+
+ /**
+ * Answer the symbolic name of the bundle
+ *
+ * @param bundleId the identifier of the bundle
+ * @return the symbolic name
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ String getSymbolicName(long bundleId) throws IOException;
+
+ /**
+ * Answer if the bundle is persistently started when its start level is
+ * reached
+ *
+ * @param bundleId the identifier of the bundle
+ * @return true if the bundle is persistently started
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ boolean isPersistentlyStarted(long bundleId) throws IOException;
+
+ /**
+ * Answer whether the bundle is a fragment or not
+ *
+ * @param bundleId the identifier of the bundle
+ * @return true if the bundle is a fragment
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ boolean isFragment(long bundleId) throws IOException;
+
+ /**
+ * Answer true if the bundle is pending removal
+ *
+ * @param bundleId the identifier of the bundle
+ * @return true if the bundle is pending removal
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ boolean isRemovalPending(long bundleId) throws IOException;
+
+ /**
+ * Answer true if the bundle is required by another bundle
+ *
+ * @param bundleId the identifier of the bundle
+ * @return true if the bundle is required by another bundle
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ boolean isRequired(long bundleId) throws IOException;
+
+ /**
+ * Answer the location of the bundle.
+ *
+ * @param bundleId the identifier of the bundle
+ * @return The location string of this bundle
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ String getLocation(long bundleId) throws IOException;
+
+ /**
+ * Answer the location of the bundle.
+ *
+ * @param bundleId the identifier of the bundle
+ * @return The location string of this bundle
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ String getVersion(long bundleId) throws IOException;
+
+}
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/BundleStateMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/FrameworkMBean.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/FrameworkMBean.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/FrameworkMBean.java 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,495 @@
+/*
+ * Copyright (c) OSGi Alliance (2009). All Rights Reserved.
+ *
+ * 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.osgi.jmx.framework;
+
+import java.io.IOException;
+
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.SimpleType;
+
+import org.osgi.jmx.Item;
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * The FrameworkMbean provides mechanisms to exert control over the framework.
+ * For many operations, it provides a batch mechanism to avoid excessive message
+ * passing when interacting remotely.
+ *
+ * ### Need to indicate which fields are mandatory and which fields are
+ * optional?
+ *
+ * @version $Revision$
+ */
+public interface FrameworkMBean {
+ /**
+ * The fully qualified object name of this mbean.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_CORE
+ + ":type=framework,version=1.5";
+
+ /**
+ * The SUCCESS, used in {@link #SUCCESS_ITEM}.
+ */
+ String SUCCESS = "Success";
+
+ /**
+ * The item that indicates if this operation was successful. The key is
+ * {@link #SUCCESS} and the type is {@link SimpleType#BOOLEAN}. It is used
+ * in {@link #BATCH_ACTION_RESULT_TYPE} and
+ * {@link #BATCH_INSTALL_RESULT_TYPE}.
+ */
+ Item SUCCESS_ITEM = new Item(
+ SUCCESS,
+ "Whether the operation was successful",
+ SimpleType.BOOLEAN);
+
+ /**
+ * The key ERROR, used in {@link #ERROR_ITEM}.
+ */
+ String ERROR = "Error";
+
+ /**
+ * The item containing the error message of the batch operation. The key is
+ * {@link #ERROR} and the type is {@link SimpleType#STRING}. It is used in
+ * {@link #BATCH_ACTION_RESULT_TYPE} and {@link #BATCH_INSTALL_RESULT_TYPE}.
+ */
+ Item ERROR_ITEM = new Item(
+ ERROR,
+ "The error message if unsuccessful",
+ SimpleType.STRING);
+
+ /**
+ * The key COMPLETED, used in {@link #COMPLETED_ITEM}.
+ */
+ String COMPLETED = "Completed";
+
+ /**
+ * The item containing the list of bundles completing the batch operation.
+ * The key is {@link #COMPLETED} and the type is
+ * {@link JmxConstants#LONG_ARRAY_TYPE}. It is used in
+ * {@link #BATCH_ACTION_RESULT_TYPE} and {@link #BATCH_INSTALL_RESULT_TYPE}.
+ */
+ Item COMPLETED_ITEM = new Item(
+ COMPLETED,
+ "The bundle ids of the successfully completed installs",
+ JmxConstants.LONG_ARRAY_TYPE);
+
+ /**
+ * The key for BUNDLE_IN_ERROR. This key is used with two different items:
+ * {@link #BUNDLE_IN_ERROR_ID_ITEM} and
+ * {@link #BUNDLE_IN_ERROR_LOCATION_ITEM} that each have a different type
+ * for this key. It is used in {@link #BATCH_ACTION_RESULT_TYPE} and
+ * {@link #BATCH_INSTALL_RESULT_TYPE}.
+ */
+ String BUNDLE_IN_ERROR = "BundleInError";
+
+ /**
+ * The item containing the bundle which caused the error during the batch
+ * operation. This item describes the bundle in error as an id. The key is
+ * {@link #BUNDLE_IN_ERROR} and the type is {@link SimpleType#LONG}. It is
+ * used in {@link #BATCH_ACTION_RESULT_TYPE}.
+ *
+ * @see #BUNDLE_IN_ERROR_LOCATION_ITEM for the item that has a location for
+ * the bundle in error.
+ */
+ Item BUNDLE_IN_ERROR_ID_ITEM = new Item(
+ BUNDLE_IN_ERROR,
+ "The id of the bundle causing the error",
+ SimpleType.LONG);
+
+ /**
+ * The key REMAINING, used in {@link #REMAINING_ID_ITEM} and
+ * {@link #REMAINING_LOCATION_ITEM}.
+ */
+ String REMAINING = "Remaining";
+
+ /**
+ * The item containing the list of remaining bundles unprocessed by the
+ * failing batch operation. The key is {@link #REMAINING} and the type is
+ * {@link JmxConstants#LONG_ARRAY_TYPE}. It is used in
+ * {@link #BATCH_ACTION_RESULT_TYPE} and {@link #BATCH_INSTALL_RESULT_TYPE}.
+ */
+ Item REMAINING_ID_ITEM = new Item(
+ REMAINING,
+ "The ids of the remaining bundles",
+ JmxConstants.LONG_ARRAY_TYPE);
+
+ /**
+ * The Composite Type for a batch action result.
+ * {@link #refreshPackages(long)} and {@link #refreshPackages(long[])}.
+ * Notice that a batch action result returns uses an id for the
+ * {@link #BUNDLE_IN_ERROR} while the {@link #BATCH_INSTALL_RESULT_TYPE}
+ * uses a location.
+ *
+ * This Composite Type consists of the following items:
+ * <ul>
+ * <li>{@link #BUNDLE_IN_ERROR_ID_ITEM}</li>
+ * <li>{@link #COMPLETED_ITEM}</li>
+ * <li>{@link #ERROR_ITEM}</li>
+ * <li>{@link #REMAINING_ID_ITEM}</li>
+ * <li>{@link #SUCCESS_ITEM}</li>
+ * </ul>
+ */
+ CompositeType BATCH_ACTION_RESULT_TYPE = Item
+ .compositeType(
+ "BUNDLE_ACTION_RESULT",
+ "This type encapsulates a bundle batch install action result",
+ BUNDLE_IN_ERROR_ID_ITEM,
+ COMPLETED_ITEM,
+ ERROR_ITEM,
+ REMAINING_ID_ITEM,
+ SUCCESS_ITEM //
+ );
+
+ /**
+ * The item containing the bundle which caused the error during the batch
+ * operation. This item describes the bundle in error as a location. The key
+ * is {@link #BUNDLE_IN_ERROR} and the type is {@link SimpleType#LONG}. It
+ * is used in {@link #BATCH_INSTALL_RESULT_TYPE}.
+ *
+ * @see #BUNDLE_IN_ERROR_ID_ITEM for the item that has a location for the
+ * bundle in error.
+ */
+ Item BUNDLE_IN_ERROR_LOCATION_ITEM = new Item(
+ BUNDLE_IN_ERROR,
+ "The location of the bundle causing the error",
+ SimpleType.LONG);
+
+ /**
+ * The item containing the list of remaining bundles unprocessed by the
+ * failing batch operation. The key is {@link #REMAINING} and the type is
+ * {@link JmxConstants#STRING_ARRAY_TYPE}. It is used in
+ * {@link #BATCH_ACTION_RESULT_TYPE} and {@link #BATCH_INSTALL_RESULT_TYPE}.
+ */
+ Item REMAINING_LOCATION_ITEM = new Item(
+ REMAINING,
+ "The locations of the remaining bundles",
+ JmxConstants.STRING_ARRAY_TYPE);
+
+ /**
+ * The Composite Type which represents the result of a batch install
+ * operation. It is used in {@link #installBundles(String[])} and
+ * {@link #installBundles(String[], String[])}.
+ *
+ * This Composite Type consists of the following items:
+ * <ul>
+ * <li>{@link #BUNDLE_IN_ERROR_LOCATION_ITEM}</li>
+ * <li>{@link #COMPLETED_ITEM}</li>
+ * <li>{@link #ERROR_ITEM}</li>
+ * <li>{@link #REMAINING_LOCATION_ITEM P }</li>
+ * <li>{@link #SUCCESS_ITEM}</li>
+ * </ul>
+ */
+ CompositeType BATCH_INSTALL_RESULT_TYPE = Item
+ .compositeType(
+ "BATCH_INSTALL_RESULT",
+ "This type encapsulates a bundle batch install action result",
+ BUNDLE_IN_ERROR_LOCATION_ITEM,
+ COMPLETED_ITEM,
+ ERROR_ITEM,
+ REMAINING_LOCATION_ITEM,
+ SUCCESS_ITEM //
+ );
+
+ /**
+ * Retrieve the framework start level
+ *
+ * @return the framework start level
+ * @throws IOException if the operation failed
+ */
+ int getFrameworkStartLevel() throws IOException;
+
+ /**
+ * Answer the initial start level assigned to a bundle when it is first
+ * started
+ *
+ * @return the start level
+ * @throws IOException if the operation failed
+ */
+ int getInitialBundleStartLevel() throws IOException;
+
+ /**
+ * Install the bundle indicated by the bundleLocations
+ *
+ * @param location the location of the bundle to install
+ * @return the bundle id the installed bundle
+ * @throws IOException if the operation does not succeed
+ */
+ long installBundle(String location) throws IOException;
+
+ /**
+ * Install the bundle indicated by the bundleLocations
+ *
+ * @param location the location to assign to the bundle
+ * @param url the URL which will supply the bytes for the bundle
+ * @return the bundle id the installed bundle
+ * @throws IOException if the operation does not succeed
+ */
+ long installBundle(String location, String url) throws IOException;
+
+ /**
+ * Batch install the bundles indicated by the list of bundleLocationUrls
+ *
+ * @see #BATCH_INSTALL_RESULT_TYPE for the precise specification of the
+ * CompositeData type representing the returned result.
+ *
+ * @param locations the array of locations of the bundles to install
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ */
+ CompositeData installBundles(String[] locations) throws IOException;
+
+ /**
+ * Batch install the bundles indicated by the list of bundleLocationUrls
+ *
+ * @see #BATCH_INSTALL_RESULT_TYPE BatchBundleResult for the precise
+ * specification of the CompositeData type representing the returned
+ * result.
+ *
+ * @param locations the array of locations to assign to the installed
+ * bundles
+ * @param urls the array of urls which supply the bundle bytes
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ */
+ CompositeData installBundles(String[] locations, String[] urls)
+ throws IOException;
+
+ /**
+ * Force the update, replacement or removal of the pacakges identified by
+ * the list of bundles
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE for the precise specification of the
+ * CompositeData type representing the returned result.
+ *
+ * ### there is not result???
+ * @param bundleIdentifier the bundle identifier
+ * @throws IOException if the operation failed
+ */
+ void refreshPackages(long bundleIdentifier) throws IOException;
+
+ /**
+ * Force the update, replacement or removal of the packages identified by
+ * the list of bundles.
+ *
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE for the precise specification of the
+ * CompositeData type representing the returned result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation failed
+ */
+ CompositeData refreshPackages(long[] bundleIdentifiers) throws IOException;
+
+ /**
+ * Resolve the bundle indicated by the unique symbolic name and version
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @return true if the bundle was resolved, false otherwise
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ boolean resolveBundle(long bundleIdentifier) throws IOException;
+
+ /**
+ * Batch resolve the bundles indicated by the list of bundle identifiers
+ *
+ * @param bundleIdentifiers = the identifiers of the bundles to resolve
+ * @return true if the bundles were resolved, false otherwise
+ * @throws IOException if the operation does not succeed
+ */
+ boolean resolveBundles(long[] bundleIdentifiers) throws IOException;
+
+ /**
+ * Restart the framework by updating the system bundle
+ *
+ * @throws IOException if the operation failed
+ */
+ void restartFramework() throws IOException;
+
+ /**
+ * Set the start level for the bundle identifier
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @param newlevel the new start level for the bundle
+ * @throws IOException if the operation failed
+ */
+ void setBundleStartLevel(long bundleIdentifier, int newlevel)
+ throws IOException;
+
+ /**
+ * Set the start levels for the list of bundles.
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE for the precise specification of the
+ * CompositeData type representing the returned result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @param newlevels the array of new start level for the bundles
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation failed
+ */
+ CompositeData setBundleStartLevels(long[] bundleIdentifiers, int[] newlevels)
+ throws IOException;
+
+ /**
+ * Set the start level for the framework
+ *
+ * @param newlevel the new start level
+ * @throws IOException if the operation failed
+ */
+ void setFrameworkStartLevel(int newlevel) throws IOException;
+
+ /**
+ * Set the initial start level assigned to a bundle when it is first started
+ *
+ * @param newlevel the new start level
+ * @throws IOException if the operation failed
+ */
+ void setInitialBundleStartLevel(int newlevel) throws IOException;
+
+ /**
+ * Shutdown the framework by stopping the system bundle
+ *
+ * @throws IOException if the operation failed
+ */
+ void shutdownFramework() throws IOException;
+
+ /**
+ * Start the bundle indicated by the bundle identifier
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ void startBundle(long bundleIdentifier) throws IOException;
+
+ /**
+ * Batch start the bundles indicated by the list of bundle identifier
+ *
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE for the precise specification of the
+ * CompositeData type representing the returned result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ */
+ CompositeData startBundles(long[] bundleIdentifiers) throws IOException;
+
+ /**
+ * Stop the bundle indicated by the bundle identifier
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ void stopBundle(long bundleIdentifier) throws IOException;
+
+ /**
+ * Batch stop the bundles indicated by the list of bundle identifier
+ *
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE for the precise specification of the
+ * CompositeData type representing the returned result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ */
+ CompositeData stopBundles(long[] bundleIdentifiers) throws IOException;
+
+ /**
+ * Uninstall the bundle indicated by the bundle identifier
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ void uninstallBundle(long bundleIdentifier) throws IOException;
+
+ /**
+ * Batch uninstall the bundles indicated by the list of bundle identifiers
+ *
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE for the precise specification of the
+ * CompositeData type representing the returned result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ */
+ CompositeData uninstallBundles(long[] bundleIdentifiers) throws IOException;
+
+ /**
+ * Update the bundle indicated by the bundle identifier
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ void updateBundle(long bundleIdentifier) throws IOException;
+
+ /**
+ * Update the bundle identified by the bundle identifier
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @param url the URL to use to update the bundle
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ void updateBundle(long bundleIdentifier, String url) throws IOException;
+
+ /**
+ * Batch update the bundles indicated by the list of bundle identifier.
+ *
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE for the precise specification of the
+ * CompositeData type representing the returned result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ */
+ CompositeData updateBundles(long[] bundleIdentifiers) throws IOException;
+
+ /**
+ * Update the bundle uniquely identified by the bundle symbolic name and
+ * version using the contents of the supplied urls.
+ *
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE for the precise specification of the
+ * CompositeData type representing the returned result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @param urls the array of URLs to use to update the bundles
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ CompositeData updateBundles(long[] bundleIdentifiers, String[] urls)
+ throws IOException;
+
+ /**
+ * Update the framework by updating the system bundle.
+ *
+ * @throws IOException if the operation failed
+ */
+ void updateFramework() throws IOException;
+
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/FrameworkMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/PackageStateMBean.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/PackageStateMBean.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/PackageStateMBean.java 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) OSGi Alliance (2009). All Rights Reserved.
+ *
+ * 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.osgi.jmx.framework;
+
+import java.io.IOException;
+
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.SimpleType;
+import javax.management.openmbean.TabularData;
+import javax.management.openmbean.TabularType;
+
+import org.osgi.jmx.Item;
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean provides information about the package state of the framework.
+ *
+ * @version $Revision$
+ */
+public interface PackageStateMBean {
+ /**
+ * The fully qualified object name of this MBean.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_CORE
+ + ":type=packageState,version=1.5";
+
+ /**
+ * The key EXPORTING_BUNDLE, used in {@link #EXPORTING_BUNDLE_ITEM}.
+ */
+ String EXPORTING_BUNDLE = "ExportingBundle";
+ /**
+ * The item containing the bundle identifier in {@link #PACKAGE_TYPE}. The
+ * key is {@link #EXPORTING_BUNDLE} and the type is {@link SimpleType#LONG}.
+ *
+ * ### Is ExportingBundle not a better name?
+ */
+ Item EXPORTING_BUNDLE_ITEM = new Item(
+ EXPORTING_BUNDLE,
+ "The bundle the package belongs to",
+ SimpleType.LONG);
+
+ /**
+ * The key IMPORTING_BUNDLES, used in {@link #IMPORTING_BUNDLES_ITEM}.
+ */
+ String IMPORTING_BUNDLES = "ImportingBundles";
+
+ /**
+ * The item containing the bundle identifier in {@link #PACKAGE_TYPE}. The
+ * key is {@link #EXPORTING_BUNDLE} and the type is {@link SimpleType#LONG}.
+ */
+ Item IMPORTING_BUNDLES_ITEM = new Item(
+ IMPORTING_BUNDLES,
+ "The importing bundles of the package",
+ JmxConstants.LONG_ARRAY_TYPE);
+
+ /**
+ * The key NAME, used in {@link #NAME_ITEM}.
+ */
+ String NAME = "Name";
+
+ /**
+ * The item containing the name of the package in {@link #PACKAGE_TYPE}. The
+ * key is {@link #NAME} and the type is {@link SimpleType#LONG}.
+ */
+ Item NAME_ITEM = new Item(NAME,
+ "The package name",
+ SimpleType.STRING);
+
+ /**
+ * The name of the item containing the pending removal status of the package
+ * in the CompositeData. Used
+ */
+ String REMOVAL_PENDING = "RemovalPending";
+ /**
+ *
+ */
+ Item REMOVAL_PENDING_ITEM = new Item(
+ REMOVAL_PENDING,
+ "Whether the package is pending removal",
+ SimpleType.BOOLEAN);
+
+ /**
+ * The name of the item containing the package version in the CompositeData.
+ * Used in {@link #VERSION_ITEM}.
+ */
+ String VERSION = "Version";
+
+ /**
+ * The item containing the version of the package in {@link #PACKAGE_TYPE}.
+ * The key is {@link #VERSION} and the type is {@link SimpleType#STRING}.
+ */
+ Item VERSION_ITEM = new Item(
+ VERSION,
+ "The identifier of the bundle the service belongs to",
+ SimpleType.STRING);
+
+ /**
+ * The item names in the CompositeData representing the package. This type
+ * consists of:
+ * <ul>
+ * <li>{@link #EXPORTING_BUNDLE_ITEM}</li>
+ * <li>{@link #IMPORTING_BUNDLES_ITEM}</li>
+ * <li>{@link #NAME_ITEM}</li>
+ * <li>{@link #REMOVAL_PENDING_ITEM}</li>
+ * <li>{@link #VERSION_ITEM}</li>
+ * </ul>
+ * The key is defined as {@link #NAME} and {@link #EXPORTING_BUNDLE}
+ */
+ CompositeType PACKAGE_TYPE = Item
+ .compositeType(
+ "PACKAGE",
+ "This type encapsulates an OSGi package",
+ EXPORTING_BUNDLE_ITEM,
+ IMPORTING_BUNDLES_ITEM,
+ NAME_ITEM,
+ REMOVAL_PENDING_ITEM,
+ VERSION_ITEM);
+
+ /**
+ * The Tabular Type used in {@link #listPackages()}. They key is
+ * {@link #NAME}, {@link #VERSION}, and {@link #EXPORTING_BUNDLE}.
+ */
+ TabularType PACKAGES_TYPE = Item.tabularType("PACKAGES",
+ "A table of packages",
+ PACKAGE_TYPE, NAME,
+ VERSION, EXPORTING_BUNDLE);
+
+ /**
+ * Answer the identifier of the bundle exporting the package
+ *
+ * @param packageName - the package name
+ * @param version - the version of the package
+ * @return the bundle identifier or -1 if there is no bundle
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the package indicated does not exist
+ */
+ long getExportingBundle(String packageName, String version)
+ throws IOException;
+
+ /**
+ * Answer the list of identifiers of the bundles importing the package
+ *
+ * ### packageName and version is not unique
+ *
+ * @param packageName - the package name
+ * @param version - the version of the package
+ * @return the list of bundle identifiers
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the package indicated does not exist
+ *
+ */
+ long[] getImportingBundles(String packageName, String version)
+ throws IOException;
+
+ /**
+ * Answer the package state of the system in tabular form
+ *
+ * The Tabular Data is typed by {@link #PACKAGES_TYPE}, which has
+ * {@link #PACKAGE_TYPE} as its Composite Type.
+ *
+ * @return the tabular representation of the package state
+ * @throws IOException When fails
+ */
+ TabularData listPackages() throws IOException;
+
+ /**
+ * Answer if this package is exported by a bundle which has been updated or
+ * uninstalled
+ *
+ * @param packageName - the package name
+ * @param version - the version of the package
+ * @return true if this package is being exported by a bundle that has been
+ * updated or uninstalled.
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the package indicated does not exist
+ */
+ boolean isRemovalPending(String packageName, String version)
+ throws IOException;
+
+}
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/PackageStateMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/ServiceStateMBean.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/ServiceStateMBean.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/ServiceStateMBean.java 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) OSGi Alliance (2009). All Rights Reserved.
+ *
+ * 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.osgi.jmx.framework;
+
+import java.io.IOException;
+
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.SimpleType;
+import javax.management.openmbean.TabularData;
+import javax.management.openmbean.TabularType;
+
+import org.osgi.jmx.Item;
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean represents the Service state of the framework. This MBean also
+ * emits events that clients can use to get notified of the changes in the
+ * service state of the framework.
+ *
+ */
+public interface ServiceStateMBean {
+ /**
+ * The fully qualified object name of this mbean.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_CORE
+ + ":type=serviceState,version=1.5";
+ /**
+ * The key BUNDLE_IDENTIFIER, used in {@link #BUNDLE_IDENTIFIER_ITEM}.
+ */
+ String BUNDLE_IDENTIFIER = "BundleIdentifier";
+ /**
+ * The item containing the bundle identifier in {@link #SERVICE_TYPE}. The
+ * key is {@link #BUNDLE_IDENTIFIER} and the type is {@link SimpleType#LONG}
+ * .
+ */
+ Item BUNDLE_IDENTIFIER_ITEM = new Item(
+ BUNDLE_IDENTIFIER,
+ "The identifier of the bundle the service belongs to",
+ SimpleType.LONG);
+
+ /**
+ * The key OBJECT_CLASS, used {@link #OBJECT_CLASS_ITEM}.
+ */
+ String OBJECT_CLASS = "objectClass";
+
+ /**
+ * The item containing the interfaces of the service in
+ * {@link #SERVICE_TYPE}. The key is {@link #OBJECT_CLASS} and the type is
+ * {@link JmxConstants#STRING_ARRAY_TYPE}.
+ */
+ Item OBJECT_CLASS_ITEM = new Item(
+ OBJECT_CLASS,
+ "An string array containing the interfaces under which the service has been registered",
+ JmxConstants.STRING_ARRAY_TYPE);
+
+ /**
+ * The key IDENTIFIER, used {@link #IDENTIFIER_ITEM}.
+ */
+ String IDENTIFIER = "Identifier";
+
+ /**
+ * The item containing the service identifier in {@link #SERVICE_TYPE}. The
+ * key is {@link #IDENTIFIER} and the type is {@link SimpleType#LONG}.
+ */
+ Item IDENTIFIER_ITEM = new Item(
+ IDENTIFIER,
+ "The identifier of the service",
+ SimpleType.LONG);
+
+ /**
+ * The key USING_BUNDLES, used in {@link #USING_BUNDLES_ITEM}.
+ */
+ String USING_BUNDLES = "UsingBundles";
+
+ /**
+ * The item containing the bundles using the service in
+ * {@link #SERVICE_TYPE}. The key is {@link #USING_BUNDLES} and the type is
+ * {@link JmxConstants#LONG_ARRAY_TYPE}.
+ */
+ Item USING_BUNDLES_ITEM = new Item(
+ USING_BUNDLES,
+ "The bundles using the service",
+ JmxConstants.LONG_ARRAY_TYPE);
+
+ /**
+ * The key PROPERTIES, used in {@link #PROPERTIES_ITEM}.
+ */
+ String PROPERTIES = "Properties";
+
+ /**
+ * The item containing service properties. The key is {@link #PROPERTIES}
+ * and the type is {@link JmxConstants#PROPERTIES_TYPE}.
+ */
+ Item PROPERTIES_ITEM = new Item(
+ PROPERTIES,
+ "The service properties",
+ JmxConstants.PROPERTIES_TYPE);
+
+ /**
+ * The item names in the CompositeData representing the service. This type
+ * consists of:
+ * <ul>
+ * <li>{@link #BUNDLE_IDENTIFIER}</li>
+ * <li>{@link #IDENTIFIER}</li>
+ * <li>{@link #OBJECT_CLASS}</li>
+ * <li>{@link #PROPERTIES}</li>
+ * <li>{@link #USING_BUNDLES}</li>
+ * </ul>
+ */
+ CompositeType SERVICE_TYPE = Item
+ .compositeType(
+ "SERVICE",
+ "This type encapsulates an OSGi service",
+ BUNDLE_IDENTIFIER_ITEM,
+ IDENTIFIER_ITEM,
+ OBJECT_CLASS_ITEM,
+ PROPERTIES_ITEM,
+ USING_BUNDLES_ITEM);
+
+ /**
+ * The Tabular Type for a Service table. The rows consists of
+ * {@link #SERVICE_TYPE} Composite Data and the index is {@link #IDENTIFIER}
+ * .
+ */
+ TabularType SERVICES_TYPE = Item
+ .tabularType(
+ "SERVICES",
+ "The table of all services",
+ SERVICE_TYPE,
+ IDENTIFIER);
+
+ /**
+ * Answer the list of interfaces that this service implements
+ *
+ * @param serviceId the identifier of the service
+ * @return the list of interfaces
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the service indicated does not exist
+ */
+ public String[] getObjectClass(long serviceId) throws IOException;
+
+ /**
+ * Answer the bundle identifier of the bundle which registered the service
+ *
+ * @param serviceId the identifier of the service
+ * @return the identifier for the bundle
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the service indicated does not exist
+ */
+ long getBundleIdentifier(long serviceId) throws IOException;
+
+ /**
+ * Answer the map of properties associated with this service
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for the details of the TabularType
+ *
+ * @param serviceId the identifier of the service
+ * @return the table of properties. These include the standard mandatory
+ * service.id and objectClass properties as defined in the
+ * <code>org.osgi.framework.Constants</code> interface
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the service indicated does not exist
+ */
+ TabularData getProperties(long serviceId) throws IOException;
+
+ /**
+ * Answer the service state of the system in tabular form.
+ *
+ * @see #SERVICES_TYPE for the details of the TabularType
+ *
+ * @return the tabular representation of the service state
+ * @throws IOException If the operation fails
+ * @throws IllegalArgumentException if the service indicated does not exist
+ */
+ TabularData listServices() throws IOException;
+
+ /**
+ * Answer the list of identifiers of the bundles that use the service
+ *
+ * @param serviceId the identifier of the service
+ * @return the list of bundle identifiers
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the service indicated does not exist
+ */
+ long[] getUsingBundles(long serviceId) throws IOException;
+
+}
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/ServiceStateMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/package.html
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/package.html (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/package.html 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,11 @@
+<!-- $Revision: 8212 $ -->
+<BODY>
+<p>OSGi JMX Framework Package Version 1.5.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.jmx.framework; version="[1.5,2.0)"
+</pre>
+</BODY>
+
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/packageinfo
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/packageinfo (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/framework/packageinfo 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1 @@
+version 1.5
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/package.html
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/package.html (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/package.html 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,11 @@
+<!-- $Revision: 8212 $ -->
+<BODY>
+<p>OSGi JMX Package Version 1.0.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.jmx; version="[1.0,2.0)"
+</pre>
+</BODY>
+
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/packageinfo
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/packageinfo (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/packageinfo 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1 @@
+version 1.0
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/ConfigurationAdminMBean.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/ConfigurationAdminMBean.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/ConfigurationAdminMBean.java 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) OSGi Alliance (2009). All Rights Reserved.
+ *
+ * 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.osgi.jmx.service.cm;
+
+import java.io.IOException;
+
+import javax.management.openmbean.TabularData;
+
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean provides the management interface to the OSGi Configuration
+ * Administration Service.
+ *
+ * @version $Revision$
+ */
+public interface ConfigurationAdminMBean {
+ /**
+ * The object name for this mbean.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_COMPENDIUM+":service=cm,version=1.3";
+
+ /**
+ * Create a new configuration instance for the supplied persistent id of the
+ * factory, answering the PID of the created configuration
+ *
+ * @param factoryPid the persistent id of the factory
+ * @return the PID of the created configuration
+ * @throws IOException if the operation failed
+ */
+ String createFactoryConfiguration(String factoryPid) throws IOException;
+
+ /**
+ * Create a factory configuration for the supplied persistent id of the
+ * factory and the bundle location bound to bind the created configuration
+ * to, answering the PID of the created configuration
+ *
+ * @param factoryPid the persistent id of the factory
+ * @param location the bundle location
+ * @return the pid of the created configuation
+ * @throws IOException if the operation failed
+ */
+ String createFactoryConfiguration(String factoryPid, String location)
+ throws IOException;
+
+ /**
+ * Delete the configuration
+ *
+ * @param pid the persistent identifier of the configuration
+ * @throws IOException if the operation fails
+ */
+ void delete(String pid) throws IOException;
+
+ /**
+ * Delete the configuration
+ *
+ * @param pid the persistent identifier of the configuration
+ * @param location the bundle location
+ * @throws IOException if the operation fails
+ */
+ void delete(String pid, String location) throws IOException;
+
+ /**
+ * Delete the configurations matching the filter specification.
+ *
+ * @param filter the string representation of the
+ * <code>org.osgi.framework.Filter</code>
+ * @throws IOException if the operation failed
+ * @throws IllegalArgumentException if the filter is invalid
+ */
+ void deleteConfigurations(String filter) throws IOException;
+
+ /**
+ * Answer the bundle location the configuration is bound to
+ *
+ * @param pid the persistent identifier of the configuration
+ * @return the bundle location
+ * @throws IOException if the operation fails
+ */
+ String getBundleLocation(String pid) throws IOException;
+
+ /**
+ * Answer the factory PID if the configuration is a factory configuration,
+ * null otherwise.
+ *
+ * @param pid the persistent identifier of the configuration
+ * @return the factory PID
+ * @throws IOException if the operation fails
+ */
+ String getFactoryPid(String pid) throws IOException;
+
+ /**
+ * Answer the factory PID if the configuration is a factory configuration,
+ * null otherwise.
+ *
+ * @param pid the persistent identifier of the configuration
+ * @param location the bundle location
+ * @return the factory PID
+ * @throws IOException if the operation fails
+ */
+ String getFactoryPid(String pid, String location) throws IOException;
+
+ /**
+ * Answer the contents of the configuration <p/>
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for the details of the TabularType
+ *
+ * @param pid the persistent identifier of the configuration
+ * @return the table of contents
+ * @throws IOException if the operation fails
+ */
+
+ TabularData getProperties(String pid) throws IOException;
+
+ /**
+ * Answer the contents of the configuration <p/>
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for the details of the TabularType
+ *
+ * @param pid the persistent identifier of the configuration
+ * @param location the bundle location
+ * @return the table of contents
+ * @throws IOException if the operation fails
+ */
+ TabularData getProperties(String pid, String location) throws IOException;
+
+ /**
+ * Answer the list of PID/Location pairs of the configurations managed by
+ * this service
+ *
+ * @param filter the string representation of the
+ * <code>org.osgi.framework.Filter</code>
+ * @return the list of configuration PID/Location pairs
+ * @throws IOException if the operation failed
+ * @throws IllegalArgumentException if the filter is invalid
+ */
+ String[][] getConfigurations(String filter) throws IOException;
+
+ /**
+ * Set the bundle location the configuration is bound to
+ *
+ * @param pid the persistent identifier of the configuration
+ * @param location the bundle location
+ * @throws IOException if the operation fails
+ */
+ void setBundleLocation(String pid, String location) throws IOException;
+
+ /**
+ * Update the configuration with the supplied properties For each property
+ * entry, the following row is supplied <p/>
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for the details of the TabularType
+ *
+ * @param pid the persistent identifier of the configuration
+ * @param properties the table of properties
+ * @throws IOException if the operation fails
+ */
+ void update(String pid, TabularData properties) throws IOException;
+
+ /**
+ * Update the configuration with the supplied properties For each property
+ * entry, the following row is supplied <p/>
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for the details of the TabularType
+ *
+ * @param pid the persistent identifier of the configuration
+ * @param location the bundle location
+ * @param properties the table of properties
+ * @throws IOException if the operation fails
+ */
+ void update(String pid, String location, TabularData properties)
+ throws IOException;
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/ConfigurationAdminMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/package.html
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/package.html (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/package.html 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,11 @@
+<!-- $Revision: 8212 $ -->
+<BODY>
+<p>OSGi JMX CM Package Version 1.3.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.jmx.service.cm; version="[1.3,2.0)"
+</pre>
+</BODY>
+
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/packageinfo
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/packageinfo (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/cm/packageinfo 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1 @@
+version 1.3
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/PermissionAdminMBean.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/PermissionAdminMBean.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/PermissionAdminMBean.java 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) OSGi Alliance (2009). All Rights Reserved.
+ *
+ * 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.osgi.jmx.service.permissionadmin;
+
+import java.io.IOException;
+
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean represents the OSGi Permission Manager Service
+ *
+ * @version $Revision$
+ */
+public interface PermissionAdminMBean {
+ /**
+ * Permission Admin MBean object name.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_CORE
+ + ":service=permissionadmin,version=1.2";
+
+ /**
+ * Answer the bundle locations that have permissions assigned to them
+ *
+ * @return the bundle locations
+ * @throws IOException if the operation fails
+ */
+ String[] listLocations() throws IOException;
+
+ /**
+ * Answer the list of encoded permissions of the bundle specified by the
+ * bundle location
+ *
+ * @param location location identifying the bundle
+ * @return the array of String encoded permissions
+ * @throws IOException if the operation fails
+ */
+ String[] getPermissions(String location) throws IOException;
+
+ /**
+ * Set the default permissions assigned to bundle locations that have no
+ * assigned permissions
+ *
+ * @param encodedPermissions the string encoded permissions
+ * @throws IOException if the operation fails
+ */
+ void setDefaultPermissions(String[] encodedPermissions) throws IOException;
+
+ /**
+ * Answer the list of encoded permissions representing the default
+ * permissions assigned to bundle locations that have no assigned
+ * permissions
+ *
+ * @return the array of String encoded permissions
+ * @throws IOException if the operation fails
+ */
+ String[] listDefaultPermissions() throws IOException;
+
+ /**
+ * Set the permissions on the bundle specified by the bundle location
+ *
+ * @param location the location of the bundle
+ * @param encodedPermissions the string encoded permissions to set
+ * @throws IOException if the operation fails
+ */
+ void setPermissions(String location, String[] encodedPermissions)
+ throws IOException;
+}
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/PermissionAdminMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/package.html
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/package.html (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/package.html 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,11 @@
+<!-- $Revision: 8212 $ -->
+<BODY>
+<p>OSGi JMX Permission Admin Package Admin Package Version 1.2.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.jmx.service.permission; version="[1.2,2.0)"
+</pre>
+</BODY>
+
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/packageinfo
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/packageinfo (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/permissionadmin/packageinfo 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1 @@
+version 1.2
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/ProvisioningServiceMBean.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/ProvisioningServiceMBean.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/ProvisioningServiceMBean.java 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) OSGi Alliance (2009). All Rights Reserved.
+ *
+ * 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.osgi.jmx.service.provisioning;
+
+import java.io.IOException;
+
+import javax.management.openmbean.TabularData;
+
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean represents the management interface to the OSGi Initial
+ * Provisioning Service
+ *
+ * @version $Revision$
+ */
+public interface ProvisioningServiceMBean {
+ /**
+ * Provisioning MBean object name.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_COMPENDIUM
+ + ":service=provisioning,version=1.2";
+
+ /**
+ * Processes the <code>ZipInputStream</code> contents of the provided
+ * zipURL and extracts information to add to the Provisioning Information
+ * dictionary, as well as, install/update and start bundles. This method
+ * causes the <code>PROVISIONING_UPDATE_COUNT</code> to be incremented.
+ *
+ * @param zipURL the String form of the URL that will be resolved into a
+ * <code>ZipInputStream</code> which will be used to add key/value
+ * pairs to the Provisioning Information dictionary and install and
+ * start bundles. If a <code>ZipEntry</code> does not have an
+ * <code>Extra</code> field that corresponds to one of the four
+ * defined MIME types (<code>MIME_STRING</code>,
+ * <code>MIME_BYTE_ARRAY</code>,<code>MIME_BUNDLE</code>, and
+ * <code>MIME_BUNDLE_URL</code>) in will be silently ignored.
+ * @throws IOException if an error occurs while processing the
+ * ZipInputStream of the URL. No additions will be made to the
+ * Provisioning Information dictionary and no bundles must be
+ * started or installed.
+ */
+ public void addInformation(String zipURL) throws IOException;
+
+ /**
+ * Adds the key/value pairs contained in <code>info</code> to the
+ * Provisioning Information dictionary. This method causes the
+ * <code>PROVISIONING_UPDATE_COUNT</code> to be incremented.
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for details of the Tabular Data
+ *
+ * @param info the set of Provisioning Information key/value pairs to add to
+ * the Provisioning Information dictionary. Any keys are values that
+ * are of an invalid type will be silently ignored.
+ * @throws IOException if the operation fails
+ */
+ public void addInformation(TabularData info) throws IOException;
+
+ /**
+ * Returns a table representing the Provisioning Information Dictionary.
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for details of the Tabular Data
+ *
+ * @throws IOException if the operation fails
+ * @return The table representing the manager dictionary.
+ */
+ public TabularData listInformation() throws IOException;
+
+ /**
+ * Replaces the Provisioning Information dictionary with the entries of the
+ * supplied table. This method causes the
+ * <code>PROVISIONING_UPDATE_COUNT</code> to be incremented.
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for details of the Tabular Data
+ *
+ * @param info the new set of Provisioning Information key/value pairs. Any
+ * keys are values that are of an invalid type will be silently
+ * ignored.
+ * @throws IOException if the operation fails
+ */
+ public void setInformation(TabularData info) throws IOException;
+
+}
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/ProvisioningServiceMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/package.html
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/package.html (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/package.html 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,11 @@
+<!-- $Revision: 8212 $ -->
+<BODY>
+<p>OSGi JMX Initial Provisioning Package Version 1.2.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.jmx.service.provisioning; version="[1.2,2.0)"
+</pre>
+</BODY>
+
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/packageinfo
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/packageinfo (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/provisioning/packageinfo 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1 @@
+version 1.2
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,540 @@
+/*
+ * Copyright (c) OSGi Alliance (2009). All Rights Reserved.
+ *
+ * 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.osgi.jmx.service.useradmin;
+
+import java.io.IOException;
+
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.SimpleType;
+import javax.management.openmbean.TabularData;
+
+import org.osgi.jmx.Item;
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean provides the management interface to the OSGi User Manager
+ * Service.
+ *
+ * @version $Revision$
+ */
+public interface UserAdminMBean {
+ /**
+ * User Admin MBean object name.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_COMPENDIUM
+ + ":service=useradmin,version=1.1";
+
+ /**
+ * The key NAME, used in {@link #NAME_ITEM}.
+ */
+ String NAME = "Name";
+
+ /**
+ * The user name for this authorization object. The key is {@link #NAME} and
+ * the type is {@link SimpleType#STRING}.
+ */
+ Item NAME_ITEM = new Item(
+ NAME,
+ "The user name for this authorization object",
+ SimpleType.STRING);
+
+ /**
+ * The key ROLES, used in {@link #ROLES_ITEM}.
+ */
+ String ROLES = "Roles";
+
+ /**
+ * The item containing the roles for this authorization object. The key is
+ * {@link #ROLES}. and the type is {@link JmxConstants#STRING_ARRAY_TYPE}.
+ */
+ Item ROLES_ITEM = new Item(
+ ROLES,
+ "The names of the roles encapsulated by this auth object",
+ JmxConstants.STRING_ARRAY_TYPE);
+
+ /**
+ * The Composite Type for an Authorization object. It consists of the
+ * {@link #NAME_ITEM} and {@link #TYPE_ITEM} items.
+ */
+ CompositeType AUTORIZATION_TYPE = Item
+ .compositeType(
+ "AUTHORIZATION",
+ "An authorization object defines which roles has a user got",
+ NAME_ITEM,
+ ROLES_ITEM);
+ /**
+ * The Role TYPE key, used in {@link #TYPE_ITEM}.
+ */
+ String TYPE = "Type";
+
+ /**
+ * The item containing the type of the roles encapsulated by this
+ * authorization object. The key is {@link #TYPE} and the type is
+ * {@link SimpleType#INTEGER}.
+ */
+ Item TYPE_ITEM = new Item(
+ TYPE,
+ "An integer representing type of the role: {0=Role,1=user,2=group}",
+ SimpleType.INTEGER);
+
+ /**
+ * The PROPERTIES key, used in {@link #PROPERTIES_ITEM}.
+ */
+ String PROPERTIES = "Properties";
+
+ /**
+ * The item containing the properties of a Role. The key is
+ * {@link #PROPERTIES} and the type is {@link JmxConstants#PROPERTIES_TYPE}.
+ */
+ Item PROPERTIES_ITEM = new Item(
+ PROPERTIES,
+ "A properties as defined by org.osgi.service.useradmin.Role",
+ JmxConstants.PROPERTIES_TYPE);
+ /**
+ * The item containing the type of Composite Type for a Role. It contains
+ * the following items:
+ * <ul>
+ * <li>{@link #NAME}</li
+ * <li>{@link #TYPE}</li>
+ * <li>{@link #PROPERTIES}</li>
+ * </ul>
+ *
+ */
+ CompositeType ROLE_TYPE = Item
+ .compositeType(
+ "ROLE",
+ "Mapping of org.osgi.service.useradmin.Role for remote management purposes. User and Group extend Role",
+ NAME_ITEM,
+ TYPE_ITEM,
+ PROPERTIES_ITEM);
+
+ /**
+ * The CREDENTIALS key, used in {@link #CREDENTIALS_ITEM}.
+ */
+ String CREDENTIALS = "Credentials";
+
+ /**
+ * The item containing the credentials of a user. The key is
+ * {@link #CREDENTIALS} and the type is {@link JmxConstants#PROPERTIES_TYPE}.
+ */
+ Item CREDENTIALS_ITEM = new Item(
+ CREDENTIALS,
+ "The credentials for this user",
+ JmxConstants.PROPERTIES_TYPE);
+
+ /**
+ * A Composite Type for a User. A User contains its Role description and
+ * adds the credentials. It extends {@link #ROLE_TYPE} and adds
+ * {@link #CREDENTIALS_ITEM}.
+ *
+ * This type extends the {@link #ROLE_TYPE}. It adds:
+ * <ul>
+ * <li>{@link #CREDENTIALS}</li
+ * </ul>
+ */
+ CompositeType USER_TYPE = Item
+ .extend(
+ ROLE_TYPE,
+ "USER",
+ "Mapping of org.osgi.service.useradmin.User for remote management purposes. User extends Role",
+ CREDENTIALS_ITEM);
+
+ /**
+ * The MEMBERS key, used in {@link #MEMBERS_ITEM}.
+ */
+ String MEMBERS = "Members";
+
+ /**
+ * The item containing the members of a group. The key is {@link #MEMBERS}
+ * and the type is {@link JmxConstants#STRING_ARRAY_TYPE}. It is used in
+ * {@link #GROUP_TYPE}.
+ */
+ Item MEMBERS_ITEM = new Item(
+ MEMBERS,
+ "The members of this group",
+ JmxConstants.STRING_ARRAY_TYPE);
+
+ /**
+ * The REQUIRED_MEMBERS key, used in {@link #REQUIRED_MEMBERS_ITEM}.
+ */
+ String REQUIRED_MEMBERS = "RequiredMembers";
+
+ /**
+ * The item containing the required members of a group. The key is
+ * {@link #REQUIRED_MEMBERS} and the type is
+ * {@link JmxConstants#STRING_ARRAY_TYPE}. It is used in
+ * {@link #GROUP_TYPE}.
+ */
+ Item REQUIRED_MEMBERS_ITEM = new Item(
+ REQUIRED_MEMBERS,
+ "The required members of this group",
+ JmxConstants.STRING_ARRAY_TYPE);
+
+ /**
+ * The Composite Type for a Group. It extends {@link #USER_TYPE} and adds
+ * {@link #MEMBERS_ITEM}, and {@link #REQUIRED_MEMBERS_ITEM}.
+ *
+ * This type extends the {@link #USER_TYPE}. It adds:
+ * <ul>
+ * <li>{@link #MEMBERS}</li
+ * <li>{@link #REQUIRED_MEMBERS}</li
+ * </ul>
+ */
+ CompositeType GROUP_TYPE = Item
+ .extend(
+ USER_TYPE,
+ "GROUP",
+ "Mapping of org.osgi.service.useradmin.Group for remote management purposes. Group extends User which in turn extends Role",
+ MEMBERS_ITEM,
+ REQUIRED_MEMBERS_ITEM);
+
+ /**
+ * Add credentials to a user, associated with the supplied key
+ *
+ * @param key The key of the credential to add
+ * @param value The value of the credential to add
+ * @param username The name of the user that gets the credential.
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the user name is not a User
+ */
+ void addCredential(String key, byte[] value, String username)
+ throws IOException;
+
+ /**
+ * Add credentials to a user, associated with the supplied key
+ *
+ * @param key The key of the credential to add
+ * @param value The value of the credential to add
+ * @param username The name of the user that gets the credential.
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the username is not a User
+ */
+ void addCredential(String key, String value, String username)
+ throws IOException;
+
+ /**
+ * Add a member to the group.
+ *
+ * ### Hal, please check, I am not clear who is the receiver and who is the
+ * parameter. The ordering seems very confusing, because here the rolename
+ * seems the parameter but in all other calls it is the dest?
+ *
+ * @param groupname The group name that receives the <code>rolename</code>
+ * as member.
+ * @param rolename The <code>rolename</code> (User or Group) that must be
+ * added.
+ * @return <code>true</code> if the role was added to the group
+ * @throws IOException if the operation fails
+ *
+ */
+ boolean addMember(String groupname, String rolename) throws IOException;
+
+ /**
+ * Add or update a property on a role
+ *
+ * @param key The key of the property to add
+ * @param value The value of the property to add (<code>String</code>)
+ * @param rolename The role name
+ * @throws IOException if the operation fails
+ */
+ void addProperty(String key, String value, String rolename)
+ throws IOException;
+
+ /**
+ * Add or update a property on a role.
+ *
+ * @param key The added property key
+ * @param value The added byte[] property value
+ * @param rolename The role name that receives the property
+ * @throws IOException if the operation fails
+ */
+ void addProperty(String key, byte[] value, String rolename)
+ throws IOException;
+
+ /**
+ * Add a required member to the group
+ *
+ * @param groupname The group name that is addded
+ * @param rolename The role that
+ * @return true if the role was added to the group
+ * @throws IOException if the operation fails
+ */
+ boolean addRequiredMember(String groupname, String rolename)
+ throws IOException;
+
+ /**
+ * Create a User
+ *
+ * @param name Name of the user to create
+ * @throws IOException if the operation fails
+ */
+ void createUser(String name) throws IOException;
+
+ /**
+ * Create a Group
+ *
+ * @param name Name of the group to create
+ * @throws IOException if the operation fails
+ */
+ void createGroup(String name) throws IOException;
+
+ /**
+ * Create a Role
+ *
+ * @param name of the role to create
+ * @throws IOException if the operation fails
+ */
+ void createRole(String name) throws IOException;
+
+ /**
+ * Answer the authorization for the user name.
+ *
+ * The Composite Data is typed by {@link #AUTORIZATION_TYPE}.
+ *
+ * @param user The user name
+ * @return the Authorization typed by {@link #AUTORIZATION_TYPE}.
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the user name is not a User
+ */
+ CompositeData getAuthorization(String user) throws IOException;
+
+ /**
+ * Answer the credentials associated with a user.
+ *
+ * The returned Tabular Data is typed by
+ * {@link JmxConstants#PROPERTIES_TYPE}.
+ *
+ * @param username The user name
+ * @return the credentials associated with the user, see
+ * {@link JmxConstants#PROPERTIES_TYPE}
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the user name is not a User
+ */
+ TabularData getCredentials(String username) throws IOException;
+
+ /**
+ * Answer the Group associated with the group name.
+ *
+ * The returned Composite Data is typed by {@link #GROUP_TYPE}
+ *
+ * @param groupname The group name
+ * @return the Group, see {@link #GROUP_TYPE}
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the group name is not a Group
+ */
+ CompositeData getGroup(String groupname) throws IOException;
+
+ /**
+ * Answer the list of group names
+ *
+ * @return The list of group names
+ * @throws IOException if the operation fails
+ */
+ String[] listGroups() throws IOException;
+
+ /**
+ * Answer the list of group names
+ *
+ * @param filter The filter to apply
+ * @return The list of group names
+ * @throws IOException if the operation fails
+ */
+ String[] getGroups(String filter) throws IOException;
+
+ /**
+ * Answer the list of implied roles for a user
+ *
+ * ### I do not know how this maps to User Admin?
+ *
+ * @param username The name of the user that has the implied roles
+ * @return The list of role names
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the username is not a User
+ */
+ String[] getImpliedRoles(String username) throws IOException;
+
+ /**
+ * Answer the the user names which are members of the group
+ *
+ * @param groupname The name of the group to get the members from
+ * @return The list of user names
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the <code>groupname</code> is not a
+ * group
+ */
+ String[] getMembers(String groupname) throws IOException;
+
+ /**
+ * Answer the properties associated with a role.
+ *
+ * The returned Tabular Data is typed by
+ * {@link JmxConstants#PROPERTIES_TYPE}.
+ *
+ * @param rolename The name of the role to get properties from
+ * @return the properties associated with the role, see
+ * {@link JmxConstants#PROPERTIES_TYPE}
+ * @throws IOException if the operation fails
+ */
+ TabularData getProperties(String rolename) throws IOException;
+
+ /**
+ * Answer the list of user names which are required members of this group
+ *
+ * @param groupname The name of the group to get the required members from
+ * @return The list of user names
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the group name is not a group
+ */
+ String[] getRequiredMembers(String groupname) throws IOException;
+
+ /**
+ * Answer the role associated with a name.
+ *
+ * The returned Composite Data is typed by {@link #ROLE_TYPE}.
+ *
+ * ### Is this also all users and groups?
+ *
+ * @param name The name of the role to get the data from
+ * @return the Role, see {@link #ROLE_TYPE}
+ * @throws IOException if the operation fails
+ */
+ CompositeData getRole(String name) throws IOException;
+
+ /**
+ * Answer the list of role names in the User Admin database
+ *
+ * ### Is this also all users and groups?
+ *
+ * @return The list of role names
+ * @throws IOException if the operation fails
+ */
+ String[] listRoles() throws IOException;
+
+ /**
+ * Answer the list of role names which match the supplied filter
+ *
+ * @param filter The string representation of the
+ * <code>org.osgi.framework.Filter</code> that is used to filter
+ * the roles by applying to the properties, if <code>null</code>
+ * all roles are returned.
+ *
+ * @return The list the role names
+ * @throws IOException if the operation fails
+ */
+ String[] getRoles(String filter) throws IOException;
+
+ /**
+ * Answer the User associated with the user name.
+ *
+ * The returned Composite Data is typed by {@link #USER_TYPE}.
+ *
+ * @param username The name of the requested user
+ * @return The User, see {@link #USER_TYPE}
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the <code>username</code> is not a
+ * User
+ */
+ CompositeData getUser(String username) throws IOException;
+
+ /**
+ * Answer the user name with the given property key-value pair from the User
+ * Admin service database.
+ *
+ * @param key The key to compare
+ * @param value The value to compare
+ * @return The User
+ * @throws IOException if the operation fails
+ */
+ String getUser(String key, String value) throws IOException;
+
+ /**
+ * Answer the list of user names in the User Admin database
+ *
+ * @return The list of user names
+ * @throws IOException if the operation fails
+ */
+ String[] listUsers() throws IOException;
+
+ /**
+ * Answer the list of user names in the User Admin database
+ *
+ * @param filter The filter to apply
+ * @return The list of user names
+ * @throws IOException if the operation fails
+ */
+ String[] getUsers(String filter) throws IOException;
+
+ /**
+ * Remove the credential associated with the given user
+ *
+ * @param key The key of the credential to remove
+ * @param username The name of the user for which the credential must be
+ * removed
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the username is not a User
+ */
+ void removeCredential(String key, String username) throws IOException;
+
+ /**
+ * Remove a role from the group
+ *
+ * @param groupname The group name
+ * @param rolename
+ * @return true if the role was removed from the group
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the groupname is not a Group
+ */
+ boolean removeMember(String groupname, String rolename) throws IOException;
+
+ /**
+ * Remove a property from a role
+ *
+ * @param key
+ * @param rolename
+ * @throws IOException if the operation fails
+ */
+ void removeProperty(String key, String rolename) throws IOException;
+
+ /**
+ * Remove the Role associated with the name
+ *
+ * @param name
+ * @return true if the remove succeeded
+ * @throws IOException if the operation fails
+ */
+ boolean removeRole(String name) throws IOException;
+
+ /**
+ * Remove the Group associated with the name
+ *
+ * @param name
+ * @return true if the remove succeeded
+ * @throws IOException if the operation fails
+ */
+ boolean removeGroup(String name) throws IOException;
+
+ /**
+ * Remove the User associated with the name
+ *
+ * @param name
+ * @return true if the remove succeeded
+ * @throws IOException if the operation fails
+ */
+ boolean removeUser(String name) throws IOException;
+
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/package.html
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/package.html (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/package.html 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1,11 @@
+<!-- $Revision: 8212 $ -->
+<BODY>
+<p>OSGi JMX User Admin Package Version 1.1.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.jmx.service.useradmin; version="[1.1,2.0)"
+</pre>
+</BODY>
+
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/packageinfo
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/packageinfo (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/osgi/jmx/service/useradmin/packageinfo 2009-10-27 10:20:22 UTC (rev 95605)
@@ -0,0 +1 @@
+version 1.1
16 years, 1 month
JBoss-OSGI SVN: r95603 - projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-27 05:20:36 -0400 (Tue, 27 Oct 2009)
New Revision: 95603
Modified:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppExtenderTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.java
Log:
Reopen: NPE in JettyServerHandlerCollection
http://issues.ops4j.org/browse/PAXWEB-182
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java 2009-10-27 07:01:07 UTC (rev 95602)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java 2009-10-27 09:20:36 UTC (rev 95603)
@@ -24,13 +24,14 @@
// $Id$
import java.io.BufferedReader;
+import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import org.jboss.osgi.testing.OSGiTest;
/**
- * A test that deployes a WAR bundle
+ * Abstract base class for webapp example.
*
* @author thomas.diesler(a)jboss.com
* @since 06-Oct-2009
@@ -39,8 +40,35 @@
{
protected String getHttpResponse(String reqPath) throws Exception
{
- URL url = new URL("http://" + getServerHost() + ":8090/example-webapp" + reqPath);
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- return br.readLine();
+ return getHttpResponse(reqPath, 0);
}
+
+ protected String getHttpResponse(String reqPath, int timeout) throws Exception
+ {
+ int fraction = 200;
+ int steps = Math.max(timeout / fraction, 1);
+
+ String line = null;
+ IOException lastException = null;
+ while (line == null && 0 < steps--)
+ {
+ try
+ {
+ URL url = new URL("http://" + getServerHost() + ":8090/example-webapp" + reqPath);
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ line = br.readLine();
+ br.close();
+ }
+ catch (IOException ex)
+ {
+ lastException = ex;
+ Thread.sleep(fraction);
+ }
+ }
+
+ if (line == null && lastException != null)
+ throw lastException;
+
+ return line;
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppExtenderTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppExtenderTestCase.java 2009-10-27 07:01:07 UTC (rev 95602)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppExtenderTestCase.java 2009-10-27 09:20:36 UTC (rev 95603)
@@ -25,8 +25,6 @@
import static org.junit.Assert.assertEquals;
-import java.io.IOException;
-
import org.jboss.osgi.spi.capability.HttpServiceCapability;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
@@ -37,6 +35,10 @@
/**
* A test that deployes a WAR bundle
*
+ * Due to the nature of asynchronous event processing by the
+ * extender pattern, we cannot assume that the endpoint is
+ * available immediately
+ *
* @author thomas.diesler(a)jboss.com
* @since 06-Oct-2009
*/
@@ -67,49 +69,21 @@
@Test
public void testResourceAccess() throws Exception
{
- String line = getHttpResponse("/message.txt");
+ String line = getHttpResponse("/message.txt", 5000);
assertEquals("Hello from Resource", line);
}
@Test
public void testServletAccess() throws Exception
{
- String line = getHttpResponse("/servlet?test=plain");
+ String line = getHttpResponse("/servlet?test=plain", 5000);
assertEquals("Hello from Servlet", line);
}
@Test
public void testServletInitProps() throws Exception
{
- String line = getHttpResponse("/servlet?test=initProp");
+ String line = getHttpResponse("/servlet?test=initProp", 5000);
assertEquals("initProp=SomeValue", line);
}
-
- // Due to the nature of asynchronous event processing by the
- // extender pattern, we cannot assume that the endpoint is
- // available immediately
- protected String getHttpResponse(String reqPath) throws Exception
- {
- int timeout = 25;
- String line = null;
- IOException lastException = null;
- while (line == null && 0 < timeout--)
- {
- try
- {
- line = super.getHttpResponse(reqPath);
- }
- catch (IOException ex)
- {
- lastException = ex;
- }
- if (line == null)
- Thread.sleep(200);
- }
-
- if (line == null && lastException != null)
- throw lastException;
-
- return line;
- }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.java 2009-10-27 07:01:07 UTC (rev 95602)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.java 2009-10-27 09:20:36 UTC (rev 95603)
@@ -65,7 +65,8 @@
@Test
public void testResourceAccess() throws Exception
{
- String line = getHttpResponse("/message.txt");
+ // FIXME: http://issues.ops4j.org/browse/PAXWEB-182
+ String line = getHttpResponse("/message.txt", 30000);
assertEquals("Hello from Resource", line);
}
16 years, 1 month
JBoss-OSGI SVN: r95565 - in projects/jboss-osgi/trunk: reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer and 7 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-26 10:32:42 -0400 (Mon, 26 Oct 2009)
New Revision: 95565
Added:
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InvocationContextImpl.java
projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/MockBundleContext.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/util/DeploymentUnitAttachments.java
Removed:
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InterceptorContextImpl.java
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/Attachments.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/AbstractLifecycleInterceptorService.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/AttachmentSupport.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InterceptorWrapper.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java
projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/InterceptorOrderTestCase.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF
Log:
Delegate interceptor attachments to DeploymentUnit
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-10-26 14:30:20 UTC (rev 95564)
+++ projects/jboss-osgi/trunk/pom.xml 2009-10-26 14:32:42 UTC (rev 95565)
@@ -71,7 +71,7 @@
<version.jboss.osgi.webapp>0.7.2-SNAPSHOT</version.jboss.osgi.webapp>
<version.jboss.osgi.webconsole>1.0.2</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
- <version.ops4j.pax.web>0.7.2-20091021.163357-3</version.ops4j.pax.web>
+ <version.ops4j.pax.web>0.7.2-SNAPSHOT</version.ops4j.pax.web>
<version.osgi>4.2.0</version.osgi>
<surefire.memory.args>-Xmx512m</surefire.memory.args>
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/Attachments.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/Attachments.java 2009-10-26 14:30:20 UTC (rev 95564)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/Attachments.java 2009-10-26 14:32:42 UTC (rev 95565)
@@ -37,10 +37,10 @@
Collection<Key> getAttachmentKeys();
/** Add arbitrary attachment */
- <T> T addAttachment(Class<T> clazz, Object value);
+ <T> T addAttachment(Class<T> clazz, T value);
/** Add arbitrary attachment with name */
- <T> T addAttachment(Class<T> clazz, String name, Object value);
+ <T> T addAttachment(String name, T value, Class<T> clazz);
/** Add arbitrary attachment with name */
Object addAttachment(String name, Object value);
@@ -49,7 +49,7 @@
<T> T getAttachment(Class<T> clazz);
/** Get an arbitrary attachment */
- <T> T getAttachment(Class<T> clazz, String name);
+ <T> T getAttachment(String name, Class<T> clazz);
/** Get an arbitrary attachment */
Object getAttachment(String name);
@@ -74,7 +74,7 @@
/**
* Construct the key with optional class and name
*/
- public Key(Class<?> clazz, String name)
+ public Key(String name, Class<?> clazz)
{
this.clazz = clazz;
this.name = name;
@@ -99,7 +99,7 @@
throw new IllegalArgumentException("Cannot find class '" + className + "' in: " + key);
}
}
- return new Key(classPart, namePart);
+ return new Key(namePart, classPart);
}
return null;
}
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/AbstractLifecycleInterceptorService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/AbstractLifecycleInterceptorService.java 2009-10-26 14:30:20 UTC (rev 95564)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/AbstractLifecycleInterceptorService.java 2009-10-26 14:32:42 UTC (rev 95565)
@@ -30,14 +30,10 @@
import java.util.List;
import java.util.Set;
-import org.jboss.osgi.deployment.deployer.Deployment;
-import org.jboss.osgi.deployment.internal.InterceptorContextImpl;
import org.jboss.osgi.deployment.internal.InterceptorWrapper;
import org.jboss.osgi.spi.util.ConstantsHelper;
-import org.jboss.virtual.VirtualFile;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.Version;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -137,11 +133,13 @@
}
// Log the interceptor order
+ StringBuffer buffer = new StringBuffer();
for (LifecycleInterceptor aux : sortedList)
{
InterceptorWrapper wrapper = new InterceptorWrapper(aux);
- log.debug("\n " + wrapper.toLongString());
+ buffer.append("\n " + wrapper.toLongString());
}
+ log.debug("Resulting interceptor chain" + buffer.toString());
// Use the sorted result as the new interceptor chain
interceptorChain.clear();
@@ -219,45 +217,43 @@
if (interceptorChain.size() == 0)
return;
- String name = bundle.getSymbolicName();
- Version version = bundle.getVersion();
- Deployment dep = getDeployment(getSystemContext(), name, version);
- if (dep == null)
- throw new IllegalStateException("Cannot get deployment for: " + name + "-" + version);
+ InvocationContext inv = getInvocationContext(bundle);
+ if (inv == null)
+ throw new IllegalStateException("Cannot get invocation context for: " + bundle);
- VirtualFile root = dep.getRoot();
- InterceptorContextImpl intContext = new InterceptorContextImpl(context, bundle, root, dep);
-
// Call the interceptor chain
for (LifecycleInterceptor aux : interceptorChain)
{
Set<Class<?>> input = aux.getInput();
+
boolean doInvocation = true;
if (input != null)
{
// Check if all required input is available
for (Class<?> clazz : input)
{
- if (dep.getAttachment(clazz) == null)
+ if (inv.getAttachment(clazz) == null)
{
doInvocation = false;
break;
}
}
}
- if (doInvocation)
+
+ if (doInvocation == true)
{
InterceptorWrapper wrapper = new InterceptorWrapper(aux);
String stateName = ConstantsHelper.bundleState(state);
- log.trace("Invoke: " + wrapper + " with state " + stateName + " on " + dep.getLocation());
- aux.invoke(state, intContext);
+ String location = inv.getBundle().getLocation();
+ log.trace("Invoke: " + wrapper + " with state " + stateName + " on " + location);
+ aux.invoke(state, inv);
}
}
}
}
/**
- * Get the deployment for the given bundle symbolic name and version
+ * Get the InvocationContext for the given bundle.
*/
- protected abstract Deployment getDeployment(BundleContext context, String symbolicName, Version version);
+ protected abstract InvocationContext getInvocationContext(Bundle bundle);
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/AttachmentSupport.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/AttachmentSupport.java 2009-10-26 14:30:20 UTC (rev 95564)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/AttachmentSupport.java 2009-10-26 14:32:42 UTC (rev 95565)
@@ -58,52 +58,52 @@
@SuppressWarnings("unchecked")
public <T> T getAttachment(Class<T> clazz)
{
- return (T)attachments.get(new Key(clazz, null));
+ return (T)attachments.get(new Key(null, clazz));
}
@SuppressWarnings("unchecked")
- public <T> T getAttachment(Class<T> clazz, String name)
+ public <T> T getAttachment(String name, Class<T> clazz)
{
- return (T)attachments.get(new Key(clazz, name));
+ return (T)attachments.get(new Key(name, clazz));
}
public Object getAttachment(String name)
{
- return attachments.get(new Key(null, name));
+ return attachments.get(new Key(name, null));
}
@SuppressWarnings("unchecked")
- public <T> T addAttachment(Class<T> clazz, Object obj)
+ public <T> T addAttachment(Class<T> clazz, T obj)
{
- return (T)attachments.put(new Key(clazz, null), obj);
+ return (T)attachments.put(new Key(null, clazz), obj);
}
@SuppressWarnings("unchecked")
- public <T> T addAttachment(Class<T> clazz, String name, Object obj)
+ public <T> T addAttachment(String name, T obj, Class<T> clazz)
{
- return (T)attachments.put(new Key(clazz, name), obj);
+ return (T)attachments.put(new Key(name, clazz), obj);
}
public Object addAttachment(String name, Object obj)
{
- return attachments.put(new Key(null, name), obj);
+ return attachments.put(new Key(name, null), obj);
}
@SuppressWarnings("unchecked")
public <T> T removeAttachment(Class<T> clazz)
{
- return (T)attachments.remove(new Key(clazz, null));
+ return (T)attachments.remove(new Key(null, clazz));
}
@SuppressWarnings("unchecked")
public <T> T removeAttachment(Class<T> clazz, String name)
{
- return (T)attachments.remove(new Key(clazz, name));
+ return (T)attachments.remove(new Key(name, clazz));
}
public Object removeAttachment(String name)
{
- return attachments.remove(new Key(null, name));
+ return attachments.remove(new Key(name, null));
}
public String toString()
Deleted: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InterceptorContextImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InterceptorContextImpl.java 2009-10-26 14:30:20 UTC (rev 95564)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InterceptorContextImpl.java 2009-10-26 14:32:42 UTC (rev 95565)
@@ -1,126 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.deployment.internal;
-
-//$Id$
-
-import java.util.Collection;
-
-import org.jboss.osgi.deployment.deployer.Attachments;
-import org.jboss.osgi.deployment.interceptor.InvocationContext;
-import org.jboss.virtual.VirtualFile;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * The context passed between Interceptors
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public class InterceptorContextImpl implements InvocationContext
-{
- private Attachments attachments;
- private BundleContext systemContext;
- private VirtualFile root;
- private Bundle bundle;
-
- public InterceptorContextImpl(BundleContext systemContext, Bundle bundle, VirtualFile root, Attachments attachments)
- {
- if (systemContext == null)
- throw new IllegalArgumentException("Null system context");
- if (bundle == null)
- throw new IllegalArgumentException("Null bundle");
- if (root == null)
- throw new IllegalArgumentException("Null root file");
-
- this.systemContext = systemContext;
- this.root = root;
- this.bundle = bundle;
- this.attachments = attachments;
- }
-
- public BundleContext getSystemContext()
- {
- return systemContext;
- }
-
- public Bundle getBundle()
- {
- return bundle;
- }
-
- public VirtualFile getRoot()
- {
- return root;
- }
-
- public <T> T addAttachment(Class<T> clazz, Object value)
- {
- return attachments.addAttachment(clazz, value);
- }
-
- public <T> T addAttachment(Class<T> clazz, String name, Object value)
- {
- return attachments.addAttachment(clazz, name, value);
- }
-
- public Object addAttachment(String name, Object value)
- {
- return attachments.addAttachment(name, value);
- }
-
- public <T> T getAttachment(Class<T> clazz, String name)
- {
- return attachments.getAttachment(clazz, name);
- }
-
- public <T> T getAttachment(Class<T> clazz)
- {
- return attachments.getAttachment(clazz);
- }
-
- public Object getAttachment(String name)
- {
- return attachments.getAttachment(name);
- }
-
- public Collection<Key> getAttachmentKeys()
- {
- return attachments.getAttachmentKeys();
- }
-
- public <T> T removeAttachment(Class<T> clazz, String name)
- {
- return attachments.removeAttachment(clazz, name);
- }
-
- public <T> T removeAttachment(Class<T> clazz)
- {
- return attachments.removeAttachment(clazz);
- }
-
- public Object removeAttachment(String name)
- {
- return attachments.removeAttachment(name);
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InterceptorWrapper.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InterceptorWrapper.java 2009-10-26 14:30:20 UTC (rev 95564)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InterceptorWrapper.java 2009-10-26 14:32:42 UTC (rev 95565)
@@ -77,7 +77,7 @@
{
input = new HashSet<String>();
for(Class<?> aux : getInput())
- input.add(getLastNameToken(aux.getClass()));
+ input.add(getLastNameToken(aux));
}
Set<String> output = null;
@@ -85,7 +85,7 @@
{
output = new HashSet<String>();
for(Class<?> aux : getOutput())
- output.add(getLastNameToken(aux.getClass()));
+ output.add(getLastNameToken(aux));
}
return "[" + classToken + ",order=" + getRelativeOrder() + ",input=" + input + ",output=" + output + "]";
Copied: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InvocationContextImpl.java (from rev 95556, projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InterceptorContextImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InvocationContextImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/InvocationContextImpl.java 2009-10-26 14:32:42 UTC (rev 95565)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.deployment.internal;
+
+//$Id$
+
+import java.util.Collection;
+
+import org.jboss.osgi.deployment.deployer.Attachments;
+import org.jboss.osgi.deployment.interceptor.InvocationContext;
+import org.jboss.virtual.VirtualFile;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The context passed between Interceptors
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-May-2009
+ */
+public class InvocationContextImpl implements InvocationContext
+{
+ private Attachments attachments;
+ private BundleContext systemContext;
+ private VirtualFile root;
+ private Bundle bundle;
+
+ public InvocationContextImpl(BundleContext systemContext, Bundle bundle, VirtualFile root, Attachments attachments)
+ {
+ if (systemContext == null)
+ throw new IllegalArgumentException("Null system context");
+ if (bundle == null)
+ throw new IllegalArgumentException("Null bundle");
+ if (root == null)
+ throw new IllegalArgumentException("Null root file");
+ if (attachments == null)
+ throw new IllegalArgumentException("Null attachments");
+
+ this.systemContext = systemContext;
+ this.root = root;
+ this.bundle = bundle;
+ this.attachments = attachments;
+ }
+
+ public BundleContext getSystemContext()
+ {
+ return systemContext;
+ }
+
+ public Bundle getBundle()
+ {
+ return bundle;
+ }
+
+ public VirtualFile getRoot()
+ {
+ return root;
+ }
+
+ public <T> T addAttachment(Class<T> clazz, T value)
+ {
+ return attachments.addAttachment(clazz, value);
+ }
+
+ public <T> T addAttachment(String name, T value, Class<T> clazz)
+ {
+ return attachments.addAttachment(name, value, clazz);
+ }
+
+ public Object addAttachment(String name, Object value)
+ {
+ return attachments.addAttachment(name, value);
+ }
+
+ public <T> T getAttachment(String name, Class<T> clazz)
+ {
+ return attachments.getAttachment(name, clazz);
+ }
+
+ public <T> T getAttachment(Class<T> clazz)
+ {
+ return attachments.getAttachment(clazz);
+ }
+
+ public Object getAttachment(String name)
+ {
+ return attachments.getAttachment(name);
+ }
+
+ public Collection<Key> getAttachmentKeys()
+ {
+ return attachments.getAttachmentKeys();
+ }
+
+ public <T> T removeAttachment(Class<T> clazz, String name)
+ {
+ return attachments.removeAttachment(clazz, name);
+ }
+
+ public <T> T removeAttachment(Class<T> clazz)
+ {
+ return attachments.removeAttachment(clazz);
+ }
+
+ public Object removeAttachment(String name)
+ {
+ return attachments.removeAttachment(name);
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java 2009-10-26 14:30:20 UTC (rev 95564)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java 2009-10-26 14:32:42 UTC (rev 95565)
@@ -28,10 +28,11 @@
import org.jboss.osgi.deployment.deployer.Deployment;
import org.jboss.osgi.deployment.deployer.DeploymentRegistryService;
import org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptorService;
+import org.jboss.osgi.deployment.interceptor.InvocationContext;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import org.osgi.framework.Version;
/**
* A basic service that manages bundle lifecycle interceptors.
@@ -53,14 +54,18 @@
}
@Override
- protected Deployment getDeployment(BundleContext context, String symbolicName, Version version)
+ protected InvocationContext getInvocationContext(Bundle bundle)
{
- DeploymentRegistryService service = getDeploymentRegistryService(context);
- return service.getDeployment(symbolicName, version);
+ DeploymentRegistryService service = getDeploymentRegistryService();
+ Deployment dep = service.getDeployment(bundle.getSymbolicName(), bundle.getVersion());
+ if (dep == null)
+ throw new IllegalStateException("Cannot get deployment for: " + bundle);
+ return new InvocationContextImpl(getSystemContext(), bundle, dep.getRoot(), dep);
}
- private DeploymentRegistryService getDeploymentRegistryService(BundleContext context)
+ private DeploymentRegistryService getDeploymentRegistryService()
{
+ BundleContext context = getSystemContext();
ServiceReference sref = context.getServiceReference(DeploymentRegistryService.class.getName());
if (sref == null)
throw new IllegalStateException("Cannot obtain deployment registry service");
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/InterceptorOrderTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/InterceptorOrderTestCase.java 2009-10-26 14:30:20 UTC (rev 95564)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/InterceptorOrderTestCase.java 2009-10-26 14:32:42 UTC (rev 95565)
@@ -59,7 +59,7 @@
};
// Add ordered
- LifecycleInterceptorServiceImpl service = new LifecycleInterceptorServiceImpl(null);
+ LifecycleInterceptorServiceImpl service = new LifecycleInterceptorServiceImpl(new MockBundleContext());
service.addInterceptor(rel0000);
service.addInterceptor(rel2000);
@@ -69,7 +69,7 @@
assertEquals(RELATIVE_ORDER, chain.get(1).getRelativeOrder());
// Add unordered
- service = new LifecycleInterceptorServiceImpl(null);
+ service = new LifecycleInterceptorServiceImpl(new MockBundleContext());
service.addInterceptor(rel2000);
service.addInterceptor(rel0000);
@@ -93,7 +93,7 @@
outA.addOutput(A.class);
// Add ordered
- LifecycleInterceptorServiceImpl service = new LifecycleInterceptorServiceImpl(null);
+ LifecycleInterceptorServiceImpl service = new LifecycleInterceptorServiceImpl(new MockBundleContext());
service.addInterceptor(outA);
service.addInterceptor(inA);
@@ -103,7 +103,7 @@
assertEquals(inA, chain.get(1));
// Add unordered
- service = new LifecycleInterceptorServiceImpl(null);
+ service = new LifecycleInterceptorServiceImpl(new MockBundleContext());
service.addInterceptor(inA);
service.addInterceptor(outA);
Added: projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/MockBundleContext.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/MockBundleContext.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/MockBundleContext.java 2009-10-26 14:32:42 UTC (rev 95565)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.deployment.interceptor;
+
+//$Id$
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.Dictionary;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.BundleListener;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkListener;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * A mock bundle context
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 26-Oct-2009
+ */
+class MockBundleContext implements BundleContext
+{
+ public void addBundleListener(BundleListener listener)
+ {
+ }
+
+ public void addFrameworkListener(FrameworkListener listener)
+ {
+ }
+
+ public void addServiceListener(ServiceListener listener)
+ {
+ }
+
+ public void addServiceListener(ServiceListener listener, String filter) throws InvalidSyntaxException
+ {
+ }
+
+ public Filter createFilter(String filter) throws InvalidSyntaxException
+ {
+ return null;
+ }
+
+ public ServiceReference[] getAllServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ {
+ return null;
+ }
+
+ public Bundle getBundle()
+ {
+ return null;
+ }
+
+ public Bundle getBundle(long id)
+ {
+ return null;
+ }
+
+ public Bundle[] getBundles()
+ {
+ return null;
+ }
+
+ public File getDataFile(String filename)
+ {
+ return null;
+ }
+
+ public String getProperty(String key)
+ {
+ return null;
+ }
+
+ public Object getService(ServiceReference reference)
+ {
+ return null;
+ }
+
+ public ServiceReference getServiceReference(String clazz)
+ {
+ return null;
+ }
+
+ public ServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ {
+ return null;
+ }
+
+ public Bundle installBundle(String location) throws BundleException
+ {
+ return null;
+ }
+
+ public Bundle installBundle(String location, InputStream input) throws BundleException
+ {
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public ServiceRegistration registerService(String[] clazzes, Object service, Dictionary properties)
+ {
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public ServiceRegistration registerService(String clazz, Object service, Dictionary properties)
+ {
+ return null;
+ }
+
+ public void removeBundleListener(BundleListener listener)
+ {
+ }
+
+ public void removeFrameworkListener(FrameworkListener listener)
+ {
+ }
+
+ public void removeServiceListener(ServiceListener listener)
+ {
+ }
+
+ public boolean ungetService(ServiceReference reference)
+ {
+ return false;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/MockBundleContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java 2009-10-26 14:30:20 UTC (rev 95564)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java 2009-10-26 14:32:42 UTC (rev 95565)
@@ -28,20 +28,19 @@
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.logging.Logger;
-import org.jboss.osgi.deployment.deployer.DeployerService;
-import org.jboss.osgi.deployment.deployer.Deployment;
import org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptorService;
+import org.jboss.osgi.deployment.interceptor.InvocationContext;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService;
+import org.jboss.osgi.deployment.internal.InvocationContextImpl;
import org.jboss.osgi.framework.bundle.OSGiBundleManager;
import org.jboss.osgi.framework.bundle.OSGiBundleState;
import org.jboss.osgi.framework.plugins.LifecycleInterceptorServicePlugin;
import org.jboss.osgi.framework.plugins.internal.AbstractServicePluginImpl;
+import org.jboss.osgi.framework.util.DeploymentUnitAttachments;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
-import org.osgi.framework.Version;
/**
* A plugin that manages bundle lifecycle interceptors.
@@ -68,22 +67,24 @@
BundleContext context = getSystemContext();
delegate = new AbstractLifecycleInterceptorService(context)
{
- protected Deployment getDeployment(BundleContext context, String name, Version version)
+ @Override
+ protected InvocationContext getInvocationContext(Bundle bundle)
{
- OSGiBundleState bundle = (OSGiBundleState)bundleManager.getBundle(name, version);
+ long bundleId = bundle.getBundleId();
+ OSGiBundleState bundleState = (OSGiBundleState)bundleManager.getBundleById(bundleId);
if (bundle == null)
- throw new IllegalStateException("Cannot obtain bundle for: " + name + "-" + version);
+ throw new IllegalStateException("Cannot obtain bundle for: " + bundle);
- VFSDeploymentUnit unit = (VFSDeploymentUnit)bundle.getDeploymentUnit();
- Deployment dep = unit.getAttachment(Deployment.class);
- if (dep == null)
+ VFSDeploymentUnit unit = (VFSDeploymentUnit)bundleState.getDeploymentUnit();
+ InvocationContext inv = unit.getAttachment(InvocationContext.class);
+ if (inv == null)
{
- ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
- DeployerService service = (DeployerService)context.getService(sref);
- dep = service.createDeployment(unit.getRoot());
- unit.addAttachment(Deployment.class, dep);
+ BundleContext context = bundleState.getBundleManager().getSystemContext();
+ DeploymentUnitAttachments att = new DeploymentUnitAttachments(unit);
+ inv = new InvocationContextImpl(context, bundle, unit.getRoot(), att);
+ unit.addAttachment(InvocationContext.class, inv);
}
- return dep;
+ return inv;
}
};
Added: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/util/DeploymentUnitAttachments.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/util/DeploymentUnitAttachments.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/util/DeploymentUnitAttachments.java 2009-10-26 14:32:42 UTC (rev 95565)
@@ -0,0 +1,107 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.framework.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.deployment.deployer.Attachments;
+
+/**
+ * An implementation of {@link Attachments} that delegates to a
+ * {@link DeploymentUnit}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 26-Oct-2009
+ */
+public class DeploymentUnitAttachments implements Attachments
+{
+ private DeploymentUnit delegate;
+
+ public DeploymentUnitAttachments(DeploymentUnit unit)
+ {
+ if (unit == null)
+ throw new IllegalArgumentException("Null unit");
+ this.delegate = unit;
+ }
+
+ public <T> T addAttachment(Class<T> clazz, T value)
+ {
+ return delegate.addAttachment(clazz, value);
+ }
+
+ public <T> T addAttachment(String name, T value, Class<T> clazz)
+ {
+ return delegate.addAttachment(name, value, clazz);
+ }
+
+ public Object addAttachment(String name, Object value)
+ {
+ return delegate.addAttachment(name, value);
+ }
+
+ public <T> T getAttachment(String name, Class<T> clazz)
+ {
+ return delegate.getAttachment(name, clazz);
+ }
+
+ public <T> T getAttachment(Class<T> clazz)
+ {
+ return delegate.getAttachment(clazz);
+ }
+
+ public Object getAttachment(String name)
+ {
+ return delegate.getAttachment(name);
+ }
+
+ public Collection<Key> getAttachmentKeys()
+ {
+ List<Key> keys = new ArrayList<Key>();
+ Set<String> keySet = delegate.getAttachments().keySet();
+ for(String key : keySet)
+ {
+ keys.add(new Key(key, null));
+ }
+ return Collections.unmodifiableList(keys);
+ }
+
+ public <T> T removeAttachment(Class<T> clazz, String name)
+ {
+ return delegate.removeAttachment(name, clazz);
+ }
+
+ public <T> T removeAttachment(Class<T> clazz)
+ {
+ return delegate.removeAttachment(clazz);
+ }
+
+ public Object removeAttachment(String name)
+ {
+ return delegate.removeAttachment(name);
+ }
+
+}
Property changes on: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/util/DeploymentUnitAttachments.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java 2009-10-26 14:30:20 UTC (rev 95564)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java 2009-10-26 14:32:42 UTC (rev 95565)
@@ -39,7 +39,7 @@
{
protected String getHttpResponse(String reqPath) throws Exception
{
- URL url = new URL("http://" + getServerHost() + ":8090/webapp" + reqPath);
+ URL url = new URL("http://" + getServerHost() + ":8090/example-webapp" + reqPath);
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
return br.readLine();
}
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF 2009-10-26 14:30:20 UTC (rev 95564)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF 2009-10-26 14:32:42 UTC (rev 95565)
@@ -3,5 +3,4 @@
Bundle-ManifestVersion: 2
Bundle-SymbolicName: example-webapp
Bundle-ClassPath: .,WEB-INF/classes
-Import-Package: javax.servlet,javax.servlet.http,org.osgi.service.http,org.ops4j.pax.web.service
-Webapp-Context: webapp
+Import-Package: javax.servlet,javax.servlet.http,org.osgi.service.http,org.ops4j.pax.web.service
\ No newline at end of file
16 years, 1 month
JBoss-OSGI SVN: r95564 - projects/jboss-osgi/projects/bundles/webapp/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-26 10:30:20 -0400 (Mon, 26 Oct 2009)
New Revision: 95564
Modified:
projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml
Log:
Use 0.7.2-SNAPSHOT
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml 2009-10-26 12:01:12 UTC (rev 95563)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml 2009-10-26 14:30:20 UTC (rev 95564)
@@ -40,7 +40,7 @@
<!-- Properties -->
<properties>
<version.jboss.osgi.deployment>0.0.1-SNAPSHOT</version.jboss.osgi.deployment>
- <version.ops4j.pax.web>0.7.2-20091021.163357-3</version.ops4j.pax.web>
+ <version.ops4j.pax.web>0.7.2-SNAPSHOT</version.ops4j.pax.web>
<version.osgi>4.2.0</version.osgi>
</properties>
16 years, 1 month
JBoss-OSGI SVN: r95563 - in projects/jboss-osgi/trunk: distribution/installer/src/main/resources/runtime/server/conf and 12 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-26 08:01:12 -0400 (Mon, 26 Oct 2009)
New Revision: 95563
Added:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/WebXMLVerifierInterceptor.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/AbstractLifecycleInterceptorService.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiDeployersWrapper.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/AbstractServicePluginImpl.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java
projects/jboss-osgi/trunk/testsuite/example/pom.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/processor/ParserInterceptor.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/processor/PublisherInterceptor.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppExtenderTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF
Log:
Add bootstrap support for lifecycle interceptors
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2009-10-26 12:01:12 UTC (rev 95563)
@@ -129,11 +129,23 @@
</bean>
<bean name="LifecycleInterceptorService" class="org.jboss.osgi.framework.service.internal.LifecycleInterceptorServiceImpl">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ <incallback method="addInterceptor" />
+ <uncallback method="removeInterceptor" />
</bean>
<!--
********************************
* *
+ * OSGi Interceptors *
+ * *
+ ********************************
+ -->
+
+ <bean name="WebXMLVerifier" class="org.jboss.osgi.framework.deployers.WebXMLVerifierInterceptor"/>
+
+ <!--
+ ********************************
+ * *
* OSGi Deployment *
* *
********************************
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2009-10-26 12:01:12 UTC (rev 95563)
@@ -121,11 +121,23 @@
</bean>
<bean name="LifecycleInterceptorService" class="org.jboss.osgi.framework.service.internal.LifecycleInterceptorServiceImpl">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ <incallback method="addInterceptor" />
+ <uncallback method="removeInterceptor" />
</bean>
<!--
********************************
* *
+ * OSGi Interceptors *
+ * *
+ ********************************
+ -->
+
+ <bean name="WebXMLVerifier" class="org.jboss.osgi.framework.deployers.WebXMLVerifierInterceptor"/>
+
+ <!--
+ ********************************
+ * *
* OSGi Deployment *
* *
********************************
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/AbstractLifecycleInterceptorService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/AbstractLifecycleInterceptorService.java 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/AbstractLifecycleInterceptorService.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -60,10 +60,12 @@
protected AbstractLifecycleInterceptorService(BundleContext context)
{
+ if (context == null)
+ throw new IllegalStateException("Null context");
this.context = context;
}
- public BundleContext getBundleContext()
+ public BundleContext getSystemContext()
{
return context;
}
@@ -219,7 +221,7 @@
String name = bundle.getSymbolicName();
Version version = bundle.getVersion();
- Deployment dep = getDeployment(name, version);
+ Deployment dep = getDeployment(getSystemContext(), name, version);
if (dep == null)
throw new IllegalStateException("Cannot get deployment for: " + name + "-" + version);
@@ -257,5 +259,5 @@
/**
* Get the deployment for the given bundle symbolic name and version
*/
- protected abstract Deployment getDeployment(String symbolicName, Version version);
+ protected abstract Deployment getDeployment(BundleContext context, String symbolicName, Version version);
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -45,7 +45,7 @@
{
super(context);
}
-
+
@Override
public List<LifecycleInterceptor> getInterceptorChain()
{
@@ -53,18 +53,18 @@
}
@Override
- protected Deployment getDeployment(String symbolicName, Version version)
+ protected Deployment getDeployment(BundleContext context, String symbolicName, Version version)
{
- DeploymentRegistryService service = getDeploymentRegistryService();
+ DeploymentRegistryService service = getDeploymentRegistryService(context);
return service.getDeployment(symbolicName, version);
}
- private DeploymentRegistryService getDeploymentRegistryService()
+ private DeploymentRegistryService getDeploymentRegistryService(BundleContext context)
{
- ServiceReference sref = getBundleContext().getServiceReference(DeploymentRegistryService.class.getName());
+ ServiceReference sref = context.getServiceReference(DeploymentRegistryService.class.getName());
if (sref == null)
throw new IllegalStateException("Cannot obtain deployment registry service");
- return (DeploymentRegistryService)getBundleContext().getService(sref);
+ return (DeploymentRegistryService)context.getService(sref);
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -676,7 +676,7 @@
*
* @return the system bundle context
*/
- public BundleContext getBundleContext()
+ public BundleContext getSystemContext()
{
return systemBundle.getBundleContext();
}
@@ -1142,7 +1142,7 @@
if (systemBundle.getState() != Bundle.STARTING)
initFramework();
- // Create the system bundl context
+ // Create the system bundle context
systemBundle.createBundleContext();
// Start registered service plugins
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiDeployersWrapper.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiDeployersWrapper.java 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiDeployersWrapper.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -85,7 +85,7 @@
{
if (packageAdmin == null)
{
- BundleContext sysContext = bundleManager.getBundleContext();
+ BundleContext sysContext = bundleManager.getSystemContext();
ServiceReference sref = sysContext.getServiceReference(PackageAdmin.class.getName());
if (sref == null)
throw new IllegalStateException("Cannot obtain PackageAdmin");
Added: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/WebXMLVerifierInterceptor.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/WebXMLVerifierInterceptor.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/WebXMLVerifierInterceptor.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.framework.deployers;
+
+//$Id$
+
+import org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptor;
+import org.jboss.osgi.deployment.interceptor.InvocationContext;
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorException;
+import org.jboss.virtual.VirtualFile;
+import org.osgi.framework.Bundle;
+
+/**
+ * The lifecycle interceptor that verifies that deployments ending in '.war'
+ * have a WEB-INF/web.xml descriptor.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 20-Oct-2009
+ */
+public class WebXMLVerifierInterceptor extends AbstractLifecycleInterceptor implements LifecycleInterceptor
+{
+ public void invoke(int state, InvocationContext context) throws LifecycleInterceptorException
+ {
+ if (state == Bundle.STARTING)
+ {
+ try
+ {
+ VirtualFile root = context.getRoot();
+ VirtualFile webXML = root.getChild("/WEB-INF/web.xml");
+ if (root.getName().endsWith(".war") && webXML == null)
+ {
+ throw new LifecycleInterceptorException("Cannot obtain web.xml from: " + root.toURL());
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new LifecycleInterceptorException("Cannot parse web.xml", ex);
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/WebXMLVerifierInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/AbstractServicePluginImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/AbstractServicePluginImpl.java 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/AbstractServicePluginImpl.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -42,6 +42,6 @@
public BundleContext getSystemContext()
{
- return bundleManager.getBundleContext();
+ return bundleManager.getSystemContext();
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -23,6 +23,9 @@
//$Id$
+import java.util.HashSet;
+import java.util.Set;
+
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.logging.Logger;
import org.jboss.osgi.deployment.deployer.DeployerService;
@@ -51,20 +54,21 @@
// Provide logging
final Logger log = Logger.getLogger(LifecycleInterceptorServiceImpl.class);
+ private Set<LifecycleInterceptor> bootstrapInterceptors = new HashSet<LifecycleInterceptor>();
private AbstractLifecycleInterceptorService delegate;
private ServiceRegistration registration;
- public LifecycleInterceptorServiceImpl(OSGiBundleManager bundleManager)
+ public LifecycleInterceptorServiceImpl(final OSGiBundleManager bundleManager)
{
super(bundleManager);
}
public void startService()
{
- final BundleContext context = getSystemContext();
+ BundleContext context = getSystemContext();
delegate = new AbstractLifecycleInterceptorService(context)
{
- protected Deployment getDeployment(String name, Version version)
+ protected Deployment getDeployment(BundleContext context, String name, Version version)
{
OSGiBundleState bundle = (OSGiBundleState)bundleManager.getBundle(name, version);
if (bundle == null)
@@ -82,6 +86,11 @@
return dep;
}
};
+
+ // Add bootstrap interceptors
+ for (LifecycleInterceptor aux : bootstrapInterceptors)
+ addInterceptor(aux);
+
registration = context.registerService(LifecycleInterceptorService.class.getName(), delegate, null);
}
@@ -97,8 +106,14 @@
public void addInterceptor(LifecycleInterceptor interceptor)
{
- if (delegate != null)
+ if (delegate == null)
+ {
+ bootstrapInterceptors.add(interceptor);
+ }
+ else
+ {
delegate.addInterceptor(interceptor);
+ }
}
public void removeInterceptor(LifecycleInterceptor interceptor)
Modified: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-10-26 12:01:12 UTC (rev 95563)
@@ -241,6 +241,7 @@
<!-- https://issues.apache.org/jira/browse/FELIX-1804 -->
<exclude>org/jboss/test/osgi/example/interceptor/**</exclude>
+ <exclude>org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.class</exclude>
<exclude>org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.class</exclude>
</excludes>
</configuration>
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-10-26 12:01:12 UTC (rev 95563)
@@ -76,6 +76,15 @@
<include name="message.txt"/>
</fileset>
</war>
+ <jar destfile="${tests.output.dir}/test-libs/example-webapp-negative.war"
+ manifest="${tests.resources.dir}/webapp/MANIFEST.MF">
+ <zipfileset dir="${tests.classes.dir}" prefix="WEB-INF/classes">
+ <include name="**/example/webapp/bundle/*.class"/>
+ </zipfileset>
+ <fileset dir="${tests.resources.dir}/webapp">
+ <include name="message.txt"/>
+ </fileset>
+ </jar>
<!-- xml/jaxb -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-xml-jaxb.jar" files="${tests.resources.dir}/xml/jaxb/example-xml-jaxb.bnd" />
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/processor/ParserInterceptor.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/processor/ParserInterceptor.java 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/processor/ParserInterceptor.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -51,7 +51,7 @@
addOutput(HttpMetadata.class);
}
- public void invoke(int state, InvocationContext context) throws LifecycleInterceptorException
+ public void invoke(int state, InvocationContext context)
{
// Do nothing if the metadata is already available
HttpMetadata metadata = context.getAttachment(HttpMetadata.class);
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/processor/PublisherInterceptor.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/processor/PublisherInterceptor.java 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/processor/PublisherInterceptor.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -52,12 +52,12 @@
addInput(HttpMetadata.class);
}
- public void invoke(int state, InvocationContext context) throws LifecycleInterceptorException
+ public void invoke(int state, InvocationContext context)
{
// HttpMetadata is guaratied to be available because we registered
// this type as required input
HttpMetadata metadata = context.getAttachment(HttpMetadata.class);
-
+
// Register HttpMetadata on STARTING
if (state == Bundle.STARTING)
{
@@ -72,7 +72,8 @@
HttpServlet servlet = (HttpServlet)servletClass.newInstance();
// Register the servlet with the HttpService
- getHttpService(context).registerServlet("/servlet", servlet, null, null);
+ HttpService httpService = getHttpService(context, true);
+ httpService.registerServlet("/servlet", servlet, null, null);
}
catch (RuntimeException rte)
{
@@ -88,15 +89,17 @@
else if (state == Bundle.STOPPING)
{
log.info("Unpublish HttpMetadata: " + metadata);
- getHttpService(context).unregister("/servlet");
+ HttpService httpService = getHttpService(context, false);
+ if (httpService != null)
+ httpService.unregister("/servlet");
}
}
- private HttpService getHttpService(InvocationContext context)
+ private HttpService getHttpService(InvocationContext context, boolean required)
{
BundleContext syscontext = context.getSystemContext();
ServiceReference sref = syscontext.getServiceReference(HttpService.class.getName());
- if (sref == null)
+ if (sref == null && required == true)
throw new IllegalStateException("Required HttpService not available");
HttpService httpService = (HttpService)syscontext.getService(sref);
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.webapp;
+
+// $Id$
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import org.jboss.osgi.testing.OSGiTest;
+
+/**
+ * A test that deployes a WAR bundle
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 06-Oct-2009
+ */
+public abstract class AbstractWebAppTestCase extends OSGiTest
+{
+ protected String getHttpResponse(String reqPath) throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8090/webapp" + reqPath);
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ return br.readLine();
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppExtenderTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppExtenderTestCase.java 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppExtenderTestCase.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -25,14 +25,10 @@
import static org.junit.Assert.assertEquals;
-import java.io.BufferedReader;
import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
import org.jboss.osgi.spi.capability.HttpServiceCapability;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
import org.jboss.osgi.testing.OSGiTestHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -44,7 +40,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Oct-2009
*/
-public class WebAppExtenderTestCase extends OSGiTest
+public class WebAppExtenderTestCase extends AbstractWebAppTestCase
{
private static OSGiRuntime runtime;
@@ -92,30 +88,28 @@
// Due to the nature of asynchronous event processing by the
// extender pattern, we cannot assume that the endpoint is
// available immediately
- private String getHttpResponse(String reqPath) throws Exception
+ protected String getHttpResponse(String reqPath) throws Exception
{
+ int timeout = 25;
String line = null;
IOException lastException = null;
- URL url = new URL("http://" + runtime.getServerHost() + ":8090/example-webapp" + reqPath);
-
- int timeout = 25;
while (line == null && 0 < timeout--)
{
- Thread.sleep(200);
try
{
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- line = br.readLine();
+ line = super.getHttpResponse(reqPath);
}
catch (IOException ex)
{
lastException = ex;
}
+ if (line == null)
+ Thread.sleep(200);
}
-
+
if (line == null && lastException != null)
throw lastException;
-
+
return line;
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.java 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -25,13 +25,8 @@
import static org.junit.Assert.assertEquals;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
import org.jboss.osgi.testing.OSGiTestHelper;
import org.jboss.osgi.webapp.WebAppCapability;
import org.junit.AfterClass;
@@ -44,7 +39,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Oct-2009
*/
-public class WebAppInterceptorTestCase extends OSGiTest
+public class WebAppInterceptorTestCase extends AbstractWebAppTestCase
{
private static OSGiRuntime runtime;
@@ -87,11 +82,4 @@
String line = getHttpResponse("/servlet?test=initProp");
assertEquals("initProp=SomeValue", line);
}
-
- private String getHttpResponse(String reqPath) throws Exception
- {
- URL url = new URL("http://" + runtime.getServerHost() + ":8090/example-webapp" + reqPath);
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- return br.readLine();
- }
}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java 2009-10-26 12:01:12 UTC (rev 95563)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.webapp;
+
+// $Id$
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorException;
+import org.jboss.osgi.testing.OSGiBundle;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.webapp.WebAppCapability;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.BundleException;
+
+/**
+ * A test that deployes a WAR bundle that contains no WEB-INF/web.xml
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 26-Oct-2009
+ */
+public class WebAppNegativeTestCase extends AbstractWebAppTestCase
+{
+ private static OSGiRuntime runtime;
+
+ @BeforeClass
+ public static void setUpClass() throws Exception
+ {
+ OSGiTestHelper osgiTestHelper = new OSGiTestHelper();
+
+ runtime = osgiTestHelper.getDefaultRuntime();
+ runtime.addCapability(new WebAppCapability());
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ runtime.shutdown();
+ runtime = null;
+ }
+
+ @Test
+ public void testServletAccess() throws Exception
+ {
+ OSGiBundle bundle = runtime.installBundle("example-webapp-negative.war");
+ try
+ {
+ bundle.start();
+ fail("BundleException expected");
+ }
+ catch (BundleException ex)
+ {
+ Throwable cause = ex.getCause();
+ assertTrue(cause instanceof LifecycleInterceptorException);
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-26 12:01:12 UTC (rev 95563)
@@ -105,11 +105,23 @@
</bean>
<bean name="LifecycleInterceptorService" class="org.jboss.osgi.framework.service.internal.LifecycleInterceptorServiceImpl">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ <incallback method="addInterceptor" />
+ <uncallback method="removeInterceptor" />
</bean>
<!--
********************************
* *
+ * OSGi Interceptors *
+ * *
+ ********************************
+ -->
+
+ <bean name="WebXMLVerifier" class="org.jboss.osgi.framework.deployers.WebXMLVerifierInterceptor"/>
+
+ <!--
+ ********************************
+ * *
* OSGi Deployment *
* *
********************************
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF 2009-10-26 12:00:08 UTC (rev 95562)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF 2009-10-26 12:01:12 UTC (rev 95563)
@@ -4,4 +4,4 @@
Bundle-SymbolicName: example-webapp
Bundle-ClassPath: .,WEB-INF/classes
Import-Package: javax.servlet,javax.servlet.http,org.osgi.service.http,org.ops4j.pax.web.service
-
+Webapp-Context: webapp
16 years, 1 month
JBoss-OSGI SVN: r95562 - in projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org: ops4j/pax/web/extender/war/internal and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-26 08:00:08 -0400 (Mon, 26 Oct 2009)
New Revision: 95562
Modified:
projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppActivator.java
projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java
projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebXMLParserInterceptor.java
projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/ops4j/pax/web/extender/war/internal/WebAppPublisherExt.java
Log:
Supply system context as start param
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppActivator.java 2009-10-26 08:17:25 UTC (rev 95561)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppActivator.java 2009-10-26 12:00:08 UTC (rev 95562)
@@ -46,13 +46,13 @@
context.registerService(WebAppService.class.getName(), service, null);
// Register the web.xml parser interceptor
- webappParserInterceptor = new WebXMLParserInterceptor(context);
- webappParserInterceptor.start();
+ webappParserInterceptor = new WebXMLParserInterceptor();
+ webappParserInterceptor.start(context);
// Register the WebApp publisher interceptor
- WebAppPublisherExt publisher = new WebAppPublisherExt(context);
- webappPublishInterceptor = new WebAppPublisherInterceptor(context, publisher);
- webappPublishInterceptor.start();
+ WebAppPublisherExt publisher = new WebAppPublisherExt();
+ webappPublishInterceptor = new WebAppPublisherInterceptor(publisher);
+ webappPublishInterceptor.start(context);
}
public void stop(BundleContext context)
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java 2009-10-26 08:17:25 UTC (rev 95561)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java 2009-10-26 12:00:08 UTC (rev 95562)
@@ -48,20 +48,18 @@
// Provide logging
private Logger log = LoggerFactory.getLogger(WebAppPublisherInterceptor.class);
- private BundleContext context;
private ServiceTracker serviceTracker;
private WebAppPublisherExt publisher;
- public WebAppPublisherInterceptor(BundleContext context, WebAppPublisherExt publisher)
+ public WebAppPublisherInterceptor(WebAppPublisherExt publisher)
{
- this.context = context;
this.publisher = publisher;
// Add the required input
addInput(WebApp.class);
}
- public void start()
+ public void start(BundleContext context)
{
final LifecycleInterceptor interceptor = this;
serviceTracker = new ServiceTracker(context, LifecycleInterceptorService.class.getName(), null)
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebXMLParserInterceptor.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebXMLParserInterceptor.java 2009-10-26 08:17:25 UTC (rev 95561)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebXMLParserInterceptor.java 2009-10-26 12:00:08 UTC (rev 95562)
@@ -51,18 +51,15 @@
// Provide logging
private Logger log = LoggerFactory.getLogger(WebXMLParserInterceptor.class);
- private BundleContext context;
private ServiceTracker serviceTracker;
- public WebXMLParserInterceptor(BundleContext context)
+ public WebXMLParserInterceptor()
{
- this.context = context;
-
// Advertise output
addOutput(WebApp.class);
}
- public void start()
+ public void start(BundleContext context)
{
final LifecycleInterceptor interceptor = this;
serviceTracker = new ServiceTracker(context, LifecycleInterceptorService.class.getName(), null)
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/ops4j/pax/web/extender/war/internal/WebAppPublisherExt.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/ops4j/pax/web/extender/war/internal/WebAppPublisherExt.java 2009-10-26 08:17:25 UTC (rev 95561)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/ops4j/pax/web/extender/war/internal/WebAppPublisherExt.java 2009-10-26 12:00:08 UTC (rev 95562)
@@ -38,16 +38,8 @@
*/
public class WebAppPublisherExt extends WebAppPublisher
{
- private BundleContext context;
-
- public WebAppPublisherExt(BundleContext context)
+ public void publish(BundleContext context, WebApp webapp)
{
- this.context = context;
- }
-
- @Override
- public void publish(WebApp webapp)
- {
// Gracefully wait 5000ms for the WebContainer to become available
int timeout = 25;
ServiceReference sref = null;
16 years, 1 month
JBoss-OSGI SVN: r95560 - projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-26 04:10:14 -0400 (Mon, 26 Oct 2009)
New Revision: 95560
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml
Log:
Fix outdated import of deployment.common
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml 2009-10-26 08:09:31 UTC (rev 95559)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml 2009-10-26 08:10:14 UTC (rev 95560)
@@ -34,7 +34,6 @@
org.apache.log4j;version=1.2,
<!-- jboss-osgi -->
- org.jboss.osgi.deployment.common,
org.jboss.osgi.deployment.deployer,
org.jboss.osgi.deployment.interceptor,
org.jboss.osgi.jbossxb;version=2.0,
16 years, 1 month
JBoss-OSGI SVN: r95559 - projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-26 04:09:31 -0400 (Mon, 26 Oct 2009)
New Revision: 95559
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties
Log:
Fix outdated import of deployment.common
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties 2009-10-26 08:06:36 UTC (rev 95558)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties 2009-10-26 08:09:31 UTC (rev 95559)
@@ -30,7 +30,6 @@
org.apache.log4j;version=1.2, \
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.deployment.common, \
org.jboss.osgi.deployment.deployer, \
org.jboss.osgi.deployment.interceptor, \
org.jboss.osgi.spi;version=1.0, \
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties 2009-10-26 08:06:36 UTC (rev 95558)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties 2009-10-26 08:09:31 UTC (rev 95559)
@@ -24,7 +24,6 @@
org.apache.log4j;version=1.2, \
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.deployment.common, \
org.jboss.osgi.deployment.deployer, \
org.jboss.osgi.deployment.interceptor, \
org.jboss.osgi.spi;version=1.0, \
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties 2009-10-26 08:06:36 UTC (rev 95558)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties 2009-10-26 08:09:31 UTC (rev 95559)
@@ -10,7 +10,6 @@
org.osgi.framework.system.packages.extra=\
org.apache.log4j;version=1.2, \
org.jboss.logging, \
- org.jboss.osgi.deployment.common, \
org.jboss.osgi.deployment.deployer, \
org.jboss.osgi.deployment.interceptor, \
org.jboss.osgi.spi;version=1.0, \
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties 2009-10-26 08:06:36 UTC (rev 95558)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties 2009-10-26 08:09:31 UTC (rev 95559)
@@ -30,7 +30,6 @@
org.apache.log4j;version=1.2, \
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.deployment.common, \
org.jboss.osgi.deployment.deployer, \
org.jboss.osgi.deployment.interceptor, \
org.jboss.osgi.spi;version=1.0, \
16 years, 1 month