org.qi4j.api.composite
Interface TransientBuilderFactory


public interface TransientBuilderFactory

This factory creates TransientComposites and the TransientBuilders. TransientComposite instances are very flexible in what it can reference, but are restricted in where they can be used. So, TransientComposites are mainly recommended where Values, Entities and Services can not be used, but they can also not be used to store state, be serialized across a network or have automatic equals/hashCode calculations.


Method Summary
<T> T
newTransient(Class<T> mixinType)
          Instantiate a TransientComposite of the given type.
<T> TransientBuilder<T>
newTransientBuilder(Class<T> mixinType)
          Create a builder for creating new TransientComposites that implements the given TransientComposite type.
 

Method Detail

newTransientBuilder

<T> TransientBuilder<T> newTransientBuilder(Class<T> mixinType)
                                        throws NoSuchCompositeException
Create a builder for creating new TransientComposites that implements the given TransientComposite type.

Parameters:
mixinType - an interface that describes the TransientComposite to be instantiated
Returns:
a TransientBuilder for creation of TransientComposites implementing the interface
Throws:
NoSuchCompositeException - if no composite extending the mixinType has been registered

newTransient

<T> T newTransient(Class<T> mixinType)
               throws NoSuchCompositeException,
                      ConstructionException
Instantiate a TransientComposite of the given type.

Parameters:
mixinType - the TransientComposite type to instantiate
Returns:
a new TransientComposite instance
Throws:
NoSuchCompositeException - if no composite extending the mixinType has been registered
ConstructionException - if the composite could not be instantiated