org.apache.hivemind.lib
Interface BeanFactory

All Known Implementing Classes:
BeanFactoryImpl

public interface BeanFactory

Service interface for a source of beans of a particular type. Bean instances are retrieved using a locator string which is of the form: name[,initializer]. That is, an optional initializer is may be specified, separated by a comma.

Beans may be cached or not.

The hivemind.lib.BeanFactoryBuilder service is used to create services implementing this interface (driven from a configuration).

Author:
Howard Lewis Ship

Method Summary
 boolean contains(java.lang.String locator)
          Returns true if a bean matching the provided locator has been defined.
 java.lang.Object get(java.lang.String locator)
          Gets a bean via its locator (it's name plus, optionally, an initializer).
 

Method Detail

contains

boolean contains(java.lang.String locator)
Returns true if a bean matching the provided locator has been defined.

Parameters:
locator - the name or name and initializer
Returns:
true if a bean matching the provided locator has ben defined

get

java.lang.Object get(java.lang.String locator)
Gets a bean via its locator (it's name plus, optionally, an initializer).

Parameters:
locator - the name or name and initializer
Returns:
a bean instance
Throws:
org.apache.hivemind.ApplicationRuntimeException - if no bean matching the provided name has been defined.