Author: pderop
Date: Wed Jun 23 22:12:51 2010
New Revision: 957373
URL: http://svn.apache.org/viewvc?rev=957373&view=rev
Log:
added a factoryMethod attribute in order to allow the creation of the service
implementation from a static method. Fixed javadoc. Renamed factory attribute
into factorySet
Modified:
felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Service.java
Modified:
felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Service.java
URL:
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Service.java?rev=957373&r1=957372&r2=957373&view=diff
==============================================================================
---
felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Service.java
(original)
+++
felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Service.java
Wed Jun 23 22:12:51 2010
@@ -67,14 +67,14 @@ import java.lang.annotation.Target;
* </blockquote>
*
* Here is a sample showing how a Y service may dynamically instantiate
several X Service instances,
- * using the {...@link #factory()} attribute:<p>
+ * using the {...@link #factorySet()} attribute:<p>
* <blockquote>
*
* <pre>
* /**
* * All Service instances will be created/updated/removed by the "Y"
Service
* */
- * @Service(factory="MyServiceFactory", factoryConfigure="configure")
+ * @Service(factorySet="MyServiceFactory", factoryConfigure="configure")
* class X implements Z {
* void configure(Dictionary conf) {
* // Configure or reconfigure our service. The conf is provided by
the factory,
@@ -133,17 +133,17 @@ import java.lang.annotation.Target;
public @interface Service
{
/**
- * Returns the list of provided interfaces. By default, the directly
implemented interfaces are provided.
+ * Sets list of provided interfaces. By default, the directly implemented
interfaces are provided.
*/
Class<?>[] provide() default {};
/**
- * Returns the list of provided service properties.
+ * Sets list of provided service properties.
*/
Property[] properties() default {};
/**
- * Returns the <code>factory</code> name used to dynamically instantiate
the Service annotated by this class.
+ * Returns the name of the <code>Factory Set</code> used to dynamically
instantiate this Service.
* When you set this attribute, a
<code>java.util.Set<java.lang.Dictionary></code> Service will
* be provided with a <code>dm.factory.name</code> service property
matching your specified <code>factory</code> attribute.
* This Set will be provided once the Service's bundle is started, even if
required dependencies are not available, and the
@@ -158,13 +158,18 @@ public @interface Service
* optionally specify in the {...@link Service#factoryConfigure()}
attribute. Each public properties from that dictionary
* (which don't start with a dot) will be propagated along with the
annotated Service properties.
*/
- String factory() default "";
+ String factorySet() default "";
/**
- * Returns the "configure" callback method name to be called with the
factory configuration. This attribute only makes sense if the
- * {...@link #factory()} attribute is used. If specified, then this
attribute references a Service callback method, which is called
+ * Sets "configure" callback method name to be called with the factory
configuration. This attribute only makes sense if the
+ * {...@link #factorySet()} attribute is used. If specified, then this
attribute references a Service callback method, which is called
* for providing the configuration supplied by the factory that
instantiated this Service. The current Service properties will be
* also updated with all public properties (which don't start with a dot).
*/
String factoryConfigure() default "";
+
+ /**
+ * Sets the static method used to create the Service implementation
instance.
+ */
+ String factoryMethod() default "";
}