org.ops4j.peaberry.internal
Class ServiceBuilderImpl<T>

java.lang.Object
  extended by org.ops4j.peaberry.internal.ServiceBuilderImpl<T>
All Implemented Interfaces:
DecoratedServiceBuilder<T>, InjectedServiceBuilder<T>, OutjectedServiceBuilder<T>, QualifiedServiceBuilder<T>, ServiceBuilder<T>

public final class ServiceBuilderImpl<T>
extends Object
implements DecoratedServiceBuilder<T>

Default DecoratedServiceBuilder implementation.

Author:
mcculls@gmail.com (Stuart McCulloch)

Constructor Summary
ServiceBuilderImpl(com.google.inject.Key<T> key)
           
ServiceBuilderImpl(T instance)
           
 
Method Summary
 ServiceBuilderImpl<T> attributes(com.google.inject.Key<? extends Map<String,?>> key)
          Apply the given attributes to the dynamic service.
 ServiceBuilderImpl<T> attributes(Map<String,?> instance)
          Apply the given attributes to the dynamic service.
 ServiceBuilderImpl<T> decoratedWith(ImportDecorator<? super T> instance)
          Apply the given decoration to the dynamic service.
 ServiceBuilderImpl<T> decoratedWith(com.google.inject.Key<? extends ImportDecorator<? super T>> key)
          Apply the given decoration to the dynamic service.
 ExportProvider<T> export()
           
 ServiceBuilderImpl<T> filter(AttributeFilter instance)
          Apply the given filter to the dynamic service.
 ServiceBuilderImpl<T> filter(com.google.inject.Key<? extends AttributeFilter> key)
          Apply the given filter to the dynamic service.
 ServiceBuilderImpl<T> in(com.google.inject.Key<? extends ServiceRegistry> key)
          Inject the dynamic service from a specific registry.
 ServiceBuilderImpl<T> in(ServiceRegistry instance)
          Inject the dynamic service from a specific registry.
 ProxyProvider<Iterable<T>> multiple()
           
 ServiceBuilderImpl<T> out(com.google.inject.Key<? extends ServiceWatcher<? super T>> key)
          Outject the dynamic service to the given watcher.
 ServiceBuilderImpl<T> out(ServiceWatcher<? super T> instance)
          Outject the dynamic service to the given watcher.
 ProxyProvider<T> single()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceBuilderImpl

public ServiceBuilderImpl(com.google.inject.Key<T> key)

ServiceBuilderImpl

public ServiceBuilderImpl(T instance)
Method Detail

decoratedWith

public ServiceBuilderImpl<T> decoratedWith(com.google.inject.Key<? extends ImportDecorator<? super T>> key)
Description copied from interface: DecoratedServiceBuilder
Apply the given decoration to the dynamic service.

Specified by:
decoratedWith in interface DecoratedServiceBuilder<T>
Parameters:
key - decorator key
Returns:
dynamic service builder

decoratedWith

public ServiceBuilderImpl<T> decoratedWith(ImportDecorator<? super T> instance)
Description copied from interface: DecoratedServiceBuilder
Apply the given decoration to the dynamic service.

Specified by:
decoratedWith in interface DecoratedServiceBuilder<T>
Parameters:
instance - decorator
Returns:
dynamic service builder

attributes

public ServiceBuilderImpl<T> attributes(com.google.inject.Key<? extends Map<String,?>> key)
Description copied from interface: QualifiedServiceBuilder
Apply the given attributes to the dynamic service.

Specified by:
attributes in interface QualifiedServiceBuilder<T>
Parameters:
key - service attributes key
Returns:
dynamic service builder

attributes

public ServiceBuilderImpl<T> attributes(Map<String,?> instance)
Description copied from interface: QualifiedServiceBuilder
Apply the given attributes to the dynamic service.

Specified by:
attributes in interface QualifiedServiceBuilder<T>
Parameters:
instance - service attributes
Returns:
dynamic service builder

filter

public ServiceBuilderImpl<T> filter(com.google.inject.Key<? extends AttributeFilter> key)
Description copied from interface: QualifiedServiceBuilder
Apply the given filter to the dynamic service.

Specified by:
filter in interface QualifiedServiceBuilder<T>
Parameters:
key - attribute filter key
Returns:
dynamic service builder

filter

public ServiceBuilderImpl<T> filter(AttributeFilter instance)
Description copied from interface: QualifiedServiceBuilder
Apply the given filter to the dynamic service.

Specified by:
filter in interface QualifiedServiceBuilder<T>
Parameters:
instance - attribute filter
Returns:
dynamic service builder

in

public ServiceBuilderImpl<T> in(com.google.inject.Key<? extends ServiceRegistry> key)
Description copied from interface: InjectedServiceBuilder
Inject the dynamic service from a specific registry.

Specified by:
in in interface InjectedServiceBuilder<T>
Parameters:
key - service registry key
Returns:
dynamic service builder

in

public ServiceBuilderImpl<T> in(ServiceRegistry instance)
Description copied from interface: InjectedServiceBuilder
Inject the dynamic service from a specific registry.

Specified by:
in in interface InjectedServiceBuilder<T>
Parameters:
instance - service registry
Returns:
dynamic service builder

out

public ServiceBuilderImpl<T> out(com.google.inject.Key<? extends ServiceWatcher<? super T>> key)
Description copied from interface: OutjectedServiceBuilder
Outject the dynamic service to the given watcher.

Specified by:
out in interface OutjectedServiceBuilder<T>
Parameters:
key - service watcher key
Returns:
dynamic service builder

out

public ServiceBuilderImpl<T> out(ServiceWatcher<? super T> instance)
Description copied from interface: OutjectedServiceBuilder
Outject the dynamic service to the given watcher.

Specified by:
out in interface OutjectedServiceBuilder<T>
Parameters:
instance - service watcher
Returns:
dynamic service builder

single

public ProxyProvider<T> single()
Specified by:
single in interface ServiceBuilder<T>
Returns:
single service provider

multiple

public ProxyProvider<Iterable<T>> multiple()
Specified by:
multiple in interface ServiceBuilder<T>
Returns:
multiple service provider

export

public ExportProvider<T> export()
Specified by:
export in interface ServiceBuilder<T>
Returns:
exported service provider


Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.