[jboss-cvs] JBossAS SVN: r88768 - in projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org: osgi and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 12 17:11:25 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-05-12 17:11:25 -0400 (Tue, 12 May 2009)
New Revision: 88768

Added:
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/ModuleContext.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/ModuleContextAware.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/NoSuchComponentException.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ComponentDefinitionRegistry.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ComponentNameAlreadyInUseException.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/NamespaceHandler.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ParserContext.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/BindingListenerMetadata.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/CollectionBasedServiceReferenceComponentMetadata.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ComponentValue.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ConstructorInjectionMetadata.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/FieldInjectionMetadata.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/IndexedParameterSpecification.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ListValue.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/LocalComponentMetadata.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/MapValue.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/MethodInjectionMetadata.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/NamedParameterSpecification.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ParameterSpecification.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/PropertyInjectionMetadata.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ReferenceNameValue.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ReferenceValue.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListenerMetadata.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ServiceExportComponentMetadata.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceComponentMetadata.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/SetValue.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/TypedParameterSpecification.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/TypedStringValue.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/UnaryServiceReferenceComponentMetadata.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/Value.java
Log:
Add blueprint API

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/ModuleContext.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/ModuleContext.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/ModuleContext.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,131 @@
+
+package org.osgi.service.blueprint.context;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.LocalComponentMetadata;
+import org.osgi.service.blueprint.reflect.ServiceExportComponentMetadata;
+import org.osgi.service.blueprint.reflect.ServiceReferenceComponentMetadata;
+
+/**
+ * ModuleContext providing access to the components, service exports, and
+ * service references of a module. Only bundles in the ACTIVE state may 
+ * have an associated ModuleContext. A given BundleContext has at most one associated
+ * ModuleContext.
+ * 
+ * An instance of ModuleContext may be obtained from within a module context
+ * by implementing the ModuleContextAware interface on a component class.
+ * Alternatively you can look up ModuleContext services in the service registry.
+ * The Constants.BUNDLE_SYMBOLICNAME and Constants.BUNDLE_VERSION service 
+ * properties can be used to determine which bundle the published ModuleContext
+ * service is associated with.
+ * 
+ * A ModuleContext implementation must support safe concurrent access. It is legal
+ * for the set of named components and component metadata to change between invocations
+ * on the same thread if another thread is concurrently modifying the same mutable ModuleContext
+ * implementation object.
+ * 
+ * @see ModuleContextAware
+ * @see org.osgi.framework.Constants
+ *
+ */
+public interface ModuleContext {
+	
+	/**
+	 * reason code for destroy method callback of a managed service factory
+	 * created component, when the component is being disposed because 
+	 * the corresponding configuration admin object was deleted.
+	 */
+	public static final int CONFIGURATION_ADMIN_OBJECT_DELETED = 1;
+	
+	/** 
+	 * reason code for destroy method callback of a managed service factory
+	 * created component, when the component is being disposed because
+	 * the bundle is being stopped.
+	 */
+	public static final int BUNDLE_STOPPING = 2;
+	
+	/**
+	 * Name of the property used to provide the symbolic name of the bundle on whose behalf
+	 * a ModuleContext service has been published.
+	 */
+	public static final String SYMBOLIC_NAME_PROPERTY = "osgi.service.blueprint.symbolicname";
+	
+	/**
+	 * Name of the property used to provide the version of the bundle on whose behalf a ModuleContext
+	 * service has been published.
+	 */
+	public static final String VERSION_PROPERTY = "osgi.service.blueprint.version";
+	
+	/**
+	 * The names of all the named components within the module context.
+	 * 
+	 * @return an array containing the names of all of the components within
+	 * the module.
+	 */
+	String[] getComponentNames();
+	
+	/**
+	 * Get the component instance for a given named component.
+	 * 
+	 * @param name the name of the component for which the instance is to be retrieved
+	 * 
+	 * @return the component instance, the type of the returned object is dependent
+	 * on the component definition, and may be determined by introspecting the
+	 * component metadata.
+	 * 
+	 * @throws NoSuchNamedComponentException if the name specified is not the name of a
+	 * component within the module.
+	 */
+	Object getComponent(String name) throws NoSuchComponentException;
+	
+	/**
+	 * Get the component metadata for a given named component.
+	 * 
+	 * @param name the name of the component for which the metadata is to be retrieved.
+	 * 
+	 * @return the component metadata for the component.
+	 * 
+	 * @throws NoSuchNamedComponentException if the name specified is not the name of a 
+	 * component within the module.
+	 */
+	ComponentMetadata getComponentMetadata(String name) throws NoSuchComponentException;
+
+	/**
+	 * Get the service reference metadata for every OSGi service referenced by
+	 * this module.
+	 * 
+	 * @return an array of metadata, with one entry for each referenced service.
+	 * If the module does not reference any services then an empty array will be
+	 * returned.
+	 */
+	ServiceReferenceComponentMetadata[] getReferencedServicesMetadata();
+
+	/**
+	 * Get the service export metadata for every service exported by this
+	 * module.
+	 * 
+	 * @return an array of metadata, with one entry for each service export.
+	 * If the module does not export any services then an empty array will be
+	 * returned.
+	 */
+	ServiceExportComponentMetadata[] getExportedServicesMetadata();
+	
+	/**
+	 * Get the metadata for all components defined locally within this module.
+	 * 
+	 * @return an array of metadata, with one entry for each component.
+	 * If the module does not define any local components then an empty array will
+	 * be returned.
+	 */
+	LocalComponentMetadata[] getLocalComponentsMetadata();
+
+	/**
+	 * Get the bundle context of the bundle this module context is 
+	 * associated with.
+	 * 
+	 * @return the module's bundle context
+	 */
+	BundleContext getBundleContext();
+
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/ModuleContext.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/ModuleContextAware.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/ModuleContextAware.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/ModuleContextAware.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,19 @@
+package org.osgi.service.blueprint.context;
+
+/**
+ * If a component implements this interface then the setModuleContext operation
+ * will be invoked after the component instance has been instantiated and before
+ * the init-method (if specified) has been invoked.
+ *
+ */
+public interface ModuleContextAware {
+	
+	/**
+	 * Set the module context of the module in which the implementor is 
+	 * executing.
+	 * 
+	 * @param context the module context in which the implementor of 
+	 * this interface is executing.
+	 */
+	void setModuleContext(ModuleContext context);
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/ModuleContextAware.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/NoSuchComponentException.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/NoSuchComponentException.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/NoSuchComponentException.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,27 @@
+/**
+ * 
+ */
+package org.osgi.service.blueprint.context;
+
+/**
+ * Thrown when an attempt is made to lookup a component by name and no such named
+ * component exists in the module context.
+ */
+public class NoSuchComponentException extends RuntimeException {
+
+	private final String componentName;
+	
+	public NoSuchComponentException(String componentName) {
+		this.componentName = componentName;
+	}
+	
+	public String getComponentName() {
+		return this.componentName;
+	}
+
+	public String getMessage() {
+		return "No component named '" + 
+		       (this.componentName == null ? "<null>" : this.componentName) + 
+		       "' could be found";
+	}
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/context/NoSuchComponentException.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ComponentDefinitionRegistry.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ComponentDefinitionRegistry.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ComponentDefinitionRegistry.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,55 @@
+package org.osgi.service.blueprint.namespace;
+
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+
+/**
+ * A registry of the component definitions for a given context.
+ * 
+ * Implementations of ComponentDefinitionRegistry are required to support
+ * concurrent access. The state of a component registry
+ * may change between invocations on the same thread. For example, a single
+ * thread invoking containsComponentDefinition("foo") and getting a return value
+ * of 'true' may see a return value of null on a subsequent call to
+ * getComponentDefinition("foo") if another thread has removed the component
+ * definition in the meantime. 
+ */
+public interface ComponentDefinitionRegistry {
+
+	/**
+	 * Returns true iff the registry contains a component definition with
+	 * the given name as its component name or as an alias. 
+	 */
+	boolean containsComponentDefinition(String name);
+	
+	/**
+	 * Get the component definition for the component with the given name
+	 * or alias.
+	 *
+	 * @return the matching component definition if present, or null if no
+	 * component with a matching name or alias is present.
+	 */
+	ComponentMetadata getComponentDefinition(String name);
+	
+	/**
+	 * Get the names of all the registered components.
+	 */
+	String[] getComponentDefinitionNames();
+	
+	/**
+	 * Register a new component definition.
+	 * 
+	 * @throws ComponentNameAlreadyInUseException if the name or one of the aliases of the 
+	 * component definition to be registered is already in use by an existing component
+	 * definition.
+	 */
+	void registerComponentDefinition(ComponentMetadata component) throws ComponentNameAlreadyInUseException;
+	
+	/**
+	 * Remove a component definition from the registry. If no matching component
+	 * is present then this operation does nothing.
+	 * 
+	 * @param name the name (or an alias) of the component to be removed.
+	 */
+	void removeComponentDefinition(String name);
+	
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ComponentDefinitionRegistry.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ComponentNameAlreadyInUseException.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ComponentNameAlreadyInUseException.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ComponentNameAlreadyInUseException.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,22 @@
+package org.osgi.service.blueprint.namespace;
+
+/**
+ * Exception thrown when an attempt is made to register a component with a 
+ * name that is already in use by an existing component.
+ */
+public class ComponentNameAlreadyInUseException extends RuntimeException {
+
+	private String duplicateName;
+	
+	public ComponentNameAlreadyInUseException(String name) {
+		this.duplicateName = name;
+	}
+	
+	public String getMessage() {
+		return "Name or alias '" + this.duplicateName + "' is already in use by a registered component";
+	}
+	
+	public String getConflictingName() {
+		return this.duplicateName;
+	}
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ComponentNameAlreadyInUseException.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/NamespaceHandler.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/NamespaceHandler.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/NamespaceHandler.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,61 @@
+
+package org.osgi.service.blueprint.namespace;
+
+import java.net.URL;
+
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * A namespace handler provides support for parsing custom namespace elements and attributes in 
+ * module context configuration files. It manipulates component definitions and the 
+ * component registry to implement the intended semantices of the namespace.
+ * 
+ * Instances of NamespaceHandler are discovered through the service registry where
+ * they should be published with a service property org.osgi.module.context.namespace set
+ * to the schema URI of the schema that they handle.
+ * 
+ * Implementations of NamespaceHandler are required to be thread-safe.
+ *
+ */
+public interface NamespaceHandler {
+	
+	/**
+	 * The URL where the xsd file for the schema may be found. Typically used to return a URL to a
+	 * bundle resource entry so as to avoid needing to lookup schemas remotely. 
+	 * If null is returned then the schema location will be determined from the xsi:schemaLocation attribute
+	 * value.
+	 */
+	URL getSchemaLocation();
+	
+	/**
+	 * Called when a top-level (i.e. non-nested) element from the namespace is encountered.
+	 * Implementers may register component definitions themselves, and/or return a component definition
+	 * to be registered.
+	 *
+	 * @param element the dom element from the namespace that has just been encountered
+	 * @param context parser context giving access component registry and context information about the
+	 *   current parsing location.
+	 *   
+	 * @return a component metadata instance to be registered for the context, or null if there are no
+	 * additional component descriptions to register.
+	 */
+	ComponentMetadata parse(Element element, ParserContext context);
+	
+	/**
+	 * Called when an attribute or nested element is encountered. Implementors should parse the 
+	 * supplied Node and decorated the provided component, returning the decorated component.
+	 *
+	 * @param node the dom Node from the namespace that has just been encountered
+	 * @param component the component metadata for the component in which the attribute or nested element
+	 * was encountered
+	 * @param context parser context giving access component registry and context information about the
+	 *   current parsing location.
+	 *   
+	 * @return the decorated component to replace the original, or simply the original component if no
+	 * decoration is required. 
+	 */
+	ComponentMetadata decorate(Node node, ComponentMetadata component, ParserContext context);
+
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/NamespaceHandler.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ParserContext.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ParserContext.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ParserContext.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,28 @@
+package org.osgi.service.blueprint.namespace;
+
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.w3c.dom.Node;
+
+/**
+ * A ParserContext provides contextual information to a NamespaceHandler when
+ * parsing an Element or Node from the namespace.
+ */
+public interface ParserContext {
+
+	/**
+	 * The dom Node which we are currently processing
+	 */
+	Node getSourceNode();
+	
+	/**
+	 * The component definition registry containing all of the registered component
+	 * definitions for this context
+	 */
+	ComponentDefinitionRegistry getComponentDefinitionRegistry();
+	
+	/**
+	 * The enclosing component definition in the context of which the
+	 * source node is to be processed.
+	 */
+	ComponentMetadata getEnclosingComponent();
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/namespace/ParserContext.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/BindingListenerMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/BindingListenerMetadata.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/BindingListenerMetadata.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,34 @@
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * Metadata for a listener interested in service bind and unbind events for a service
+ * reference.
+ */
+public interface BindingListenerMetadata {
+
+	/**
+	 * The component instance that will receive bind and unbind 
+	 * events. The returned value must reference a component and therefore be
+	 * either a ComponentValue, ReferenceValue, or ReferenceNameValue.
+	 * 
+	 * @return the listener component reference.
+	 */
+	Value getListenerComponent();
+	
+	/**
+	 * The name of the method to invoke on the listener component when
+	 * a matching service is bound to the reference
+	 * 
+	 * @return the bind callback method name.
+	 */
+	String getBindMethodName();
+	
+	/**
+	 * The name of the method to invoke on the listener component when
+	 * a service is unbound from the reference.
+	 * 
+	 * @return the unbind callback method name.
+	 */
+	String getUnbindMethodName();
+	
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/BindingListenerMetadata.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/CollectionBasedServiceReferenceComponentMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/CollectionBasedServiceReferenceComponentMetadata.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/CollectionBasedServiceReferenceComponentMetadata.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,51 @@
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * Service reference that binds to a collection of matching services from
+ * the OSGi service registry.
+ *
+ */
+public interface CollectionBasedServiceReferenceComponentMetadata extends
+		ServiceReferenceComponentMetadata {
+	
+		/**
+		 * Create natural ordering based on comparison on service objects.
+		 */
+		public static final int ORDER_BASIS_SERVICES = 1;
+		
+		/**
+		 * Create natural ordering based on comparison of service reference objects.
+		 */
+		public static final int ORDER_BASIS_SERVICE_REFERENCES = 2;
+
+		/**
+		 * The type of collection to be created.
+		 * 
+		 * @return Class object for the specified collection type (List, Set, Map).
+		 */
+		Class getCollectionType();
+	
+		/**
+		 * The comparator specified for ordering the collection, or null if no
+		 * comparator was specified.
+		 * 
+		 * @return if a comparator was specified then a Value object identifying the 
+		 * comparator (a ComponentValue, ReferenceValue, or ReferenceNameValue) is 
+		 * returned. If no comparator was specified then null will be returned.
+		 */
+		Value getComparator();
+		
+		/**
+		 * Should the collection be ordered based on natural ordering? 
+		 * 
+		 * @return true, iff natural-ordering based sorting was specified.
+		 */
+		boolean isNaturalOrderingBasedComparison();
+		
+		/**
+		 * The basis on which to perform natural ordering, if specified.
+		 * 
+		 * @return one of ORDER_BASIS_SERVICES and ORDER_BASIS_SERVICE_REFERENCES
+		 */
+		int getNaturalOrderingComparisonBasis();
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/CollectionBasedServiceReferenceComponentMetadata.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,38 @@
+
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * Metadata for a component defined within a given module context.
+ * 
+ * @see LocalComponentMetadata
+ * @see ServiceReferenceComponentMetadata
+ * @see ServiceExportComponentMetadata
+ */
+public interface ComponentMetadata {
+	
+	/**
+	 * The name of the component.
+	 * 
+	 * @return component name. The component name may be null if this is an anonymously
+	 * defined inner component.
+	 */
+	String getName();
+	
+	/**
+	 * Any aliases by which the component is also known.
+	 * 
+	 * @return an array of aliases by which the component is known (does not
+	 * include the component name as returned by getName()). If the component 
+	 * has no aliases then an empty array is returned.
+	 */
+	String[] getAliases();
+	
+	/**
+	 * The names of any components listed in a "depends-on" attribute for this
+	 * component.
+	 * 
+	 * @return an array of component names for components that we have explicitly
+	 * declared a dependency, or an empty array if none.
+	 */
+	String[] getExplicitDependencies();
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ComponentValue.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ComponentValue.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ComponentValue.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,10 @@
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * A value represented by an anonymous local component definition.
+ */
+public interface ComponentValue extends Value {
+
+	LocalComponentMetadata getComponentMetadata();
+	
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ComponentValue.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ConstructorInjectionMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ConstructorInjectionMetadata.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ConstructorInjectionMetadata.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,19 @@
+package org.osgi.service.blueprint.reflect;
+
+
+/**
+ * Metadata describing how to instantiate a component instance by
+ * invoking one of its constructors.
+ */
+public interface ConstructorInjectionMetadata {
+	
+	/**
+	 * The parameter specifications that determine which constructor to invoke
+	 * and what arguments to pass to it.
+	 * 
+	 * @return an array of parameter specifications, or an empty array if the
+	 * default constructor is to be invoked.
+	 */
+	ParameterSpecification[] getParameterSpecifications();
+
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ConstructorInjectionMetadata.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/FieldInjectionMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/FieldInjectionMetadata.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/FieldInjectionMetadata.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,22 @@
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * Metadata describing a field of a component that is to be injected.
+ */
+public interface FieldInjectionMetadata {
+	
+	/**
+	 * The name of the field to be injected.
+	 * 
+	 * @return the field name
+	 */
+	String getName();
+
+	/**
+	 * The value to inject the field with.
+	 * 
+	 * @return the field value
+	 */
+	Value getValue();
+	
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/FieldInjectionMetadata.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/IndexedParameterSpecification.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/IndexedParameterSpecification.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/IndexedParameterSpecification.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,16 @@
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * Parameter specification for injection of a parameter identified by its position in the
+ * argument list.
+ *
+ */
+public interface IndexedParameterSpecification extends ParameterSpecification {
+
+	/**
+	 * The index into the argument list of the parameter to be injected.
+	 * 
+	 * @return the parameter index, indices start at 0.
+	 */
+	int getIndex();
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/IndexedParameterSpecification.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ListValue.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ListValue.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ListValue.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,11 @@
+
+package org.osgi.service.blueprint.reflect;
+
+import java.util.List;
+
+/**
+ * A list-based value. Members of the List are instances of Value.
+ */
+public interface ListValue extends Value, List/*<Value>*/ {
+
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ListValue.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/LocalComponentMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/LocalComponentMetadata.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/LocalComponentMetadata.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,130 @@
+package org.osgi.service.blueprint.reflect;
+
+
+/**
+ * Metadata for a component defined locally with a module context.
+ *
+ */
+public interface LocalComponentMetadata extends ComponentMetadata {
+	
+	static final String SCOPE_SINGLETON = "singleton";
+	static final String SCOPE_PROTOTYPE = "prototype";
+	static final String SCOPE_BUNDLE = "bundle";
+
+	/**
+	 * The name of the class type specified for this component.
+	 * 
+	 * @return the name of the component class.
+	 */
+	String getClassName();
+	
+	/**
+	 * The name of the init method specified for this component, if any.
+	 *  
+	 * @return the method name of the specified init method, or null if 
+	 * no init method was specified.
+	 */
+	String getInitMethodName();
+	
+	/**
+	 * The name of the destroy method specified for this component, if any.
+	 * 
+	 * @return the method name of the specified destroy method, or null if no
+	 * destroy method was specified.
+	 */
+	String getDestroyMethodName();
+	
+	/**
+	 * The constructor injection metadata for this component.
+	 * 	
+	 * @return the constructor injection metadata. This is guaranteed to be
+	 * non-null and will refer to the default constructor if no explicit
+	 * constructor injection was specified for the component.
+	 */
+	ConstructorInjectionMetadata getConstructorInjectionMetadata();
+	
+	/**
+	 * The property injection metadata for this component.
+	 * 
+	 * @return an array containing one entry for each property to be injected. If
+	 * no property injection was specified for this component then an empty array
+	 * will be returned.
+	 * 
+	 */
+	PropertyInjectionMetadata[] getPropertyInjectionMetadata();
+	
+	/**
+	 * The field injection metadata for this component.
+	 * 
+	 * @return an array containing one entry for each field to be injected. If no
+	 * field injection was specified for this component then an empty array will be
+	 * returned.
+	 * 
+	 */
+	FieldInjectionMetadata[] getFieldInjectionMetadata();
+	
+	/**
+	 * The method injection metadata for this component.
+	 * 
+	 * @return an array containing one entry for each method to be invoked using method
+	 * injection after constructing the component instance. If no method injection
+	 * was specified for this component then an empty array will be returned.
+	 */
+	MethodInjectionMetadata[] getMethodInjectionMetadata();
+	
+	/**
+	 * Is this an abstract component declaration.
+	 * 
+	 * @return true, iff this component definition is marked as abstract and hence
+	 * has no associated component instance.
+	 */
+	boolean isAbstract();
+	
+	/**
+	 * Is this component to be lazily instantiated?
+	 * 
+	 * @return true, iff this component definition specifies lazy
+	 * instantiation.
+	 */
+	boolean isLazy();
+	
+	/**
+	 * The metadata for the parent definition of this component declaration, if any.
+	 * 
+	 * @return the component metadata for the parent component definition if this component
+	 * was declared using component metadata inheritance.
+	 */
+	LocalComponentMetadata getParent();
+	
+	/**
+	 * The metadata describing how to create the component instance by invoking a 
+	 * method (as opposed to a constructor) if factory methods are used.
+	 * 
+	 * @return the method injection metadata for the specified factory method, or null if no
+	 * factory method is used for this component.
+	 */
+	MethodInjectionMetadata getFactoryMethodMetadata();
+	
+	/**
+	 * The component instance on which to invoke the factory method (if specified).
+	 * 
+	 * @return when a factory method and factory component has been specified for this
+	 * component, this operation returns the metadata specifying the component on which
+	 * the factory method is to be invoked. When no factory component has been specified
+	 * this operation will return null. A return value of null with a non-null factory method
+	 * indicates that the factory method should be invoked as a static method on the 
+	 * component class itself.
+	 */
+	ComponentMetadata getFactoryComponent();
+	
+	/**
+	 * The specified scope for the component lifecycle.
+	 * 
+	 * @return a String indicating the scope specified for the component.
+	 * 
+	 * @see SCOPE_SINGLETON
+	 * @see SCOPE_PROTOTYPE
+	 * @see SCOPE_BUNDLE
+	 */
+	String getScope();
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/LocalComponentMetadata.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/MapValue.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/MapValue.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/MapValue.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,12 @@
+package org.osgi.service.blueprint.reflect;
+
+import java.util.Map;
+
+/**
+ * A map-based value. Map keys are instances of Value, as are the Map entry
+ * values themselves.
+ * 
+ */
+public interface MapValue extends Value, Map/*<Value,Value>*/ {
+
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/MapValue.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/MethodInjectionMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/MethodInjectionMetadata.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/MethodInjectionMetadata.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,26 @@
+package org.osgi.service.blueprint.reflect;
+
+
+/**
+ * Metadata describing a method to be invoked as part of component configuration.
+ *
+ */
+public interface MethodInjectionMetadata {
+	
+	/**
+	 * The name of the method to be invoked.
+	 * 
+	 * @return the method name, overloaded methods are disambiguated by
+	 * parameter specifications.
+	 */
+	String getName();
+	
+	/**
+	 * The parameter specifications that determine which method to invoke
+	 * (in the case of overloading) and what arguments to pass to it.
+	 * 
+	 * @return an array of parameter specifications, or an empty array if the
+	 * method takes no arguments.
+	 */
+	ParameterSpecification[] getParameterSpecifications();
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/MethodInjectionMetadata.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/NamedParameterSpecification.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/NamedParameterSpecification.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/NamedParameterSpecification.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,16 @@
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * Parameter specification for injection of a parameter by name.
+ *
+ */
+public interface NamedParameterSpecification extends ParameterSpecification {
+	
+	/**
+	 * The name of the parameter to be injected.
+	 * 
+	 * @return the parameter name
+	 */
+	String getName();
+
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/NamedParameterSpecification.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ParameterSpecification.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ParameterSpecification.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ParameterSpecification.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,19 @@
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * Metadata describing a parameter of a method or constructor and the
+ * value that is to be passed during injection.
+ * 
+ * @see NamedParameterSpecification
+ * @see TypedParameterSpecification
+ * @see IndexedParameterSpecification
+ */
+public interface ParameterSpecification {
+	
+	/**
+	 * The value to inject into the parameter.
+	 * 
+	 * @return the parameter value
+	 */
+	Value getValue();
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ParameterSpecification.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/PropertyInjectionMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/PropertyInjectionMetadata.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/PropertyInjectionMetadata.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,22 @@
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * Metadata describing a property to be injected. Properties are defined
+ * following JavaBeans conventions.
+ */
+public interface PropertyInjectionMetadata {
+	
+	/**
+	 * The name of the property to be injected, following JavaBeans conventions.
+	 * 
+	 * @return the property name.
+	 */
+	String getName();
+	
+	/**
+	 * The value to inject the property with.
+	 * 
+	 * @return the property value.
+	 */
+	Value getValue();
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/PropertyInjectionMetadata.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ReferenceNameValue.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ReferenceNameValue.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ReferenceNameValue.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,12 @@
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * A value which represents the name of another component in the module context.
+ * The name itself will be injected, not the component that the name refers to.
+ *
+ */
+public interface ReferenceNameValue extends Value {
+
+	String getReferenceName();
+	
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ReferenceNameValue.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ReferenceValue.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ReferenceValue.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ReferenceValue.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,14 @@
+
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * A value which refers to another component in the module context by name.
+ */
+public interface ReferenceValue extends Value {
+
+	/**
+	 * The name of the referenced component.
+	 */
+	String getComponentName();
+	
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ReferenceValue.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListenerMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListenerMetadata.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListenerMetadata.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,35 @@
+
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * Metadata for a listener interested in service registration and unregistration
+ * events for an exported service.
+ */
+public interface RegistrationListenerMetadata {
+
+	/**
+	 * The component instance that will receive registration and unregistration 
+	 * events. The returned value must reference a component and therefore be
+	 * either a ComponentValue, ReferenceValue, or ReferenceNameValue.
+	 * 
+	 * @return the listener component reference.
+	 */
+	Value getListenerComponent();
+	
+	/**
+	 * The name of the method to invoke on the listener component when
+	 * the exported service is registered with the service registry.
+	 * 
+	 * @return the registration callback method name.
+	 */
+	String getRegistrationMethodName();
+	
+	/**
+	 * The name of the method to invoke on the listener component when
+	 * the exported service is unregistered from the service registry.
+	 * 
+	 * @return the unregistration callback method name.
+	 */
+	String getUnregistrationMethodName();
+	
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListenerMetadata.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ServiceExportComponentMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ServiceExportComponentMetadata.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ServiceExportComponentMetadata.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,82 @@
+package org.osgi.service.blueprint.reflect;
+
+import java.util.Properties;
+
+
+/**
+ * Metadata representing a service to be exported by a module context.
+ *
+ */
+public interface ServiceExportComponentMetadata extends ComponentMetadata {
+
+	/**
+	 * Do not auto-detect types for advertised service intefaces
+	 */
+	public static final int EXPORT_MODE_DISABLED = 1;
+	
+	/**
+	 * Advertise all Java interfaces implemented by the exported component as
+	 * service interfaces.
+	 */
+	public static final int EXPORT_MODE_INTERFACES= 2;
+	
+	/**
+	 * Advertise all Java classes in the hierarchy of the exported component's type
+	 * as service interfaces.
+	 */
+	public static final int EXPORT_MODE_CLASS_HIERARCHY = 3;
+	
+	/**
+	 * Advertise all Java classes and interfaces in the exported component's type as 
+	 * service interfaces.
+	 */
+	public static final int EXPORT_MODE_ALL = 4;
+	
+	/**
+	 * The component that is to be exported as a service. Value must refer to a component and
+	 * therefore be either a ComponentValue, ReferenceValue, or ReferenceNameValue.
+	 * 
+	 * @return the component to be exported as a service.
+	 */
+	Value getExportedComponent();
+	
+	/**
+	 * The type names of the set of interface types that the service should be advertised
+	 * as supporting.
+	 * 
+	 * @return an array of type names, or an empty array if using auto-export
+	 */
+	String[] getInterfaceNames();
+	
+	/**
+	 * Return the auto-export mode specified.
+	 * 
+	 * @return One of EXPORT_MODE_DISABLED, EXPORT_MODE_INTERFACES, EXPORT_MODE_CLASS_HIERARCHY, EXPORT_MODE_ALL
+	 */
+	int getAutoExportMode();
+	
+	/**
+	 * The user declared properties to be advertised with the service.
+	 * 
+	 * @return Properties object containing the set of user declared service properties (may be
+	 * empty if no properties were specified).
+	 */
+	Properties getServiceProperties();
+
+	/**
+	 * The ranking value to use when advertising the service
+	 *  
+	 * @return service ranking
+	 */
+	int getRanking();
+	
+	/**
+	 * The listeners that have registered to be notified when the exported service
+	 * is registered and unregistered with the framework.
+	 * 
+	 * @return an array of registration listeners, or an empty array if no listeners
+	 * have been specified.
+	 */
+	RegistrationListenerMetadata[] getRegistrationListeners();
+	
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ServiceExportComponentMetadata.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceComponentMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceComponentMetadata.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceComponentMetadata.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,50 @@
+package org.osgi.service.blueprint.reflect;
+
+
+/**
+ * Metadata describing a reference to a service that is to be imported into the module
+ * context from the OSGi service registry.
+ */
+public interface ServiceReferenceComponentMetadata extends ComponentMetadata {
+
+	/**
+	 * A matching service is required at all times.
+	 */
+	public static final int MANDATORY_AVAILABILITY = 1;
+	
+	/**
+	 * A matching service is not required to be present.
+	 */
+	public static final int OPTIONAL_AVAILABILITY = 2;
+	
+	/**
+	 * Whether or not a matching service is required at all times.
+	 * 
+	 * @return one of MANDATORY_AVAILABILITY or OPTIONAL_AVAILABILITY
+	 */
+	int getServiceAvailabilitySpecification();
+	
+	/**
+	 * The interface types that the matching service must support
+	 * 
+	 * @return an array of type names
+	 */
+	String[] getInterfaceNames();
+	
+	/**
+	 * The filter expression that a matching service must pass
+	 * 
+	 * @return filter expression
+	 */
+	String getFilter();
+
+	/**
+	 * The set of listeners registered to receive bind and unbind events for
+	 * backing services.
+	 * 
+	 * @return an array of registered binding listeners, or an empty array
+	 * if no listeners are registered.
+	 */
+	BindingListenerMetadata[] getBindingListeners();
+	
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceComponentMetadata.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/SetValue.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/SetValue.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/SetValue.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,11 @@
+
+package org.osgi.service.blueprint.reflect;
+
+import java.util.Set;
+
+/**
+ * A set-based value. Members of the set are instances of Value.
+ */
+public interface SetValue extends Value, Set/*<Value>*/ {
+
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/SetValue.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/TypedParameterSpecification.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/TypedParameterSpecification.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/TypedParameterSpecification.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,15 @@
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * Parameter specification for injection of a parameter by type.
+ */
+public interface TypedParameterSpecification extends ParameterSpecification {
+
+	/**
+	 * The name of the type that the parameter type must be assignable from.
+	 * 
+	 * @return the parameter type name
+	 */
+	String getTypeName();
+	
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/TypedParameterSpecification.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/TypedStringValue.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/TypedStringValue.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/TypedStringValue.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,20 @@
+
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * A simple string value that will be type-converted if necessary before
+ * injecting into a target.
+ *
+ */
+public interface TypedStringValue extends Value {
+	
+	/**
+	 * The string value (unconverted) of this value). 
+	 */
+	String getStringValue();
+
+	/**
+	 * The name of the type to which this value should be coerced. May be null.
+	 */
+	String getTypeName();
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/TypedStringValue.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/UnaryServiceReferenceComponentMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/UnaryServiceReferenceComponentMetadata.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/UnaryServiceReferenceComponentMetadata.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,20 @@
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * 
+ * Service reference that will bind to a single matching service
+ * in the service registry.
+ *
+ */
+public interface UnaryServiceReferenceComponentMetadata extends
+	ServiceReferenceComponentMetadata {
+
+	/**
+	 * Timeout for service invocations when a matching backing service
+	 * is unavailable.
+     *
+	 * @return service invocation timeout in milliseconds
+	 */
+	long getTimeout();
+	
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/UnaryServiceReferenceComponentMetadata.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/Value.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/Value.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/Value.java	2009-05-12 21:11:25 UTC (rev 88768)
@@ -0,0 +1,9 @@
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * A value to inject into a field, property, method argument or constructor
+ * argument.
+ */
+public interface Value {
+	// deliberately left empty
+}


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/main/java/org/osgi/service/blueprint/reflect/Value.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the jboss-cvs-commits mailing list