Author: pderop
Date: Fri Jan 29 23:57:17 2016
New Revision: 1727666
URL: http://svn.apache.org/viewvc?rev=1727666&view=rev
Log:
Removed unecessary generics. Fixed javadoc.
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/compositefactory/README
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/device/Activator.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/Activator.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/DictionaryAspectConfiguration.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/DictionaryConfiguration.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/factory/README
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/Activator.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/README
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/hello/Activator.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleAdapterBuilder.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleDependencyBuilder.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ComponentBuilder.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FutureDependencyBuilder.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceCallbacksBuilder.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbBundle.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbComponent.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbComponentBundle.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbComponentDictionary.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbComponentRef.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbComponentRefService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbComponentRefServiceRefService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbComponentService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbComponentServiceService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbConsumer.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbDictionary.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbFuture.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbRef.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbRefService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbRefServiceRefService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbServiceDict.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbServiceMap.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbServiceService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeBundle.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeComponent.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeComponentBundle.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeComponentDictionary.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeComponentRef.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeComponentRefService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeComponentRefServiceRefService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeComponentService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeComponentServiceDict.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeComponentServiceMap.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeComponentServiceService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeDictionary.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeFuture.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeRef.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeRefService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeRefServiceRefService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeServiceDict.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeServiceMap.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbTypeServiceService.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/AdapterBase.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/ComponentBuilderImpl.java
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/ServiceCallbacksBuilderImpl.java
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/compositefactory/README
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/compositefactory/README?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/compositefactory/README
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/compositefactory/README
Fri Jan 29 23:57:17 2016
@@ -19,10 +19,11 @@ This Activator is an example usage of DM
using a composition of multiple object instances, which are used to implement
a given service.
The sample also uses a Factory approach in order to instantiate the
composition of objects: A
-"CompositionManager" is first injected with a Configuration that can be
possibly be used to create
+"CompositionManager" is first injected with a Configuration that can possibly
be used to create
and configure all the composites.
-Dependencies are injected in all objects in the composition.
+Dependencies are injected is some of the component implementation instances,
using java8 method references. For instance,
+the LogService is only injected in the ProviderImpl and the ProviderComposite1
class and not in the ProviderComposite2 class.
To see logs, type this command under the gogo shell:
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/device/Activator.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/device/Activator.java?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/device/Activator.java
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/device/Activator.java
Fri Jan 29 23:57:17 2016
@@ -31,11 +31,17 @@ public class Activator extends Dependenc
public void activate() throws Exception {
out.println("type \"log info\" to see the logs emitted by this test.");
+ // Create a pair of Device/DeviceParameter service with id=1
createDeviceAndParameter(1);
+
+ // Create a pair of Device/DeviceParameter service with id=2
createDeviceAndParameter(2);
-
+
+ // Create a DeviceParameter adapter: for each pair of
Device/DeviceParameter services having the same id,
+ // a DeviceParameter adapter service will be created.
adapter(Device.class, adpt ->
adpt.provides(DeviceAccess.class).impl(DeviceAccessImpl.class));
-
+
+ // Creates a component that simply displays all available
DeviceParameter adapter services.
component(comp -> comp
.impl(DeviceAccessConsumer.class)
.withSrv(LogService.class)
@@ -43,12 +49,10 @@ public class Activator extends Dependenc
}
private void createDeviceAndParameter(int id) {
- component(comp -> comp
- .factory(() -> new DeviceImpl(id))
- .provides(Device.class, "device.id", id));
-
- component(comp -> comp
- .factory(() -> new DeviceParameterImpl(id))
- .provides(DeviceParameter.class, "device.id", id));
+ // Creates a Device service with the provided id.
+ component(comp -> comp.factory(() -> new
DeviceImpl(id)).provides(Device.class, "device.id", id));
+
+ // Creates a DeivceParameter with the provided id.
+ component(comp -> comp.factory(() -> new
DeviceParameterImpl(id)).provides(DeviceParameter.class, "device.id", id));
}
}
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/Activator.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/Activator.java?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/Activator.java
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/Activator.java
Fri Jan 29 23:57:17 2016
@@ -33,7 +33,8 @@ public class Activator extends Dependenc
public void activate() throws Exception {
out.println("type \"log info\" to see the logs emitted by this test.");
- // Create the factory configuration for our DictionaryImpl service.
+ // Create the factory configuration for our DictionaryImpl service. An
instance of the DictionaryImpl is created for each
+ // factory configuration that you add from webconsole (using the
DictionaryConfiguration factory pid).
factoryPidAdapter(adapter -> adapter
.impl(DictionaryImpl.class)
.provides(DictionaryService.class)
@@ -42,14 +43,16 @@ public class Activator extends Dependenc
.cb(DictionaryImpl::updated)
.withSrv(LogService.class, log -> log.optional()));
- // Create the Dictionary Aspect
+ // Create the Dictionary Aspect that decorates any registered
Dictionary service. For each Dictionary, an instance of the
+ // DictionaryAspect service is created).
aspect(DictionaryService.class, aspect -> aspect
.impl(DictionaryAspect.class)
.filter("(lang=en)").rank(10)
.withCnf(conf ->
conf.pid(DictionaryAspectConfiguration.class).cb(DictionaryAspect::addWords))
.withSrv(LogService.class, log -> log.optional()));
- // Create the SpellChecker component
+ // Create the SpellChecker component. It depends on all available
DictionaryService instances, possibly
+ // decorated by some DictionaryAspects.
component(comp -> comp
.impl(SpellChecker.class)
.provides(SpellChecker.class, COMMAND_SCOPE, "dictionary",
COMMAND_FUNCTION, new String[] {"spellcheck"})
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/DictionaryAspectConfiguration.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/DictionaryAspectConfiguration.java?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/DictionaryAspectConfiguration.java
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/DictionaryAspectConfiguration.java
Fri Jan 29 23:57:17 2016
@@ -29,7 +29,7 @@ import aQute.bnd.annotation.metatype.Met
*
* @author <a href="mailto:[email protected]">Felix Project Team</a>
*/
-@OCD(name="Spell Checker Aspect Dictionary (api)",
+@OCD(name="Spell Checker Dictionary Aspect",
description = "Declare here the list of english words to be added into
the default english dictionary")
public interface DictionaryAspectConfiguration {
@AD(description = "Dictionary aspect words")
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/DictionaryConfiguration.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/DictionaryConfiguration.java?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/DictionaryConfiguration.java
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/DictionaryConfiguration.java
Fri Jan 29 23:57:17 2016
@@ -29,7 +29,7 @@ import aQute.bnd.annotation.metatype.Met
*
* @author <a href="mailto:[email protected]">Felix Project Team</a>
*/
-@OCD(name="Spell Checker Dictionary (api)",
+@OCD(name="Spell Checker Dictionary",
factory = true,
description = "Declare here some Dictionary instances, allowing to
instantiates some DictionaryService services for a given dictionary language")
public interface DictionaryConfiguration {
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/factory/README
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/factory/README?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/factory/README
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/factory/README
Fri Jan 29 23:57:17 2016
@@ -15,12 +15,8 @@
* limitations under the License.
*/
-This sample is an example usage of DM composite components. A composite
component is implemented
-using a composition of multiple object instances, which are used to implement
a given complex
-service. Here, we define a "Provider" service, which is implemented by three
object instances:
-ProviderImpl, ProviderParticipant1, ProviderParticipant2.
-
-Dependencies are injected in all objects being part of the composition.
+This sample is an example usage of DM components that are created using a
Factory object.
+The Factory is defined using java8 method references.
To see logs, type this command under the gogo shell:
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/Activator.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/Activator.java?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/Activator.java
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/Activator.java
Fri Jan 29 23:57:17 2016
@@ -40,6 +40,9 @@ public class Activator extends Dependenc
@Override
public void activate() throws Exception {
out.println("type \"log info\" to see the logs emitted by this test.");
+
+ // System.setProperty("http.proxyHost","your.http.proxy.host");
+ // System.setProperty("http.proxyPort", "your.http.proxy.port");
// Create the PageLinks service, which asynchronously download the
content of the Felix web page.
// The PageLink service will be started once the page has been
downloaded (using a CompletableFuture).
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/README
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/README?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/README
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/README
Fri Jan 29 23:57:17 2016
@@ -3,8 +3,14 @@ added in the dm-lambda library. Completa
In such model, you can use the new dm-lambda library to add dependencies on
asynchronous events using the standard JDK CompletableFuture class.
-In this example, the Activator first defines a PageLink component that depends
on a LogService.
-The PageLink is initialized with the Felix web site URL and from the
PageLinkImpl.init() method, the Felix web page is asynchronously downloaded,
-using a CompletableFuture. The CF is then added as a "FutureDependency" in the
PageLinkImpl.init() method.
-And when the CF completes, the PageLinkImpl.start() callback is invoked and
the service is registered.
-The Activator is then getting injected with the PageLink service, and displays
the links (hrefs) found from the Felix web site.
\ No newline at end of file
+In this example, the Activator first defines a PageLink component that is used
to download a given page from the web. The service then parses
+the content of the page and returns all available hrefs (links) found from the
web page.
+
+The PageLink is initialized with the Felix web site URL, which is
asynchronously downloaded from the PageLink::init method, using a
CompletableFuture.
+The CF is then added as a "FutureDependency" in the PageLinkImpl.init()
method, and when the CF completes, the PageLinkImpl.start() callback is invoked
+and the service is registered.
+
+The Activator is then getting injected with the PageLink service, and displays
the links (hrefs) found from the Felix web site.
+
+Caution: if you are using a corporate http proxy, you have to fix the
Activator in order to configure the ip addr and port number of your
+http proxy.
\ No newline at end of file
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/hello/Activator.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/hello/Activator.java?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/hello/Activator.java
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/hello/Activator.java
Fri Jan 29 23:57:17 2016
@@ -32,18 +32,30 @@ public class Activator extends Dependenc
public void activate() throws Exception {
out.println("type \"log info\" to see the logs emitted by this test.");
+ // Creates a Service Provider
component(comp -> comp
.impl(ServiceProviderImpl.class)
.provides(ServiceProvider.class, property1 -> "value1", property2
-> 123) // property names are deduced from lambda parameter names
.start(ServiceProviderImpl::activate)
.withSrv(LogService.class, log ->
log.cb(ServiceProviderImpl::bind)));
+ // Creates a Service Consumer. Notice that if your configuration
callback is "updated", you can
+ // simply use "withCnf(pid)" instead of explicitely providing the
method reference.
+
component(comp -> comp
.impl(ServiceConsumer.class)
.withSrv(LogService.class)
.withSrv(ServiceProvider.class, srv ->
srv.filter("(property1=value1)"))
.withCnf(conf ->
conf.pid(ServiceConsumer.class).cb(ServiceConsumer::updated)));
+ // Same as above, but using a shorter form of "withCnf" declaration
+// component(comp -> comp
+// .impl(ServiceConsumer.class)
+// .withSrv(LogService.class)
+// .withSrv(ServiceProvider.class, srv ->
srv.filter("(property1=value1)"))
+// .withCnf(ServiceConsumer.class));
+
+ // Creates a component that populates some properties in the
Configuration Admin.
component(comp ->
comp.impl(Configurator.class).withSrv(ConfigurationAdmin.class));
}
}
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleAdapterBuilder.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleAdapterBuilder.java?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleAdapterBuilder.java
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleAdapterBuilder.java
Fri Jan 29 23:57:17 2016
@@ -11,7 +11,7 @@ import org.apache.felix.dm.lambda.callba
* <p> Example that creates a MyBundleAdapter service for each started bundle
(the bundle is added by reflection on
* class field with a Bundle type):
*
- * <blockquote><pre>
+ * <pre> {@code
* public class Activator extends DependencyManagerActivator {
* public void activate() throws Exception {
* bundleAdapter(adapt -> adapt
@@ -19,11 +19,12 @@ import org.apache.felix.dm.lambda.callba
* .provides(MyBundleAdapter.class)
* .mask(Bundle.INSTALLED | Bundle.RESOLVED | Bundle.ACTIVE));
* }
- * } </pre></blockquote>
+ * }
+ * } </pre>
*
* Example that creates a MyBundleAdapter service for each started bundle (the
bundle is added using a method reference):
*
- * <blockquote><pre>
+ * <pre> {@code
* public class Activator extends DependencyManagerActivator {
* public void activate() throws Exception {
* bundleAdapter(adapt -> adapt
@@ -32,7 +33,8 @@ import org.apache.felix.dm.lambda.callba
* .mask(Bundle.INSTALLED | Bundle.RESOLVED | Bundle.ACTIVE)
* .cb(MyBundleAdapterImpl::setBundle));
* }
- * } </pre></blockquote>
+ * }
+ * }</pre>
*
* @author <a href="mailto:[email protected]">Felix Project Team</a>
*/
@@ -42,6 +44,7 @@ public interface BundleAdapterBuilder ex
* it is basically a mask with flags for each potential state a bundle can
be in.
*
* @param mask the mask to use
+ * @return this builder
*/
BundleAdapterBuilder mask(int mask);
@@ -50,7 +53,6 @@ public interface BundleAdapterBuilder ex
*
* @param filter the filter condition
* @return this builder
- * @throws IllegalArgumentException if the filter is invalid
*/
BundleAdapterBuilder filter(String filter);
@@ -64,10 +66,9 @@ public interface BundleAdapterBuilder ex
BundleAdapterBuilder propagate(boolean propagate);
/**
- * Sets property propagation. If set to <code>true</code> any bundle
manifest properties will be added
+ * Enables property propagation. Any bundle manifest properties will be
added
* to the service properties of the component that has this dependency (if
it registers as a service).
*
- * @param propagate <code>true</code> to propagate the bundle manifest
properties
* @return this builder
*/
BundleAdapterBuilder propagate();
@@ -78,7 +79,7 @@ public interface BundleAdapterBuilder ex
* When you specify two callbacks, the first one corresponds to the "add"
callback, and the second one to the "remove" callback. When you specify three
* callbacks, the first one stands for the "add" callback, the second one
for the "change" callback, and the third one for the "remove" callback.
*
- * @param callbacks a list of callbacks (1 param -> "add", 2 params ->
"add"/remove", 3 params -> "add"/"change"/"remove" callbacks).
+ * @param callbacks a list of callbacks (1 param : "add", 2 params :
"add"/remove", 3 params : "add"/"change"/"remove" callbacks).
* @return this builder
*/
BundleAdapterBuilder cb(String ... callbacks);
@@ -91,7 +92,7 @@ public interface BundleAdapterBuilder ex
* the "remove" callback.
*
* @param callbackInstance the Object instance where the callbacks are
invoked on
- * @param callbacks a list of callbacks (1 param -> "add", 2 params ->
"add"/remove", 3 params -> "add"/"change"/"remove" callbacks).
+ * @param callbacks a list of callbacks (1 param : "add", 2 params :
"add"/remove", 3 params : "add"/"change"/"remove" callbacks).
* @return this builder
*/
BundleAdapterBuilder cbi(Object callbackInstance, String ... callbacks);
@@ -100,6 +101,7 @@ public interface BundleAdapterBuilder ex
* Sets a <code>callback</code> java8 method reference which is invoked
when a bundle is added.
* The method reference must point to a Component implementation class
method, and take as argument a Bundle.
*
+ * @param <T> the type of the component instance class on which the
callback is invoked.
* @param add the method reference invoked when a bundle is added.
* @return this builder
*/
@@ -109,6 +111,7 @@ public interface BundleAdapterBuilder ex
* Sets some <code>callback</code> java8 method references which are
invoked when a bundle is added, or removed.
* The method references must point to a Component implementation class
method, and take as argument a Bundle.
*
+ * @param <T> the type of the component instance class on which the
callback is invoked.
* @param add the method reference invoked when a bundle is added.
* @param remove the method reference invoked when a bundle is removed.
* @return this builder
@@ -119,6 +122,7 @@ public interface BundleAdapterBuilder ex
* Sets some <code>callback</code> java8 method references which are
invoked when a bundle is added, changed or removed.
* The method references must point to a Component implementation class
method, and take as argument a Bundle.
*
+ * @param <T> the type of the component instance class on which the
callback is invoked.
* @param add the method reference invoked when a bundle is added.
* @param change the method reference invoked when a bundle has changed.
* @param remove the method reference invoked when a bundle is removed.
@@ -130,6 +134,7 @@ public interface BundleAdapterBuilder ex
* Sets a <code>callback</code> java8 method reference which is invoked
when a bundle is added.
* The method reference must point to a Component implementation class
method, and take as argument a Component and a Bundle.
*
+ * @param <T> the type of the component instance class on which the
callback is invoked.
* @param add the method reference invoked when a bundle is added.
* @return this builder
*/
@@ -139,6 +144,7 @@ public interface BundleAdapterBuilder ex
* Sets some <code>callback</code> java8 method references which are
invoked when a bundle is added, or removed.
* The method references must point to a Component implementation class
method, and take as argument a Component and a Bundle.
*
+ * @param <T> the type of the component instance class on which the
callback is invoked.
* @param add the method reference invoked when a bundle is added.
* @param remove the method reference invoked when a bundle is removed.
* @return this builder
@@ -149,6 +155,7 @@ public interface BundleAdapterBuilder ex
* Sets some <code>callback</code> java8 method references which are
invoked when a bundle is added, changed or removed.
* The method references must point to a Component implementation class
method, and take as argument a Component and a Bundle.
*
+ * @param <T> the type of the component instance class on which the
callback is invoked.
* @param add the method reference invoked when a bundle is added.
* @param change the method reference invoked when a bundle has changed.
* @param remove the method reference invoked when a bundle is removed.
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleDependencyBuilder.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleDependencyBuilder.java?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleDependencyBuilder.java
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleDependencyBuilder.java
Fri Jan 29 23:57:17 2016
@@ -15,7 +15,7 @@ import org.osgi.framework.Bundle;
*
* Example that uses a Bundle Dependency:
*
- * <blockquote><pre>
+ * <pre> {@code
* public class Activator extends DependencyManagerActivator {
* public void activate() throws Exception {
* component(comp -> comp
@@ -23,7 +23,8 @@ import org.osgi.framework.Bundle;
* .withBundle(b -> b.filter("(Bundle-SymbolicName=" + BSN +
")").cb(MyComponent::add, MyComponent::remove)));
*
* }
- * } </pre></blockquote>
+ * }
+ * } </pre>
*
* @author <a href="mailto:[email protected]">Felix Project Team</a>
*/
@@ -56,7 +57,6 @@ public interface BundleDependencyBuilder
/**
* Sets the dependency to be required.
*
- * @param required <code>true</code> if this bundle dependency is required
* @return the bundle dependency builder
*/
public BundleDependencyBuilder required();
@@ -128,24 +128,24 @@ public interface BundleDependencyBuilder
/**
* Sets some <code>callback</code> methods to invoke on the component
instance(s). When a bundle state matches the bundle
- * adapter filter, then the bundle is injected using the specified
callback methods. When you specify one callback, it stands for the "add"
callback.
+ * filter, then the bundle is injected using the specified callback
methods. When you specify one callback, it stands for the "add" callback.
* When you specify two callbacks, the first one corresponds to the "add"
callback, and the second one to the "remove" callback. When you specify three
* callbacks, the first one stands for the "add" callback, the second one
for the "change" callback, and the third one for the "remove" callback.
*
- * @param callbacks a list of callbacks (1 param -> "add", 2 params ->
"add"/remove", 3 params -> "add"/"change"/"remove" callbacks).
+ * @param callbacks a list of callbacks (1 param: "add", 2 params:
"add"/remove", 3 params: "add"/"change"/"remove" callbacks).
* @return this builder
*/
BundleDependencyBuilder cb(String ... callbacks);
/**
* Sets some <code>callback instance</code> methods to invoke on a given
Object instance. When a bundle state matches the bundle
- * adapter filter, then the bundle is injected using the specified
callback methods. When you specify one callback, it stands for the "add"
callback.
+ * filter, then the bundle is injected using the specified callback
methods. When you specify one callback, it stands for the "add" callback.
* When you specify two callbacks, the first one corresponds to the "add"
callback, and the second one to the "remove" callback.
* When you specify three callbacks, the first one stands for the "add"
callback, the second one for the "change" callback, and the third one for
* the "remove" callback.
*
* @param callbackInstance the Object instance where the callbacks are
invoked on
- * @param callbacks a list of callbacks (1 param -> "add", 2 params ->
"add"/remove", 3 params -> "add"/"change"/"remove" callbacks).
+ * @param callbacks a list of callbacks (1 param: "add", 2 params:
"add/remove", 3 params: "add/change/remove" callbacks).
* @return this builder
*/
BundleDependencyBuilder cb(Object callbackInstance, String ... callbacks);
@@ -154,6 +154,7 @@ public interface BundleDependencyBuilder
* Sets a <code>callback</code> java8 method reference which is invoked
when a bundle is added.
* The method reference must point to a Component implementation class
method, and take as argument a Bundle.
*
+ * @param <T> the type of the component implementation class on which the
callback is invoked on.
* @param add the method reference invoked when a bundle is added.
* @return this builder
*/
@@ -163,6 +164,7 @@ public interface BundleDependencyBuilder
* Sets some <code>callback</code> java8 method references which are
invoked when a bundle is added, or removed.
* The method references must point to a Component implementation class
method, and take as argument a Bundle.
*
+ * @param <T> the type of the component implementation class on which the
callback is invoked on.
* @param add the method reference invoked when a bundle is added.
* @param remove the method reference invoked when a bundle is removed.
* @return this builder
@@ -173,6 +175,7 @@ public interface BundleDependencyBuilder
* Sets some <code>callback</code> java8 method references which are
invoked when a bundle is added, changed or removed.
* The method references must point to a Component implementation class
method, and take as argument a Bundle.
*
+ * @param <T> the type of the component implementation class on which the
callback is invoked on.
* @param add the method reference invoked when a bundle is added.
* @param change the method reference invoked when a bundle has changed.
* @param remove the method reference invoked when a bundle is removed.
@@ -184,6 +187,7 @@ public interface BundleDependencyBuilder
* Sets a <code>callback</code> java8 method reference which is invoked
when a bundle is added.
* The method reference must point to a Component implementation class
method, and take as argument a Component and a Bundle.
*
+ * @param <T> the type of the component implementation class on which the
callback is invoked on.
* @param add the method reference invoked when a bundle is added.
* @return this builder
*/
@@ -193,6 +197,7 @@ public interface BundleDependencyBuilder
* Sets some <code>callback</code> java8 method references which are
invoked when a bundle is added, or removed.
* The method references must point to a Component implementation class
method, and take as argument a Component and a Bundle.
*
+ * @param <T> the type of the component implementation class on which the
callback is invoked on.
* @param add the method reference invoked when a bundle is added.
* @param remove the method reference invoked when a bundle is removed.
* @return this builder
@@ -203,6 +208,7 @@ public interface BundleDependencyBuilder
* Sets some <code>callback</code> java8 method references which are
invoked when a bundle is added, changed or removed.
* The method references must point to a Component implementation class
method, and take as argument a Component and a Bundle.
*
+ * @param <T> the type of the component implementation class on which the
callback is invoked on.
* @param add the method reference invoked when a bundle is added.
* @param change the method reference invoked when a bundle has changed.
* @param remove the method reference invoked when a bundle is removed.
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ComponentBuilder.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ComponentBuilder.java?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ComponentBuilder.java
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ComponentBuilder.java
Fri Jan 29 23:57:17 2016
@@ -18,12 +18,13 @@ import org.apache.felix.dm.lambda.callba
* <p> Example of a component that depends on a ConfigurationAdmin service.
The dependency is injected by reflection
* on a class field which type matches the ConfigurationAdmin interface:
*
- * <blockquote><pre>
+ * <pre>{@code
* public class Activator extends DependencyManagerActivator {
* public void activate() throws Exception {
* component(comp ->
comp.impl(Configurator.class).withSrv(ConfigurationAdmin.class));
* }
- * } </pre></blockquote>
+ * }
+ * } </pre>
*
* @param <B> the type of a builder that may extends this builder interface
(aspect/adapter).
* @author <a href="mailto:[email protected]">Felix Project Team</a>
@@ -31,10 +32,11 @@ import org.apache.felix.dm.lambda.callba
public interface ComponentBuilder<B extends ComponentBuilder<B>> {
/**
* Configures the component implementation. Can be a class name, or a
component implementation object.
+ *
* @param impl the component implementation (a class, or an Object).
* @return this builder
*/
- <U> B impl(U impl);
+ B impl(Object impl);
/**
* Sets the factory to use to create the implementation. You can specify
both the factory class and method to invoke. The method should return the
implementation,
@@ -49,12 +51,16 @@ public interface ComponentBuilder<B exte
/**
* Configures a factory that can be used to create this component
implementation.
- * Example: "factory(ComponentImpl::new)", or "factory(() -> new
ComponentImpl())".
+ * Example:
+ *
+ * <pre> {@code
+ * factory(ComponentImpl::new)", or "factory(() -> new ComponentImpl())
+ * }</pre>
*
* @param create the factory used to create the component implementation.
* @return this builder
*/
- <U> B factory(Supplier<U> create);
+ B factory(Supplier<?> create);
/**
* Configures a factory used to create this component implementation using
a Factory object and a method in the Factory object.
@@ -62,6 +68,8 @@ public interface ComponentBuilder<B exte
*
* factory(Factory::new, Factory::create)
*
+ * @param <U> the type of the factory returned by the supplier
+ * @param <V> the type of the object that is returned by the factory
create method.
* @param factory the function used to create the Factory itself
* @param create the method reference on the Factory method that is used
to create the Component implementation
* @return this builder
@@ -78,11 +86,11 @@ public interface ComponentBuilder<B exte
* ...
* factory(mngr::create, mngr::getComposition)
*
- * @param factory
- * @param getComposition
+ * @param factory the supplier used to return the main component
implementation instance
+ * @param getComposition the supplier that returns the list of instances
that are part of the component implementation classes.
* @return this builder
*/
- <U> B factory(Supplier<U> factory, Supplier<Object[]> getComposition);
+ B factory(Supplier<?> factory, Supplier<Object[]> getComposition);
/**
* Configures a factory that also returns a composition of objects for
this component implemenation.
@@ -94,15 +102,17 @@ public interface ComponentBuilder<B exte
* Here, the CompositionManager will act as a factory (the create method
will return the component implementation object), and the
* CompositionManager.getComposition() method will return all the objects
that are also part of the component implementation.
*
+ * @param <U> the type of the object returned by the supplier factory
* @param factory the function used to create the Factory itself
* @param create the Factory method used to create the main component
implementation object
* @param getComposition the Factory method used to return the list of
objects that are also part of the component implementation.
* @return this builder
*/
- <U, V> B factory(Supplier<U> factory, Function<U, V> create, Function<U,
Object[]> getComposition);
+ <U> B factory(Supplier<U> factory, Function<U, ?> create, Function<U,
Object[]> getComposition);
/**
* Sets the public interfaces under which this component should be
registered in the OSGi service registry.
+ *
* @param iface the public interfaces to register in the OSGI service
registry.
* @return this builder
*/
@@ -121,16 +131,17 @@ public interface ComponentBuilder<B exte
/**
* Sets the public interface under which this component should be
registered in the OSGi service registry.
+ * Warning: you can only use this method if you compile your application
using the "-parameters" javac option.
+ *
+ * code example:
+ *
+ * {@code
+ * provides(MyService.class, property1 -> "value1", property2 -> 123);
+ * }
+ *
* @param iface the public interfaces to register in the OSGI service
registry.
* @param properties a list of fluent service properties for the
provided service. You can specify a list of lambda expression, each one
implementing the
* {@link FluentProperties} interface that allows to define a property
name using a lambda parameter.
- *
- * Warning: you can only use this method if you compile your
application using the "-parameters" javac option.
- *
- * code example:
- *
- * provides(MyService.class, property1 -> "value1", property2 -> 123);
- *
* @return this builder.
*/
B provides(Class<?> iface, FluentProperties ... properties);
@@ -145,6 +156,8 @@ public interface ComponentBuilder<B exte
/**
* Sets the public interfaces under which this component should be
registered in the OSGi service registry.
+ *
+ * @param ifaces list of services provided by the component.
* @return this builder.
*/
B provides(Class<?>[] ifaces);
@@ -152,7 +165,7 @@ public interface ComponentBuilder<B exte
/**
* Sets the public interfaces under which this component should be
registered in the OSGi service registry.
*
- * @param iface the public interfaces to register in the OSGI service
registry.
+ * @param ifaces the public interfaces to register in the OSGI service
registry.
* @param name a property name for the provided service
* @param value a property value for the provided service
* @param rest the rest of property name/value pairs.
@@ -162,23 +175,23 @@ public interface ComponentBuilder<B exte
/**
* Sets the public interfaces under which this component should be
registered in the OSGi service registry.
- * @param iface the public interfaces to register in the OSGI service
registry.
- * @param properties a list of fluent service properties for the provided
service. You can specify a list of lambda expression, each one implementing the
- * {@link FluentProperties} interface that allows to define a property
name using a lambda parameter.
- *
- * Warning: you can only use this method if you compile your application
using the "-parameters" javac option.
- *
+ * Warning: you can only use this method if you compile your application
using the "-parameters" javac option.
* code example:
*
- * provides(new Class[] { MyService.class, MyService2.class }, property1
-> "value1", property2 -> 123);
+ * <pre> {@code
+ * provides(new Class[] { MyService.class, MyService2.class },
property1 -> "value1", property2 -> 123);
+ * }</pre>
*
+ * @param ifaces the public interfaces to register in the OSGI service
registry.
+ * @param properties a list of fluent service properties for the provided
service. You can specify a list of lambda expression, each one implementing the
+ * {@link FluentProperties} interface that allows to define a property
name using a lambda parameter.
* @return this builder.
*/
B provides(Class<?>[] ifaces, FluentProperties ... properties);
/**
* Sets the public interfaces under which this component should be
registered in the OSGi service registry.
- * @param iface the public interfaces to register in the OSGI service
registry.
+ * @param ifaces the public interfaces to register in the OSGI service
registry.
* @param properties the properties for the provided service
* @return this builder.
*/
@@ -186,6 +199,8 @@ public interface ComponentBuilder<B exte
/**
* Sets the public interface under which this component should be
registered in the OSGi service registry.
+ *
+ * @param iface the service provided by this component.
* @return this builder.
*/
B provides(String iface);
@@ -202,17 +217,17 @@ public interface ComponentBuilder<B exte
B provides(String iface, String name, Object value, Object ... rest);
/**
- * Sets the public interface under which this component should be
registered in the OSGi service registry.
- * @param iface the public interfaces to register in the OSGI service
registry.
- * @param properties a list of fluent service properties for the provided
service. You can specify a list of lambda expression, each one implementing the
- * {@link FluentProperties} interface that allows to define a property
name using a lambda parameter.
- *
+ * Sets the public interface under which this component should be
registered in the OSGi service registry.
* Warning: you can only use this method if you compile your application
using the "-parameters" javac option.
- *
* code example:
*
+ * <pre> {@code
* provides(MyService.class, property1 -> "value1", property2 -> 123);
+ * }</pre>
*
+ * @param iface the public interfaces to register in the OSGI service
registry.
+ * @param properties a list of fluent service properties for the provided
service. You can specify a list of lambda expression, each one implementing the
+ * {@link FluentProperties} interface that allows to define a property
name using a lambda parameter.
* @return this builder.
*/
B provides(String iface, FluentProperties ... properties);
@@ -227,6 +242,8 @@ public interface ComponentBuilder<B exte
/**
* Sets the public interfaces under which this component should be
registered in the OSGi service registry.
+ *
+ * @param ifaces the list of services provided by the component.
* @return this builder.
*/
B provides(String[] ifaces);
@@ -234,7 +251,7 @@ public interface ComponentBuilder<B exte
/**
* Sets the public interfaces under which this component should be
registered in the OSGi service registry.
*
- * @param iface the public interfaces to register in the OSGI service
registry.
+ * @param ifaces the public interfaces to register in the OSGI service
registry.
* @param name a property name for the provided service
* @param value a property value for the provided service
* @param rest the rest of property name/value pairs.
@@ -244,23 +261,23 @@ public interface ComponentBuilder<B exte
/**
* Sets the public interfaces under which this component should be
registered in the OSGi service registry.
- * @param iface the public interfaces to register in the OSGI service
registry.
- * @param properties a list of fluent service properties for the provided
service. You can specify a list of lambda expression, each one implementing the
- * {@link FluentProperties} interface that allows to define a property
name using a lambda parameter.
- *
* Warning: you can only use this method if you compile your application
using the "-parameters" javac option.
*
* code example:
- *
+ * <pre> {@code
* provides(new Class[] { MyService.class, MyService2.class }, property1
-> "value1", property2 -> 123);
- *
+ * }</pre>
+ *
+ * @param ifaces the public interfaces to register in the OSGI service
registry.
+ * @param properties a list of fluent service properties for the provided
service. You can specify a list of lambda expression, each one implementing the
+ * {@link FluentProperties} interface that allows to define a property
name using a lambda parameter.
* @return this builder.
*/
B provides(String[] ifaces, FluentProperties ... properties);
/**
* Sets the public interfaces under which this component should be
registered in the OSGi service registry.
- * @param iface the public interfaces to register in the OSGI service
registry.
+ * @param ifaces the public interfaces to register in the OSGI service
registry.
* @param properties the properties for the provided service
* @return this builder.
*/
@@ -275,39 +292,53 @@ public interface ComponentBuilder<B exte
/**
* Sets the components's service properties using varargs. The number of
parameters must be even, representing a list of pair property key-value.
- * @param properties a varargs representing a list of key-value pairs.
*
* Example: properties("param1", "value1", "service.ranking", 3)
+ *
+ * @param name the first property name
+ * @param value the first property value
+ * @param rest the rest of properties key/value pairs.
* @return this builder
*/
B properties(String name, Object value, Object ... rest);
/**
* Sets the components's service properties using List of lamda
properties.
+ *
+ * Example:
+ *
+ * <pre> {@code
+ * properties(param1 -> "value1, param2 -> 2);
+ * }</pre>
+ *
* When you use this method, you must compile your source code using the
"-parameters" option, and the "arg0" parameter
* name is now allowed.
- *
- * Example: properties(param1 -> "value1, param2 -> 2);
+ *
+ * @param properties the fluent properties
* @return this builder
*/
B properties(FluentProperties ... properties);
/**
* Adds a required/autoconfig service dependency.
+ *
* @param service the service dependency filter
+ * @param filter the service filter
* @return this builder
*/
B withSrv(Class<?> service, String filter);
/**
* Adds a required/autoconfig service dependency.
- * @param service the dependency that is required and that will be
injected in any field with the same dependency type.
+ * @param services the dependencies that are required and that will be
injected in any field with the same dependency type.
* @return this builder
*/
B withSrv(Class<?> ... services);
/**
* Adds a service dependency.
+ *
+ * @param <U> the type of the dependency service
* @param service the service
* @param consumer the lambda for building the service dependency
* @return this builder.
@@ -352,6 +383,8 @@ public interface ComponentBuilder<B exte
/**
* Adds a CompletableFuture dependency.
+ *
+ * @param <U> the type of the result of the CompletableFuture.
* @param future a CompletableFuture on which the dependency will wait for
* @param consumer the builder used to build the dependency
* @return this builder.
@@ -371,7 +404,7 @@ public interface ComponentBuilder<B exte
* <li>method()</li>
* </ol>
*
- * @param callback the name of the init method
+ * @param callback the callback name
* @return this builder.
*/
B init(String callback);
@@ -386,7 +419,7 @@ public interface ComponentBuilder<B exte
* <li>method()</li>
* </ol>
*
- * @param init the name of the init method
+ * @param callback the callback name
* @return this builder.
*/
B start(String callback);
@@ -401,7 +434,7 @@ public interface ComponentBuilder<B exte
* <li>method()</li>
* </ol>
*
- * @param init the name of the init method
+ * @param callback the callback name
* @return this builder.
*/
B stop(String callback);
@@ -416,7 +449,7 @@ public interface ComponentBuilder<B exte
* <li>method()</li>
* </ol>
*
- * @param init the name of the init method
+ * @param callback the callback name
* @return this builder.
*/
B destroy(String callback);
@@ -430,8 +463,10 @@ public interface ComponentBuilder<B exte
* that will be invoked whenever the life cycle of a component changes and
this manager
* can then decide how to expose this life cycle to the actual component,
offering an
* important indirection when developing your own component models.
+ *
* @see #init(String)
- * @param callback the name of the init method
+ * @param callbackInstance the instance the callback will be invoked on.
+ * @param callback the callback name
* @return this builder.
*/
B init(Object callbackInstance, String callback);
@@ -445,7 +480,9 @@ public interface ComponentBuilder<B exte
* that will be invoked whenever the life cycle of a component changes and
this manager
* can then decide how to expose this life cycle to the actual component,
offering an
* important indirection when developing your own component models.
+ *
* @see #start(String)
+ * @param callbackInstance the instance the callback will be invoked on.
* @param callback the name of the start method
* @return this builder.
*/
@@ -460,7 +497,9 @@ public interface ComponentBuilder<B exte
* that will be invoked whenever the life cycle of a component changes and
this manager
* can then decide how to expose this life cycle to the actual component,
offering an
* important indirection when developing your own component models.
+ *
* @see #stop(String)
+ * @param callbackInstance the instance the callback will be invoked on.
* @param callback the name of the stop method
* @return this builder.
*/
@@ -475,7 +514,9 @@ public interface ComponentBuilder<B exte
* that will be invoked whenever the life cycle of a component changes and
this manager
* can then decide how to expose this life cycle to the actual component,
offering an
* important indirection when developing your own component models.
+ *
* @see #destroy(String)
+ * @param callbackInstance the instance the callback will be invoked on.
* @param callback the name of the destroy method
* @return this builder.
*/
@@ -489,6 +530,7 @@ public interface ComponentBuilder<B exte
* And once all extra dependencies will be available and injected, then
the "start" callback will be invoked.
* The method does not take any parameters.
*
+ * @param <U> the type of the component class on which the callback is
invoked on.
* @param callback a method reference must point to method from one of the
component instance classes.
* @return this builder
*/
@@ -498,6 +540,7 @@ public interface ComponentBuilder<B exte
* Sets a method reference used as the "start" callback. This method
reference must point to method from one
* of the component instance classes. This method is invoked as part of
the life cycle management of the component implementation.
*
+ * @param <U> the type of the component class on which the callback is
invoked on.
* @param callback a method reference must point to method from one of
the component instance classes.
* @return this builder.
*/
@@ -507,6 +550,7 @@ public interface ComponentBuilder<B exte
* Sets a method reference used as the "stop" callback. This method
reference must point to method from one
* of the component instance classes. This method is invoked as part of
the life cycle management of the component implementation.
*
+ * @param <U> the type of the component class on which the callback is
invoked on.
* @param callback a method reference must point to method from one of
the component instance classes.
* @return this builder.
*/
@@ -516,6 +560,7 @@ public interface ComponentBuilder<B exte
* Sets a method reference used as the "destroy" callback. This method
reference must point to method from one
* of the component instance classes. This method is invoked as part of
the life cycle management of the component implementation.
*
+ * @param <U> the type of the component class on which the callback is
invoked on.
* @param callback a method reference must point to method from one of
the component instance classes.
* @return this builder.
*/
@@ -529,6 +574,7 @@ public interface ComponentBuilder<B exte
* And once all extra dependencies will be available and injected, then
the "start" callback will be invoked.
* The method takes as argument a Component parameter.
*
+ * @param <U> the type of the component class on which the callback is
invoked on.
* @param callback a method reference must point to method from one of the
component instance classes. The method takes as argument a Component parameter.
* @return this builder
*/
@@ -538,7 +584,8 @@ public interface ComponentBuilder<B exte
* Sets a method reference used as the "start" callback. This method
reference must point to method from one
* of the component instance classes. This method is invoked as part of
the life cycle management of the component implementation.
* The method takes as argument a Component parameter.
- *
+ *
+ * @param <U> the type of the component class on which the callback is
invoked on.
* @param callback a method reference must point to method from one of the
component instance classes. The method takes as argument a Component parameter.
* @return this builder.
*/
@@ -548,7 +595,8 @@ public interface ComponentBuilder<B exte
* Sets a method reference used as the "stop" callback. This method
reference must point to method from one
* of the component instance classes. This method is invoked as part of
the life cycle management of the component implementation.
* The method takes as argument a Component parameter.
- *
+ *
+ * @param <U> the type of the component class on which the callback is
invoked on.
* @param callback a method reference must point to method from one of the
component instance classes. The method takes as argument a Component parameter.
* @return this builder.
*/
@@ -558,7 +606,8 @@ public interface ComponentBuilder<B exte
* Sets a method reference used as the "destroy" callback. This method
reference must point to method from one
* of the component instance classes. This method is invoked as part of
the life cycle management of the component implementation.
* The method takes as argument a Component parameter.
- *
+ *
+ * @param <U> the type of the component class on which the callback is
invoked on.
* @param callback a method reference must point to method from one of the
component instance classes. The method takes as argument a Component parameter.
* @return this builder.
*/
@@ -662,7 +711,7 @@ public interface ComponentBuilder<B exte
* @param autoConfig true if the OSGi object has to be injected, false if
not
* @return this builder
*/
- <U> B autoConfig(Class<U> clazz, boolean autoConfig);
+ B autoConfig(Class<?> clazz, boolean autoConfig);
/**
* Configures OSGi object (BundleContext, Component, etc ...) that will be
injected in a given field.
@@ -670,7 +719,7 @@ public interface ComponentBuilder<B exte
* @param field the field that will be injected with the OSGI object
* @return this builder
*/
- <U> B autoConfig(Class<U> clazz, String field);
+ B autoConfig(Class<?> clazz, String field);
/**
* Activates debug mode
@@ -698,7 +747,7 @@ public interface ComponentBuilder<B exte
* All of them will be searched for any of the dependencies. The method
that
* is invoked must return an <code>Object[]</code>.
*
- * @param getMethod the method to invoke
+ * @param getCompositionMethod the method to invoke
* @return this builder
*/
B composition(String getCompositionMethod);
@@ -710,7 +759,7 @@ public interface ComponentBuilder<B exte
* invoked must return an <code>Object[]</code>.
*
* @param instance the instance that has the method
- * @param getMethod the method to invoke
+ * @param getCompositionMethod the method to invoke
* @return this builder
*/
B composition(Object instance, String getCompositionMethod);
@@ -720,7 +769,7 @@ public interface ComponentBuilder<B exte
* All of them will be searched for any of the dependencies. The method
that
* is invoked must return an <code>Object[]</code>.
*
- * @param getMethod the method to invoke
+ * @param getCompositionMethod the method to invoke
* @return this builder
*/
B composition(Supplier<Object[]> getCompositionMethod);
Modified:
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FutureDependencyBuilder.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FutureDependencyBuilder.java?rev=1727666&r1=1727665&r2=1727666&view=diff
==============================================================================
---
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FutureDependencyBuilder.java
(original)
+++
felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FutureDependencyBuilder.java
Fri Jan 29 23:57:17 2016
@@ -7,7 +7,7 @@ import org.apache.felix.dm.lambda.callba
import org.apache.felix.dm.lambda.callbacks.CbTypeFuture;
/**
- * Defines a builder for CompletableFuture required dependency.
+ * Defines a builder for a CompletableFuture dependency.
* Using such dependency allows your component to wait for the completion of a
given asynchronous task
* represented by a standard jdk <code>CompletableFuture</code> object;
*
@@ -15,9 +15,9 @@ import org.apache.felix.dm.lambda.callba
*
* <h3>Usage Examples</h3>
*
- * <p> Here is an Activator that downloads a page from the web and inject the
string result to a component.
+ * <p> Here is an Activator that downloads a page from the web and injects the
string result to a component.
* When the web page is downloaded, the result is injected in the
MyComponent::setPage method and
- * the component is then called in its start method:
+ * the component is then called in its "start" method:
*
* <pre> {@code
*