org.jicarilla.container.builder
Interface Builder

All Known Subinterfaces:
EnterpriseBuilder, HierarchyBuilder
All Known Implementing Classes:
DefaultBuilder

public interface Builder

Provides a convenient way to construct and initialize a Container.

Version:
$Id: Builder.java,v 1.2 2004/01/10 11:39:05 lsimons Exp $
Author:
Leo Simons

Method Summary
 Builder addComponent(java.lang.Object provider)
          Add a new component provider to the container.
 Builder addComponent(java.lang.Object selectionCriterion, java.lang.Object provider)
          Add a new component provider to the container.
 Resolver create()
          Actually create the container instance and populate it with all the providers you have fed to the builder.
 

Method Detail

create

public Resolver create()
                throws java.lang.Exception
Actually create the container instance and populate it with all the providers you have fed to the builder. You may not call any more methods on a Builder instance after you have called this method.

Returns:
a Resolver retrieved from the constructed container.
Throws:
java.lang.Exception - if a problem occurs during the creation or population of the container or during the retrieval of the resolver from the container, or if the builder itself is in an illegal state.

addComponent

public Builder addComponent(java.lang.Object provider)
Add a new component provider to the container.

Parameters:
provider - the provider to add.
Returns:
the current builder instance.

addComponent

public Builder addComponent(java.lang.Object selectionCriterion,
                            java.lang.Object provider)
Add a new component provider to the container.

Parameters:
selectionCriterion - the criterion to apply to the provider when determining what instances it can provide.
provider - the provider to add.
Returns:
the current builder instance.


Copyright © 2004 Leo Simons. All Rights Reserved.