You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2009/07/24 19:06:44 UTC

svn commit: r797561 [3/9] - in /felix/trunk: org.osgi.compendium/ org.osgi.compendium/src/main/java/info/dmtree/ org.osgi.compendium/src/main/java/info/dmtree/notification/ org.osgi.compendium/src/main/java/info/dmtree/notification/spi/ org.osgi.compen...

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/CollectionMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/CollectionMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/CollectionMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/CollectionMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+import java.util.List;
+
+/**
+ * Metadata for a collection based value. Values of the collection are defined
+ * by Metadata objects. This Collection Metadata can constrain the values of the
+ * collection to a specific type.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+
+public interface CollectionMetadata extends NonNullMetadata {
+
+	/**
+	 * Return the type of the collection.
+	 * 
+	 * The possible types are: array (<code>Object[]</code>), <code>Set</code>,
+	 * and <code>List</code>. This information is specified in the element name.
+	 * 
+	 * @return The type of the collection. <code>Object[]</code> is returned to
+	 *         indicate an array.
+	 */
+	Class/* <?> */getCollectionClass();
+
+	/**
+	 * Return the type specified for the values of the collection.
+	 * 
+	 * The <code>value-type</code> attribute specified this information.
+	 * 
+	 * @return The type specified for the values of the collection.
+	 */
+	String getValueType();
+
+	/**
+	 * Return Metadata for the values of the collection.
+	 * 
+	 * @return A List of Metadata for the values of the collection.
+	 */
+	List /* <Metadata> */getValues();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+import java.util.List;
+
+/**
+ * Metadata for managed components. This is the base type for
+ * {@link BeanMetadata}, {@link ServiceMetadata} and
+ * {@link ServiceReferenceMetadata}.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface ComponentMetadata extends NonNullMetadata {
+
+	/**
+	 * The component's manager must eagerly activate the component.
+	 * 
+	 * @see #getActivation()
+	 */
+	static final int	ACTIVATION_EAGER	= 1;
+
+	/**
+	 * The component's manager must lazily activate the component.
+	 * 
+	 * @see #getActivation()
+	 */
+	static final int	ACTIVATION_LAZY		= 2;
+
+	/**
+	 * Return the id of the component.
+	 * 
+	 * @return The id of the component. The component id can be
+	 *         <code>null</code> if this is an anonymously defined and/or
+	 *         inlined component.
+	 */
+	String getId();
+
+	/**
+	 * Return the activation strategy for the component.
+	 * 
+	 * This is specified by the <code>activation</code> attribute of a component
+	 * definition. If this is not set, then the <code>default-activation</code>
+	 * in the <code>blueprint</code> element is used. If that is also not set,
+	 * then the activation strategy is {@link #ACTIVATION_EAGER}.
+	 * 
+	 * @return The activation strategy for the component.
+	 * @see #ACTIVATION_EAGER
+	 * @see #ACTIVATION_LAZY
+	 */
+	int getActivation();
+
+	/**
+	 * Return the ids of any components listed in a <code>depends-on</code>
+	 * attribute for the component.
+	 * 
+	 * @return An immutable List of component ids that are explicitly declared
+	 *         as a dependency, or an empty List if none.
+	 */
+	List/* <String> */getDependsOn();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/IdRefMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/IdRefMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/IdRefMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/IdRefMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+/**
+ * Metadata for the verified id of another component managed by the Blueprint
+ * Container. The id itself will be injected, not the component to which the id
+ * refers. No implicit dependency is created.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface IdRefMetadata extends NonNullMetadata {
+	/**
+	 * Return the id of the referenced component.
+	 * 
+	 * This is specified by the <code>component-id</code> attribute of a
+	 * component.
+	 * 
+	 * @return The id of the referenced component.
+	 */
+	String getComponentId();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/MapEntry.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/MapEntry.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/MapEntry.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/MapEntry.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+/**
+ * Metadata for a map entry.
+ * 
+ * This type is used by {@link MapMetadata}, {@link PropsMetadata} and
+ * {@link ServiceMetadata}.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface MapEntry {
+	/**
+	 * Return the Metadata for the key of the map entry.
+	 * 
+	 * This is specified by the <code>key</code> attribute or element.
+	 * 
+	 * @return The Metadata for the key of the map entry. This must not be
+	 *         <code>null</code>.
+	 */
+	NonNullMetadata getKey();
+
+	/**
+	 * Return the Metadata for the value of the map entry.
+	 * 
+	 * This is specified by the <code>value</code> attribute or element.
+	 * 
+	 * @return The Metadata for the value of the map entry. This must not be
+	 *         <code>null</code>.
+	 */
+	Metadata getValue();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/MapMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/MapMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/MapMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/MapMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+import java.util.List;
+
+/**
+ * Metadata for a Map based value.
+ * 
+ * <p>
+ * This is specified by the <code>map</code> element.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface MapMetadata extends NonNullMetadata {
+	/**
+	 * Return the name of the type of the map keys.
+	 * 
+	 * This is specified by the <code>key-type</code> attribute of the map.
+	 * 
+	 * @return The name of the type of the map keys, or <code>null</code> if
+	 *         none is specified.
+	 */
+	String getKeyType();
+
+	/**
+	 * Return the name of the type of the map values.
+	 * 
+	 * This is specified by the <code>value-type</code> attribute of the map.
+	 * 
+	 * @return The name of the type of the map values, or <code>null</code> if
+	 *         none is specified.
+	 */
+	String getValueType();
+
+	/**
+	 * Return the entries for the map.
+	 * 
+	 * @return An immutable List of {@link MapEntry} objects for each entry in
+	 *         the map. The List is empty if no entries are specified for the
+	 *         map.
+	 */
+	List /* <MapEntry> */getEntries();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/Metadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/Metadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/Metadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/Metadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,26 @@
+/*
+ * 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.service.blueprint.reflect;
+
+/**
+ * Top level Metadata type. All Metdata types extends this base type.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface Metadata {
+	// marker interface
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/NonNullMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/NonNullMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/NonNullMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/NonNullMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+/**
+ * Metadata for a value that cannot <code>null</code>. All Metadata subtypes
+ * extend this type except for {@link NullMetadata}.
+ * 
+ * <p>
+ * This Metadata type is used for keys in Maps because they cannot be
+ * <code>null</code>.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface NonNullMetadata extends Metadata {
+	// marker interface
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/NullMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/NullMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/NullMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/NullMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+/**
+ * Metadata for a value specified to be <code>null</code> via the &lt;null&gt;
+ * element.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface NullMetadata extends Metadata {
+
+	/**
+	 * Singleton instance of <code>NullMetadata</code>.
+	 */
+	static final NullMetadata	NULL	= new NullMetadata() {
+											// empty body
+										};
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/PropsMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/PropsMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/PropsMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/PropsMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+import java.util.List;
+
+/**
+ * Metadata for a <code>java.util.Properties</code> based value.
+ * 
+ * <p>
+ * The {@link MapEntry} objects of properties are defined with keys and values
+ * of type <code>String</code>.
+ * 
+ * <p>
+ * This is specified by the <code>props</code> element.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7564 $
+ */
+public interface PropsMetadata extends NonNullMetadata {
+
+	/**
+	 * Return the entries for the properties.
+	 * 
+	 * @return An immutable List of {@link MapEntry} objects for each entry in
+	 *         the properties. The List is empty if no entries are specified for
+	 *         the properties.
+	 */
+	List/* <MapEntry> */getEntries();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+/**
+ * Metadata for a reference to another component managed by the Blueprint
+ * Container.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface RefMetadata extends Target, NonNullMetadata {
+	/**
+	 * Return the id of the referenced component.
+	 * 
+	 * This is specified by the <code>component-id</code> attribute of a
+	 * component.
+	 * 
+	 * @return The id of the referenced component.
+	 */
+	String getComponentId();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+/**
+ * Metadata for a list of service references.
+ * 
+ * <p>
+ * This is specified by the <code>reference-list</code> element.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface ReferenceListMetadata extends ServiceReferenceMetadata {
+
+	/**
+	 * Reference list values must be proxies to the actual service objects.
+	 * 
+	 * @see #getMemberType()
+	 */
+	 static final int	USE_SERVICE_OBJECT		= 1;
+
+	/**
+	 * Reference list values must be <code>ServiceReference</code> objects.
+	 * 
+	 * @see #getMemberType()
+	 */
+	 static final int	USE_SERVICE_REFERENCE	= 2;
+
+	/**
+	 * Return whether the List will contain service object proxies or
+	 * <code>ServiceReference</code> objects.
+	 * 
+	 * This is specified by the <code>member-type</code> attribute of the
+	 * reference list.
+	 * 
+	 * @return Whether the List will contain service object proxies or
+	 *         <code>ServiceReference</code> objects.
+	 * @see #USE_SERVICE_OBJECT
+	 * @see #USE_SERVICE_REFERENCE
+	 */
+	int getMemberType();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListener.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListener.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListener.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListener.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+/**
+ * Metadata for a reference listener interested in the reference bind and unbind
+ * events for a service reference.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface ReferenceListener {
+
+	/**
+	 * Return the Metadata for the component that will receive bind and unbind
+	 * events.
+	 * 
+	 * This is specified by the <code>ref</code> attribute or via an inlined
+	 * component.
+	 * 
+	 * @return The Metadata for the component that will receive bind and unbind
+	 *         events.
+	 */
+	Target getListenerComponent();
+
+	/**
+	 * Return the name of the bind method. The bind method will be invoked when
+	 * a matching service is bound to the reference.
+	 * 
+	 * This is specified by the <code>bind-method</code> attribute of the
+	 * reference listener.
+	 * 
+	 * @return The name of the bind method.
+	 */
+	String getBindMethod();
+
+	/**
+	 * Return the name of the unbind method. The unbind method will be invoked
+	 * when a matching service is unbound from the reference.
+	 * 
+	 * This is specified by the <code>unbind-method</code> attribute of the
+	 * reference listener.
+	 * 
+	 * @return The name of the unbind method.
+	 */
+	String getUnbindMethod();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ReferenceMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ReferenceMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ReferenceMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ReferenceMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+/**
+ * Metadata for a reference that will bind to a single matching service in the
+ * service registry.
+ * 
+ * <p>
+ * This is specified by the <code>reference</code> element.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface ReferenceMetadata extends Target, ServiceReferenceMetadata {
+
+	/**
+	 * Return the timeout for service invocations when a backing service is is
+	 * unavailable.
+	 * 
+	 * This is specified by the <code>timeout</code> attribute of the reference.
+	 * 
+	 * @return The timeout, in milliseconds, for service invocations when a
+	 *         backing service is is unavailable.
+	 */
+	long getTimeout();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListener.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListener.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListener.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListener.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+/**
+ * Metadata for a registration listener interested in service registration and
+ * unregistration events for a service.
+ * 
+ * <p>
+ * The registration listener is called with the initial state of the service
+ * when the registration listener is actuated.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface RegistrationListener {
+
+	/**
+	 * Return the Metadata for the component that will receive registration and
+	 * unregistration events.
+	 * 
+	 * This is specified by the <code>ref</code> attribute or via an inlined
+	 * component.
+	 * 
+	 * @return The Metadata for the component that will receive registration and
+	 *         unregistration events.
+	 */
+	Target getListenerComponent();
+
+	/**
+	 * Return the name of the registration method. The registration method will
+	 * be invoked when the associated service is registered with the service
+	 * registry.
+	 * 
+	 * This is specified by the <code>registration-method</code> attribute of
+	 * the registration listener.
+	 * 
+	 * @return The name of the registration method.
+	 */
+	String getRegistrationMethod();
+
+	/**
+	 * Return the name of the unregistration method. The unregistration method
+	 * will be invoked when the associated service is unregistered from the
+	 * service registry.
+	 * 
+	 * This is specified by the <code>unregistration-method</code> attribute of
+	 * the registration listener.
+	 * 
+	 * @return The name of the unregistration method.
+	 */
+	String getUnregistrationMethod();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ServiceMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ServiceMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ServiceMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ServiceMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Metadata for a service to be registered by the Blueprint Container when
+ * enabled.
+ * 
+ * <p>
+ * This is specified by the <code>service</code> element.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface ServiceMetadata extends ComponentMetadata {
+
+	/**
+	 * Do not auto-detect types for advertised service interfaces
+	 * 
+	 * @see #getAutoExport()
+	 */
+	static final int		AUTO_EXPORT_DISABLED		= 1;
+
+	/**
+	 * Advertise all Java interfaces implemented by the component instance type
+	 * as service interfaces.
+	 * 
+	 * @see #getAutoExport()
+	 */
+	static final int		AUTO_EXPORT_INTERFACES		= 2;
+
+	/**
+	 * Advertise all Java classes in the hierarchy of the component instance
+	 * type as service interfaces.
+	 * 
+	 * @see #getAutoExport()
+	 */
+	static final int		AUTO_EXPORT_CLASS_HIERARCHY	= 3;
+
+	/**
+	 * Advertise all Java classes and interfaces in the component instance type
+	 * as service interfaces.
+	 * 
+	 * @see #getAutoExport()
+	 */
+	static final int	AUTO_EXPORT_ALL_CLASSES		= 4;
+
+	/**
+	 * Return the Metadata for the component to be exported as a service.
+	 * 
+	 * This is specified inline or via the <code>ref</code> attribute of the
+	 * service.
+	 * 
+	 * @return The Metadata for the component to be exported as a service.
+	 */
+	Target getServiceComponent();
+
+	/**
+	 * Return the type names of the interfaces that the service should be
+	 * advertised as supporting.
+	 * 
+	 * This is specified in the <code>interface</code> attribute or child
+	 * <code>interfaces</code> element of the service.
+	 * 
+	 * @return An immutable List of <code>String</code> for the type names of
+	 *         the interfaces that the service should be advertised as
+	 *         supporting. The List is empty if using <code>auto-export</code>
+	 *         or no interface names are specified for the service.
+	 */
+	List/* <String> */getInterfaces();
+
+	/**
+	 * Return the auto-export mode for the service.
+	 * 
+	 * This is specified by the <code>auto-export</code> attribute of the
+	 * service.
+	 * 
+	 * @return The auto-export mode for the service.
+	 * @see #AUTO_EXPORT_DISABLED
+	 * @see #AUTO_EXPORT_INTERFACES
+	 * @see #AUTO_EXPORT_CLASS_HIERARCHY
+	 * @see #AUTO_EXPORT_ALL_CLASSES
+	 */
+	int getAutoExport();
+
+	/**
+	 * Return the user declared properties to be advertised with the service.
+	 * 
+	 * This is specified by the <code>service-properties</code> element of the
+	 * service.
+	 * 
+	 * @return An immutable List of {@link MapEntry} objects for the user
+	 *         declared properties to be advertised with the service. The List
+	 *         is empty if no service properties are specified for the service.
+	 */
+	List/* <MapEntry> */getServiceProperties();
+
+	/**
+	 * Return the ranking value to use when advertising the service. If the
+	 * ranking value is zero, the service must be registered without a
+	 * <code>service.ranking</code> service property.
+	 * 
+	 * This is specified by the <code>ranking</code> attribute of the service.
+	 * 
+	 * @return The ranking value to use when advertising the service.
+	 */
+	int getRanking();
+
+	/**
+	 * Return the registration listeners to be notified when the service is
+	 * registered and unregistered with the framework.
+	 * 
+	 * This is specified by the <code>registration-listener</code> elements of
+	 * the service.
+	 * 
+	 * @return An immutable Collection of {@link RegistrationListener} objects
+	 *         to be notified when the service is registered and unregistered
+	 *         with the framework. The Collection is empty if no registration
+	 *         listeners are specified for the service.
+	 */
+	Collection /* <RegistrationListener> */getRegistrationListeners();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+import java.util.Collection;
+
+/**
+ * Metadata for a reference to an OSGi service. This is the base type for
+ * {@link ReferenceListMetadata} and {@link ReferenceMetadata}.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface ServiceReferenceMetadata extends ComponentMetadata {
+
+	/**
+	 * A matching service is required at all times.
+	 * 
+	 * @see #getAvailability()
+	 */
+	static final int	AVAILABILITY_MANDATORY	= 1;
+
+	/**
+	 * A matching service is not required to be present.
+	 * 
+	 * @see #getAvailability()
+	 */
+	static final int	AVAILABILITY_OPTIONAL	= 2;
+
+	/**
+	 * Return whether or not a matching service is required at all times.
+	 * 
+	 * This is specified in the <code>availability</code> attribute of the
+	 * service reference.
+	 * 
+	 * @return Whether or not a matching service is required at all times.
+	 * @see #AVAILABILITY_MANDATORY
+	 * @see #AVAILABILITY_OPTIONAL
+	 */
+	int getAvailability();
+
+	/**
+	 * Return the name of the interface type that a matching service must
+	 * support.
+	 * 
+	 * This is specified in the <code>interface</code> attribute of the service
+	 * reference.
+	 * 
+	 * @return The name of the interface type that a matching service must
+	 *         support or <code>null</code> when no interface name is specified.
+	 */
+	String getInterface();
+
+	/**
+	 * Return the value of the <code>component-name</code> attribute of the
+	 * service reference. This specifies the id of a component that is
+	 * registered in the service registry. This will create an automatic filter,
+	 * appended with the filter if set, to select this component based on its
+	 * automatic <code>id</code> attribute.
+	 * 
+	 * @return The value of the <code>component-name</code> attribute of the
+	 *         service reference or <code>null</code> if the attribute is not
+	 *         specified.
+	 */
+	String getComponentName();
+
+	/**
+	 * Return the filter expression that a matching service must match.
+	 * 
+	 * This is specified by the <code>filter</code> attribute of the service
+	 * reference.
+	 * 
+	 * @return The filter expression that a matching service must match or
+	 *         <code>null</code> if a filter is not specified.
+	 */
+	String getFilter();
+
+	/**
+	 * Return the reference listeners to receive bind and unbind events.
+	 * 
+	 * This is specified by the <code>reference-listener</code> elements of the
+	 * service reference.
+	 * 
+	 * @return An immutable Collection of {@link ReferenceListener} objects to
+	 *         receive bind and unbind events. The Collection is empty if no
+	 *         reference listeners are specified for the service reference.
+	 */
+	Collection /* <ReferenceListener> */getReferenceListeners();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/Target.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/Target.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/Target.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/Target.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+/**
+ * A common interface for managed components that can be used as a direct target
+ * for method calls. These are <code>bean</code>, <code>reference</code>, and
+ * <code>ref</code>, where the <code>ref</code> must refer to a bean or
+ * reference component.
+ * 
+ * @see BeanMetadata
+ * @see ReferenceMetadata
+ * @see RefMetadata
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface Target extends NonNullMetadata {
+	// marker interface
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ValueMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ValueMetadata.java?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ValueMetadata.java (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/ValueMetadata.java Fri Jul 24 17:06:37 2009
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 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.service.blueprint.reflect;
+
+/**
+ * Metadata for a simple <code>String</code> value that will be type-converted
+ * if necessary before injecting.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 7563 $
+ */
+public interface ValueMetadata extends NonNullMetadata {
+	/**
+	 * Return the unconverted string representation of the value.
+	 * 
+	 * This is specified by the <code>value</code> attribute or text part of the
+	 * <code>value</code> element.
+	 * 
+	 * @return The unconverted string representation of the value.
+	 */
+	String getStringValue();
+
+	/**
+	 * Return the name of the type to which the value should be converted.
+	 * 
+	 * This is specified by the <code>type</code> attribute.
+	 * 
+	 * @return The name of the type to which the value should be converted or
+	 *         <code>null</code> if no type is specified.
+	 */
+	String getType();
+}

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/package.html
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/package.html?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/package.html (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/package.html Fri Jul 24 17:06:37 2009
@@ -0,0 +1,14 @@
+<!-- $Revision: 7556 $ -->
+<BODY>
+<p>Blueprint Reflection Package Version 1.0.
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:
+<pre>
+Import-Package: org.osgi.service.blueprint.reflect; version=&quot;[1.0,2.0)&quot;
+</pre>
+<p> This package provides a reflection-based view of the configuration information for a
+	Blueprint Container.
+</p>
+</BODY>
+

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/packageinfo
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/packageinfo?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/packageinfo (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/blueprint/reflect/packageinfo Fri Jul 24 17:06:37 2009
@@ -0,0 +1 @@
+version 1.0

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/Configuration.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/Configuration.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/Configuration.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/Configuration.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.cm/src/org/osgi/service/cm/Configuration.java,v 1.17 2006/06/16 16:31:28 hargrave Exp $
- *
- * Copyright (c) OSGi Alliance (2001, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2001, 2008). 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.
@@ -60,7 +58,7 @@
  * Managed Service Factory and a Managed Service. When it is important to
  * differentiate between these two the term "factory configuration" is used.
  * 
- * @version $Revision: 1.17 $
+ * @version $Revision: 5673 $
  */
 public interface Configuration {
 	/**
@@ -109,7 +107,7 @@
 	 * callback is delayed until aforementioned registration occurs.
 	 * 
 	 * <p>
-	 * Also intiates an asynchronous call to all
+	 * Also initiates an asynchronous call to all
 	 * <code>ConfigurationListener</code>s with a
 	 * <code>ConfigurationEvent.CM_UPDATED</code> event.
 	 * 
@@ -133,7 +131,7 @@
 	 * call to its <code>deleted</code> method.
 	 * 
 	 * <p>
-	 * Also intiates an asynchronous call to all
+	 * Also initiates an asynchronous call to all
 	 * <code>ConfigurationListener</code>s with a
 	 * <code>ConfigurationEvent.CM_DELETED</code> event.
 	 * 
@@ -160,7 +158,7 @@
 	 * 
 	 * <p>
 	 * This is the only way for a bundle that uses a Configuration Plugin
-	 * service to initate a callback. For example, when that bundle detects a
+	 * service to initiate a callback. For example, when that bundle detects a
 	 * change that requires an update of the Managed Service or Managed Service
 	 * Factory via its <code>ConfigurationPlugin</code> object.
 	 * 

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationAdmin.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationAdmin.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationAdmin.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationAdmin.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.cm/src/org/osgi/service/cm/ConfigurationAdmin.java,v 1.17 2006/09/26 13:33:09 hargrave Exp $
- *
- * Copyright (c) OSGi Alliance (2001, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2001, 2008). 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.
@@ -50,27 +48,28 @@
  * <p>
  * Bundles that require configuration should register a Managed Service or a
  * Managed Service Factory in the service registry. A registration property
- * named <code>service.pid</code> (persistent identifier or PID) must be used
- * to identify this Managed Service or Managed Service Factory to the
- * Configuration Admin service.
+ * named <code>service.pid</code> (persistent identifier or PID) must be used to
+ * identify this Managed Service or Managed Service Factory to the Configuration
+ * Admin service.
  * 
  * <p>
  * When the ConfigurationAdmin detects the registration of a Managed Service, it
- * checks its persistent storage for a configuration object whose PID matches
- * the PID registration property (<code>service.pid</code>) of the Managed
- * Service. If found, it calls {@link ManagedService#updated} method with the
- * new properties. The implementation of a Configuration Admin service must run
- * these call-backs asynchronously to allow proper synchronization.
+ * checks its persistent storage for a configuration object whose
+ * <code>service.pid</code> property matches the PID service property (
+ * <code>service.pid</code>) of the Managed Service. If found, it calls
+ * {@link ManagedService#updated} method with the new properties. The
+ * implementation of a Configuration Admin service must run these call-backs
+ * asynchronously to allow proper synchronization.
  * 
  * <p>
  * When the Configuration Admin service detects a Managed Service Factory
  * registration, it checks its storage for configuration objects whose
- * <code>factoryPid</code> matches the PID of the Managed Service Factory. For
- * each such <code>Configuration</code> objects, it calls the
- * <code>ManagedServiceFactory.updated</code> method asynchronously with the
- * new properties. The calls to the <code>updated</code> method of a
- * <code>ManagedServiceFactory</code> must be executed sequentially and not
- * overlap in time.
+ * <code>service.factoryPid</code> property matches the PID service property of
+ * the Managed Service Factory. For each such <code>Configuration</code>
+ * objects, it calls the <code>ManagedServiceFactory.updated</code> method
+ * asynchronously with the new properties. The calls to the <code>updated</code>
+ * method of a <code>ManagedServiceFactory</code> must be executed sequentially
+ * and not overlap in time.
  * 
  * <p>
  * In general, bundles having permission to use the Configuration Admin service
@@ -79,16 +78,16 @@
  * <code>ConfigurationPermission[*,CONFIGURE]</code>.
  * 
  * <p>
- * <code>Configuration</code> objects can be <i>bound </i> to a specified
- * bundle location. In this case, if a matching Managed Service or Managed
- * Service Factory is registered by a bundle with a different location, then the
+ * <code>Configuration</code> objects can be <i>bound </i> to a specified bundle
+ * location. In this case, if a matching Managed Service or Managed Service
+ * Factory is registered by a bundle with a different location, then the
  * Configuration Admin service must not do the normal callback, and it should
  * log an error. In the case where a <code>Configuration</code> object is not
  * bound, its location field is <code>null</code>, the Configuration Admin
  * service will bind it to the location of the bundle that registers the first
  * Managed Service or Managed Service Factory that has a corresponding PID
  * property. When a <code>Configuration</code> object is bound to a bundle
- * location in this manner, the Confguration Admin service must detect if the
+ * location in this manner, the Configuration Admin service must detect if the
  * bundle corresponding to the location is uninstalled. If this occurs, the
  * <code>Configuration</code> object is unbound, that is its location field is
  * set back to <code>null</code>.
@@ -100,20 +99,20 @@
  * <code>ConfigurationAdmin</code> must use a
  * {@link org.osgi.framework.ServiceFactory} to support this concept.
  * 
- * @version $Revision: 1.17 $
+ * @version $Revision: 7356 $
  */
 public interface ConfigurationAdmin {
 	/**
-	 * Service property naming the Factory PID in the configuration dictionary.
-	 * The property's value is of type <code>String</code>.
+	 * Configuration property naming the Factory PID in the configuration
+	 * dictionary. The property's value is of type <code>String</code>.
 	 * 
 	 * @since 1.1
 	 */
 	public final static String	SERVICE_FACTORYPID		= "service.factoryPid";
 	/**
-	 * Service property naming the location of the bundle that is associated
-	 * with a a <code>Configuration</code> object. This property can be
-	 * searched for but must not appear in the configuration dictionary for
+	 * Configuration property naming the location of the bundle that is
+	 * associated with a a <code>Configuration</code> object. This property can
+	 * be searched for but must not appear in the configuration dictionary for
 	 * security reason. The property's value is of type <code>String</code>.
 	 * 
 	 * @since 1.1
@@ -226,26 +225,26 @@
 	 * 
 	 * <p>
 	 * Normally only <code>Configuration</code> objects that are bound to the
-	 * location of the calling bundle are returned, or all if the caller has 
+	 * location of the calling bundle are returned, or all if the caller has
 	 * <code>ConfigurationPermission[*,CONFIGURE]</code>.
 	 * 
 	 * <p>
-	 * The syntax of the filter string is as defined in the {@link org.osgi.framework.Filter}
-	 * class. The filter can test any configuration parameters including the
-	 * following system properties:
+	 * The syntax of the filter string is as defined in the
+	 * {@link org.osgi.framework.Filter} class. The filter can test any
+	 * configuration properties including the following:
 	 * <ul>
-	 * <li><code>service.pid</code>-<code>String</code>- the PID under
-	 * which this is registered</li>
-	 * <li><code>service.factoryPid</code>-<code>String</code>- the
-	 * factory if applicable</li>
-	 * <li><code>service.bundleLocation</code>-<code>String</code>- the
-	 * bundle location</li>
+	 * <li><code>service.pid</code>-<code>String</code>- the PID under which
+	 * this is registered</li>
+	 * <li><code>service.factoryPid</code>-<code>String</code>- the factory if
+	 * applicable</li>
+	 * <li><code>service.bundleLocation</code>-<code>String</code>- the bundle
+	 * location</li>
 	 * </ul>
 	 * The filter can also be <code>null</code>, meaning that all
 	 * <code>Configuration</code> objects should be returned.
 	 * 
-	 * @param filter A filter string, or <code>null</code> to
-	 *        retrieve all <code>Configuration</code> objects.
+	 * @param filter A filter string, or <code>null</code> to retrieve all
+	 *        <code>Configuration</code> objects.
 	 * @return All matching <code>Configuration</code> objects, or
 	 *         <code>null</code> if there aren't any.
 	 * @throws IOException if access to persistent storage fails

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationEvent.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationEvent.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationEvent.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationEvent.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.cm/src/org/osgi/service/cm/ConfigurationEvent.java,v 1.9 2006/06/16 16:31:28 hargrave Exp $
- * 
- * Copyright (c) OSGi Alliance (2004, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2004, 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.
@@ -17,6 +15,8 @@
  */
 package org.osgi.service.cm;
 
+import java.util.Dictionary;
+
 import org.osgi.framework.ServiceReference;
 
 /**
@@ -46,7 +46,7 @@
  * 
  * @see ConfigurationListener
  * 
- * @version $Revision: 1.9 $
+ * @version $Revision: 6180 $
  * @since 1.2
  */
 public class ConfigurationEvent {
@@ -57,7 +57,7 @@
 	 * This <code>ConfigurationEvent</code> type that indicates that a
 	 * <code>Configuration</code> object has been updated with new properties.
 	 * 
-	 * An event is fired when a call to <code>Configuration.update</code>
+	 * An event is fired when a call to {@link Configuration#update(Dictionary)}
 	 * successfully changes a configuration.
 	 * 
 	 * <p>
@@ -71,7 +71,7 @@
 	 * This <code>ConfigurationEvent</code> type that indicates that a
 	 * <code>Configuration</code> object has been deleted.
 	 * 
-	 * An event is fired when a call to <code>Configuration.delete</code>
+	 * An event is fired when a call to {@link Configuration#delete()}
 	 * successfully deletes a configuration.
 	 * 
 	 * <p>
@@ -116,6 +116,9 @@
 		this.type = type;
 		this.factoryPid = factoryPid;
 		this.pid = pid;
+		if ((reference == null) || (pid == null)) {
+			throw new NullPointerException("reference and pid must not be null");
+		}
 	}
 
 	/**

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationException.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationException.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationException.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationException.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.cm/src/org/osgi/service/cm/ConfigurationException.java,v 1.13 2006/07/11 13:15:52 hargrave Exp $
- *
- * Copyright (c) OSGi Alliance (2001, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2001, 2008). 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.
@@ -21,7 +19,7 @@
  * An <code>Exception</code> class to inform the Configuration Admin service
  * of problems with configuration data.
  * 
- * @version $Revision: 1.13 $
+ * @version $Revision: 6083 $
  */
 public class ConfigurationException extends Exception {
 	static final long	serialVersionUID	= -1690090413441769377L;
@@ -30,11 +28,6 @@
 	private final String		reason;
 
 	/**
-	 * Nested exception.
-	 */
-	private final Throwable	cause;
-
-	/**
 	 * Create a <code>ConfigurationException</code> object.
 	 * 
 	 * @param property name of the property that caused the problem,
@@ -45,7 +38,6 @@
 		super(property + " : " + reason);
 		this.property = property;
 		this.reason = reason;
-		this.cause = null;
 	}
 
 	/**
@@ -59,10 +51,9 @@
 	 */
 	public ConfigurationException(String property, String reason,
 			Throwable cause) {
-		super(property + " : " + reason);
+		super(property + " : " + reason, cause);
 		this.property = property;
 		this.reason = reason;
-		this.cause = cause;
 	}
 
 	/**
@@ -83,30 +74,31 @@
 	public String getReason() {
 		return reason;
 	}
-
+	
 	/**
-	 * Returns the cause of this exception or <code>null</code> if no cause
-	 * was specified when this exception was created.
+	 * Returns the cause of this exception or <code>null</code> if no cause was
+	 * set.
 	 * 
-	 * @return The cause of this exception or <code>null</code> if no cause
-	 *         was specified.
+	 * @return The cause of this exception or <code>null</code> if no cause was
+	 *         set.
 	 * @since 1.2
 	 */
 	public Throwable getCause() {
-		return cause;
+		return super.getCause();
 	}
 
 	/**
-	 * The cause of this exception can only be set when constructed.
+	 * Initializes the cause of this exception to the specified value.
 	 * 
-	 * @param cause Cause of the exception.
-	 * @return This object.
-	 * @throws java.lang.IllegalStateException This method will always throw an
-	 *         <code>IllegalStateException</code> since the cause of this
-	 *         exception can only be set when constructed.
+	 * @param cause The cause of this exception.
+	 * @return This exception.
+	 * @throws IllegalArgumentException If the specified cause is this
+	 *         exception.
+	 * @throws IllegalStateException If the cause of this exception has already
+	 *         been set.
 	 * @since 1.2
 	 */
 	public Throwable initCause(Throwable cause) {
-		throw new IllegalStateException();
+		return super.initCause(cause);
 	}
 }

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationListener.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationListener.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationListener.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationListener.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.cm/src/org/osgi/service/cm/ConfigurationListener.java,v 1.10 2006/06/16 16:31:28 hargrave Exp $
- * 
- * Copyright (c) OSGi Alliance (2004, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2004, 2008). 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.
@@ -37,7 +35,7 @@
  * require <code>ServicePermission[ConfigurationListener,REGISTER]</code> to
  * register a <code>ConfigurationListener</code> service.
  * 
- * @version $Revision: 1.10 $
+ * @version $Revision: 5673 $
  * @since 1.2
  */
 public interface ConfigurationListener {

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationPermission.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationPermission.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationPermission.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationPermission.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.cm/src/org/osgi/service/cm/ConfigurationPermission.java,v 1.22 2006/07/08 00:42:00 hargrave Exp $
- * 
- * Copyright (c) OSGi Alliance (2004, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2004, 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.
@@ -18,7 +16,9 @@
 
 package org.osgi.service.cm;
 
-import java.security.*;
+import java.security.BasicPermission;
+import java.security.Permission;
+import java.security.PermissionCollection;
 import java.util.Enumeration;
 import java.util.NoSuchElementException;
 
@@ -27,7 +27,8 @@
  * 
  * This permission has only a single action: CONFIGURE.
  * 
- * @version $Revision: 1.22 $
+ * @ThreadSafe
+ * @version $Revision: 6381 $
  * @since 1.2
  */
 
@@ -92,7 +93,9 @@
 	 */
 
 	public int hashCode() {
-		return getName().hashCode() ^ getActions().hashCode();
+		int h = 31 * 17 + getName().hashCode();
+		h = 31 * h + getActions().hashCode();
+		return h;
 	}
 
 	/**
@@ -135,7 +138,7 @@
 	 * 
 	 * @serial
 	 */
-	private boolean		hasElement;
+	private volatile boolean	hasElement;
 
 	/**
 	 * Creates an empty <tt>ConfigurationPermissionCollection</tt> object.
@@ -214,5 +217,4 @@
 			}
 		};
 	}
-
 }

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationPlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationPlugin.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationPlugin.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ConfigurationPlugin.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.cm/src/org/osgi/service/cm/ConfigurationPlugin.java,v 1.11 2006/06/16 16:31:28 hargrave Exp $
- *
- * Copyright (c) OSGi Alliance (2001, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2001, 2008). 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.
@@ -34,7 +32,7 @@
  * <code>ManagedServiceFactory</code>
  * <code>updated</code> method. The
  * Configuration Plugin service thus has the opportunity to view and modify the
- * properties before they are passed to the ManagedS ervice or Managed Service
+ * properties before they are passed to the Managed Service or Managed Service
  * Factory.
  * 
  * <p>
@@ -71,12 +69,12 @@
  * A plugin may optionally specify a <code>cm.target</code> registration
  * property whose value is the PID of the Managed Service or Managed Service
  * Factory whose configuration updates the plugin is intended to intercept. The
- * plugin will then only be called with configuration updates that are targetted
+ * plugin will then only be called with configuration updates that are targeted
  * at the Managed Service or Managed Service Factory with the specified PID.
  * Omitting the <code>cm.target</code> registration property means that the
  * plugin is called for all configuration updates.
  * 
- * @version $Revision: 1.11 $
+ * @version $Revision: 5673 $
  */
 public interface ConfigurationPlugin {
 	/**

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ManagedService.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ManagedService.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ManagedService.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ManagedService.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.cm/src/org/osgi/service/cm/ManagedService.java,v 1.12 2006/06/16 16:31:28 hargrave Exp $
- *
- * Copyright (c) OSGi Alliance (2001, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2001, 2008). 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.
@@ -26,7 +24,7 @@
  * <p>
  * A Managed Service is a service that needs configuration data. Such an object
  * should be registered with the Framework registry with the
- * <code>service.pid</code> property set to some unique identitifier called a
+ * <code>service.pid</code> property set to some unique identifier called a
  * PID.
  * 
  * <p>
@@ -107,7 +105,7 @@
  * registration properties. This will allow the Configuration Admin service to
  * set properties on services which can then be used by other applications.
  * 
- * @version $Revision: 1.12 $
+ * @version $Revision: 5673 $
  */
 public interface ManagedService {
 	/**

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ManagedServiceFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ManagedServiceFactory.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ManagedServiceFactory.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/ManagedServiceFactory.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.cm/src/org/osgi/service/cm/ManagedServiceFactory.java,v 1.12 2006/07/11 00:54:03 hargrave Exp $
- *
- * Copyright (c) OSGi Alliance (2001, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2001, 2008). 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.
@@ -94,7 +92,7 @@
  *   
  * </pre>
  * 
- * @version $Revision: 1.12 $
+ * @version $Revision: 5673 $
  */
 public interface ManagedServiceFactory {
 	/**

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/package.html
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/package.html?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/package.html (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/package.html Fri Jul 24 17:06:37 2009
@@ -0,0 +1,11 @@
+<!-- $Revision: 7356 $ -->
+<BODY>
+<p>Configuration Admin Package Version 1.3.
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:
+<pre>
+Import-Package: org.osgi.service.cm; version=&quot;[1.3,2.0)&quot;
+</pre>
+</BODY>
+

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/packageinfo
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/packageinfo?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/packageinfo (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/cm/packageinfo Fri Jul 24 17:06:37 2009
@@ -0,0 +1 @@
+version 1.3

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentConstants.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentConstants.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentConstants.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentConstants.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.component/src/org/osgi/service/component/ComponentConstants.java,v 1.14 2006/06/16 16:31:26 hargrave Exp $
- * 
- * Copyright (c) OSGi Alliance (2004, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2004, 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.
@@ -21,13 +19,12 @@
 /**
  * Defines standard names for Service Component constants.
  * 
- * @version $Revision: 1.14 $
+ * @version $Revision: 6454 $
  */
 public interface ComponentConstants {
 	/**
-	 * Manifest header (named &quot;Service-Component&quot;) specifying the XML
-	 * documents within a bundle that contain the bundle's Service Component
-	 * descriptions.
+	 * Manifest header specifying the XML documents within a bundle that contain
+	 * the bundle's Service Component descriptions.
 	 * <p>
 	 * The attribute value may be retrieved from the <code>Dictionary</code>
 	 * object returned by the <code>Bundle.getHeaders</code> method.
@@ -37,14 +34,15 @@
 	/**
 	 * A component property for a component configuration that contains the name
 	 * of the component as specified in the <code>name</code> attribute of the
-	 * <code>component</code> element. The type of this property must be
-	 * <code>String</code>.
+	 * <code>component</code> element. The value of this property must be of
+	 * type <code>String</code>.
 	 */
 	public final static String	COMPONENT_NAME			= "component.name";
 
 	/**
 	 * A component property that contains the generated id for a component
-	 * configuration. The type of this property must be <code>Long</code>.
+	 * configuration. The value of this property must be of type
+	 * <code>Long</code>.
 	 * 
 	 * <p>
 	 * The value of this property is assigned by the Service Component Runtime
@@ -57,15 +55,64 @@
 
 	/**
 	 * A service registration property for a Component Factory that contains the
-	 * value of the <code>factory</code> attribute. The type of this property
-	 * must be <code>String</code>.
+	 * value of the <code>factory</code> attribute. The value of this property
+	 * must be of type <code>String</code>.
 	 */
 	public final static String	COMPONENT_FACTORY		= "component.factory";
 
 	/**
 	 * The suffix for reference target properties. These properties contain the
-	 * filter to select the target services for a reference. The type of this
-	 * property must be <code>String</code>.
+	 * filter to select the target services for a reference. The value of this
+	 * property must be of type <code>String</code>.
 	 */
 	public final static String	REFERENCE_TARGET_SUFFIX	= ".target";
+	
+	/**
+	 * The reason the component configuration was deactivated is unspecified.
+	 *  
+	 * @since 1.1
+	 */
+	public static final int DEACTIVATION_REASON_UNSPECIFIED = 0;
+	
+	/**
+	 * The component configuration was deactivated because the component was disabled.
+	 *  
+	 * @since 1.1
+	 */
+	public static final int DEACTIVATION_REASON_DISABLED = 1;
+	
+	/**
+	 * The component configuration was deactivated because a reference became unsatisfied.
+	 *  
+	 * @since 1.1
+	 */
+	public static final int DEACTIVATION_REASON_REFERENCE = 2;
+	
+	/**
+	 * The component configuration was deactivated because its configuration was changed.
+	 *  
+	 * @since 1.1
+	 */
+	public static final int DEACTIVATION_REASON_CONFIGURATION_MODIFIED = 3;
+	
+	/**
+	 * The component configuration was deactivated because its configuration was deleted.
+	 *  
+	 * @since 1.1
+	 */
+	public static final int DEACTIVATION_REASON_CONFIGURATION_DELETED = 4;
+	
+	/**
+	 * The component configuration was deactivated because the component was disposed.
+	 *  
+	 * @since 1.1
+	 */
+	public static final int DEACTIVATION_REASON_DISPOSED = 5;
+
+	/**
+	 * The component configuration was deactivated because the bundle was stopped.
+	 *  
+	 * @since 1.1
+	 */
+	public static final int DEACTIVATION_REASON_BUNDLE_STOPPED = 6;
 }

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentContext.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentContext.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentContext.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentContext.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.component/src/org/osgi/service/component/ComponentContext.java,v 1.20 2006/06/16 16:31:26 hargrave Exp $
- *
- * Copyright (c) OSGi Alliance (2004, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2004, 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.
@@ -20,7 +18,9 @@
 
 import java.util.Dictionary;
 
-import org.osgi.framework.*;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
 
 /**
  * A Component Context object is used by a component instance to interact with
@@ -28,38 +28,31 @@
  * component instance has a unique Component Context.
  * 
  * <p>
- * A component's implementation class may optionaly implement an activate
- * method:
- * 
- * <pre>
- * protected void activate(ComponentContext context);
- * </pre>
- * 
- * If a component implements this method, this method will be called when a
- * component configuration is activated to provide the component instance's
- * Component Context object.
- * 
- * <p>
- * A component's implementation class may optionaly implement a deactivate
- * method:
- * 
- * <pre>
- * protected void deactivate(ComponentContext context);
- * </pre>
- * 
- * If a component implements this method, this method will be called when the
- * component configuration is deactivated.
+ * A component instance may have an activate method. If a component instance has
+ * a suitable and accessible activate method, this method will be called when a
+ * component configuration is activated. If the activate method takes a
+ * <code>ComponentContext</code> argument, it will be passed the component
+ * instance's Component Context object. If the activate method takes a
+ * <code>BundleContext</code> argument, it will be passed the component
+ * instance's Bundle Context object. If the activate method takes a
+ * <code>Map</code> argument, it will be passed an unmodifiable Map containing
+ * the component properties.
  * 
  * <p>
- * The activate and deactivate methods will be called using reflection and must
- * be protected or public accessible. These methods should not be public methods
- * so that they do not appear as public methods on the component instance when
- * used as a service object. These methods will be located by looking through
- * the component's implementation class hierarchy for the first declaration of
- * the method. If the method is found, if it is declared protected or public,
- * the method will be called. Otherwise, the method will not be called.
+ * A component instance may have a deactivate method. If a component instance
+ * has a suitable and accessible deactivate method, this method will be called
+ * when the component configuration is deactivated. If the deactivate method
+ * takes a <code>ComponentContext</code> argument, it will be passed the
+ * component instance's Component Context object. If the deactivate method takes
+ * a <code>BundleContext</code> argument, it will be passed the component
+ * instance's Bundle Context object. If the deactivate method takes a
+ * <code>Map</code> argument, it will be passed an unmodifiable Map containing
+ * the component properties. If the deactivate method takes an <code>int</code>
+ * or <code>Integer</code> argument, it will be passed the reason code for the
+ * component instance's deactivation.
  * 
- * @version $Revision: 1.20 $
+ * @ThreadSafe
+ * @version $Revision: 6462 $
  */
 public interface ComponentContext {
 	/**
@@ -77,10 +70,10 @@
 	 * If the cardinality of the reference is <code>0..n</code> or
 	 * <code>1..n</code> and multiple services are bound to the reference, the
 	 * service with the highest ranking (as specified in its
-	 * <code>Constants.SERVICE_RANKING</code> property) is returned. If there
-	 * is a tie in ranking, the service with the lowest service ID (as specified
-	 * in its <code>Constants.SERVICE_ID</code> property); that is, the
-	 * service that was registered first is returned.
+	 * <code>Constants.SERVICE_RANKING</code> property) is returned. If there is
+	 * a tie in ranking, the service with the lowest service ID (as specified in
+	 * its <code>Constants.SERVICE_ID</code> property); that is, the service
+	 * that was registered first is returned.
 	 * 
 	 * @param name The name of a reference as specified in a
 	 *        <code>reference</code> element in this component's description.
@@ -117,16 +110,18 @@
 	 *        <code>reference</code> element in this component's description.
 	 * @return An array of service objects for the referenced service or
 	 *         <code>null</code> if the reference cardinality is
-	 *         <code>0..1</code> or <code>0..n</code> and no bound service
-	 *         is available.
+	 *         <code>0..1</code> or <code>0..n</code> and no bound service is
+	 *         available. If the reference cardinality is <code>0..1</code> or
+	 *         <code>1..1</code> and a bound service is available, the array
+	 *         will have exactly one element.
 	 * @throws ComponentException If the Service Component Runtime catches an
 	 *         exception while activating a bound service.
 	 */
 	public Object[] locateServices(String name);
 
 	/**
-	 * Returns the <code>BundleContext</code> of the bundle which contains
-	 * this component.
+	 * Returns the <code>BundleContext</code> of the bundle which contains this
+	 * component.
 	 * 
 	 * @return The <code>BundleContext</code> of the bundle containing this
 	 *         component.
@@ -135,20 +130,19 @@
 
 	/**
 	 * If the component instance is registered as a service using the
-	 * <code>servicefactory=&quot;true&quot;</code> attribute, then this
-	 * method returns the bundle using the service provided by the component
-	 * instance.
+	 * <code>servicefactory=&quot;true&quot;</code> attribute, then this method
+	 * returns the bundle using the service provided by the component instance.
 	 * <p>
 	 * This method will return <code>null</code> if:
 	 * <ul>
 	 * <li>The component instance is not a service, then no bundle can be using
 	 * it as a service.
 	 * <li>The component instance is a service but did not specify the
-	 * <code>servicefactory=&quot;true&quot;</code> attribute, then all
-	 * bundles using the service provided by the component instance will share
-	 * the same component instance.
-	 * <li>The service provided by the component instance is not currently
-	 * being used by any bundle.
+	 * <code>servicefactory=&quot;true&quot;</code> attribute, then all bundles
+	 * using the service provided by the component instance will share the same
+	 * component instance.
+	 * <li>The service provided by the component instance is not currently being
+	 * used by any bundle.
 	 * </ul>
 	 * 
 	 * @return The bundle using the component instance as a service or
@@ -168,8 +162,8 @@
 	 * Enables the specified component name. The specified component name must
 	 * be in the same bundle as this component.
 	 * 
-	 * @param name The name of a component or <code>null</code> to indicate
-	 *        all components in the bundle.
+	 * @param name The name of a component or <code>null</code> to indicate all
+	 *        components in the bundle.
 	 */
 	public void enableComponent(String name);
 
@@ -194,5 +188,4 @@
 	 *         registered as a service.
 	 */
 	public ServiceReference getServiceReference();
-
 }

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentException.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentException.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentException.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentException.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.component/src/org/osgi/service/component/ComponentException.java,v 1.13 2006/07/11 13:15:56 hargrave Exp $
- * 
- * Copyright (c) OSGi Alliance (2004, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2004, 2008). 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.
@@ -21,14 +19,10 @@
 /**
  * Unchecked exception which may be thrown by the Service Component Runtime.
  * 
- * @version $Revision: 1.13 $
+ * @version $Revision: 6083 $
  */
 public class ComponentException extends RuntimeException {
 	static final long	serialVersionUID	= -7438212656298726924L;
-	/**
-	 * Nested exception.
-	 */
-	private final Throwable	cause;
 
 	/**
 	 * Construct a new ComponentException with the specified message and cause.
@@ -37,8 +31,7 @@
 	 * @param cause The cause of the exception. May be <code>null</code>.
 	 */
 	public ComponentException(String message, Throwable cause) {
-		super(message);
-		this.cause = cause;
+		super(message, cause);
 	}
 
 	/**
@@ -48,7 +41,6 @@
 	 */
 	public ComponentException(String message) {
 		super(message);
-		this.cause = null;
 	}
 
 	/**
@@ -57,31 +49,31 @@
 	 * @param cause The cause of the exception. May be <code>null</code>.
 	 */
 	public ComponentException(Throwable cause) {
-		super();
-		this.cause = cause;
+		super(cause);
 	}
-
+	
 	/**
-	 * Returns the cause of this exception or <code>null</code> if no cause
-	 * was specified when this exception was created.
+	 * Returns the cause of this exception or <code>null</code> if no cause was
+	 * set.
 	 * 
-	 * @return The cause of this exception or <code>null</code> if no cause
-	 *         was specified.
+	 * @return The cause of this exception or <code>null</code> if no cause was
+	 *         set.
 	 */
 	public Throwable getCause() {
-		return cause;
+		return super.getCause();
 	}
 
 	/**
-	 * The cause of this exception can only be set when constructed.
+	 * Initializes the cause of this exception to the specified value.
 	 * 
-	 * @param cause Cause of the exception.
-	 * @return This object.
-	 * @throws java.lang.IllegalStateException This method will always throw an
-	 *         <code>IllegalStateException</code> since the cause of this
-	 *         exception can only be set when constructed.
+	 * @param cause The cause of this exception.
+	 * @return This exception.
+	 * @throws IllegalArgumentException If the specified cause is this
+	 *         exception.
+	 * @throws IllegalStateException If the cause of this exception has already
+	 *         been set.
 	 */
 	public Throwable initCause(Throwable cause) {
-		throw new IllegalStateException();
+		return super.initCause(cause);
 	}
 }

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentFactory.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentFactory.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentFactory.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.component/src/org/osgi/service/component/ComponentFactory.java,v 1.19 2006/06/16 16:31:26 hargrave Exp $
- *
- * Copyright (c) OSGi Alliance (2004, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2004, 2008). 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.
@@ -27,7 +25,8 @@
  * created and activated rather than automatically creating and activating
  * component configuration as necessary.
  * 
- * @version $Revision: 1.19 $
+ * @ThreadSafe
+ * @version $Revision: 5654 $
  */
 public interface ComponentFactory {
 	/**

Modified: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentInstance.java
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentInstance.java?rev=797561&r1=797560&r2=797561&view=diff
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentInstance.java (original)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/ComponentInstance.java Fri Jul 24 17:06:37 2009
@@ -1,7 +1,5 @@
 /*
- * $Header: /cvshome/build/org.osgi.service.component/src/org/osgi/service/component/ComponentInstance.java,v 1.13 2006/06/16 16:31:26 hargrave Exp $
- *
- * Copyright (c) OSGi Alliance (2004, 2006). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2004, 2008). 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.
@@ -27,7 +25,8 @@
  * ComponentInstances are never reused. A new ComponentInstance object will be
  * created when the component configuration is activated again.
  * 
- * @version $Revision: 1.13 $
+ * @ThreadSafe
+ * @version $Revision: 5654 $
  */
 public interface ComponentInstance {
 	/**

Added: felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/package.html
URL: http://svn.apache.org/viewvc/felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/package.html?rev=797561&view=auto
==============================================================================
--- felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/package.html (added)
+++ felix/trunk/org.osgi.compendium/src/main/java/org/osgi/service/component/package.html Fri Jul 24 17:06:37 2009
@@ -0,0 +1,11 @@
+<!-- $Revision: 6204 $ -->
+<BODY>
+<p>Service Component Package Version 1.1.
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:
+<pre>
+Import-Package: org.osgi.service.component; version=&quot;[1.1,2.0)&quot;
+</pre>
+</BODY>
+