JBoss Modular Service Kernel API 1.0.0.Beta1

org.jboss.msc.service
Interface BatchBuilder


public interface BatchBuilder

A batch builder for installing service definitions in a single action. Create an instance via the ServiceContainer.batchBuilder() method.


Method Summary
 BatchBuilder addDependency(Collection<ServiceName> dependencies)
          Add a collection of dependencies that will be added to the all the ServiceDefinitions in the batch.
 BatchBuilder addDependency(ServiceName... dependencies)
          Add a list of dependencies that will be added to the all the ServiceDefinitions in the batch.
 BatchBuilder addDependency(ServiceName dependency)
          Add a dependency that will be added to the all the ServiceDefinitions in the batch.
 BatchBuilder addListener(Collection<ServiceListener<Object>> listeners)
          Add a collection of service listener that will be added to the all the ServiceDefinitions in the batch.
 BatchBuilder addListener(ServiceListener<Object>... listeners)
          Add a list of service listener that will be added to the all the ServiceDefinitions in the batch.
 BatchBuilder addListener(ServiceListener<Object> listener)
          Add a service listener that will be added to the all the ServiceDefinitions in the batch.
<T> BatchServiceBuilder<T>
addService(ServiceName name, Service<T> service)
          Get a builder which can be used to add a service to this batch.
<T> BatchServiceBuilder<T>
addServiceValue(ServiceName name, Value<? extends Service<T>> value)
          Get a builder which can be used to add a service to this batch.
<T> BatchServiceBuilder<T>
addServiceValueIfNotExist(ServiceName name, Value<? extends Service<T>> value)
          Get a builder which can be used to add a service to this batch which is installed only if another service with the same name does not already exist.
 void install()
          Install all the defined services into the container.
 BatchBuilder subBatchBuilder()
          Create a sub-batch using this as the parent batch.
 

Method Detail

addServiceValue

<T> BatchServiceBuilder<T> addServiceValue(ServiceName name,
                                           Value<? extends Service<T>> value)
                                       throws IllegalArgumentException
Get a builder which can be used to add a service to this batch.

Parameters:
name - the service name
value - the service value
Returns:
the builder for the service
Throws:
IllegalArgumentException

addService

<T> BatchServiceBuilder<T> addService(ServiceName name,
                                      Service<T> service)
                                  throws IllegalArgumentException
Get a builder which can be used to add a service to this batch.

Parameters:
name - the service name
service - the service
Returns:
the builder for the service
Throws:
IllegalArgumentException

addServiceValueIfNotExist

<T> BatchServiceBuilder<T> addServiceValueIfNotExist(ServiceName name,
                                                     Value<? extends Service<T>> value)
                                                 throws IllegalArgumentException
Get a builder which can be used to add a service to this batch which is installed only if another service with the same name does not already exist. The provided value should return the same result every time (see Values.cached(Value) for more information). Note that any provided aliases must not exist previously if the service is installed, or an error will occur.

Parameters:
name - the service name
value - the service value
Returns:
the builder for the service
Throws:
IllegalArgumentException

addListener

BatchBuilder addListener(ServiceListener<Object> listener)
Add a service listener that will be added to the all the ServiceDefinitions in the batch.

Parameters:
listener - the listener to add to the batch
Returns:
this batch

addListener

BatchBuilder addListener(ServiceListener<Object>... listeners)
Add a list of service listener that will be added to the all the ServiceDefinitions in the batch.

Parameters:
listeners - a list of listeners to add to the batch
Returns:
this batch

addListener

BatchBuilder addListener(Collection<ServiceListener<Object>> listeners)
Add a collection of service listener that will be added to the all the ServiceDefinitions in the batch.

Parameters:
listeners - a collection of listeners to add to the batch
Returns:
this batch

addDependency

BatchBuilder addDependency(ServiceName dependency)
Add a dependency that will be added to the all the ServiceDefinitions in the batch.

Parameters:
dependency - the dependency to add to the batch
Returns:
this batch

addDependency

BatchBuilder addDependency(ServiceName... dependencies)
Add a list of dependencies that will be added to the all the ServiceDefinitions in the batch.

Parameters:
dependencies - a list of dependencies to add to the batch
Returns:
this batch

addDependency

BatchBuilder addDependency(Collection<ServiceName> dependencies)
Add a collection of dependencies that will be added to the all the ServiceDefinitions in the batch.

Parameters:
dependencies - a collection of dependencies to add to the batch
Returns:
this batch

install

void install()
             throws ServiceRegistryException
Install all the defined services into the container.

Throws:
ServiceRegistryException

subBatchBuilder

BatchBuilder subBatchBuilder()
Create a sub-batch using this as the parent batch.

Returns:
a new BatchBuilder

JBoss Modular Service Kernel API 1.0.0.Beta1

Copyright © 2010 JBoss, a division of Red Hat, Inc.