djbeans
Class DJBeansLoader

java.lang.Object
  extended by djbeans.DJBeansLoader

public class DJBeansLoader
extends java.lang.Object

Singleton class to DJBeansFactory.

Version:
1.0 07/08/2008
Author:
Claudio Silveira

Method Summary
 void addPropertyListener(PropertyListener listener, java.lang.String componentPath)
           
static DJBeansLoader getInstance()
          Retrieve the singleton instance of this class.
 PropertyMap getPropertyMap(java.lang.String componentPath)
           
static DJBeansLoader init()
          Initialize the DJBeans Factory.
static DJBeansLoader init(boolean startListenerThread, int sleepSeconds)
          Initialize the DJBeans Factory.
static DJBeansLoader init(java.util.Properties djbeansProperties, boolean startListenerThread, int sleepSeconds)
          Initialize the DJBeans Factory.
 void injectAllProperties(java.lang.Object bean, java.lang.String componentPath)
          Retrieve all properties of the bean and injects into the bean.
 void injectAllProperties(java.lang.Object bean, java.lang.String componentPath, boolean registerListener)
          Retrieve all properties of the bean and injects into the bean.
 void injectProperties(java.lang.Object bean, java.lang.String componentPath)
          Retrieve all properties of the bean and injects into the bean.
 void injectProperties(java.lang.Object bean, java.lang.String componentPath, boolean registerListener)
          Retrieve all properties of the bean and injects into the bean.
 boolean removePropertyListener(PropertyListener listener, java.lang.String componentPath)
           
 void stopListenerThread()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

stopListenerThread

public void stopListenerThread()

init

public static DJBeansLoader init()
                          throws InitException
Initialize the DJBeans Factory. After to call this method, getInstance() can be used to get the singleton instance.

Throws:
InitException - error initializing djbeans via 'djbeans.ini' file.

init

public static DJBeansLoader init(boolean startListenerThread,
                                 int sleepSeconds)
                          throws InitException
Initialize the DJBeans Factory. After to call this method, getInstance() can be used to get the singleton instance.

Parameters:
startListenerThread -
sleepSeconds -
Returns:
Throws:
InitException

init

public static DJBeansLoader init(java.util.Properties djbeansProperties,
                                 boolean startListenerThread,
                                 int sleepSeconds)
                          throws InitException
Initialize the DJBeans Factory. After to call this method, getInstance() can be used to get the singleton instance.

Parameters:
djbeansProperties - The same properties found in 'djbeans.ini' file.
startListenerThread -
sleepSeconds -
Returns:
Throws:
InitException

getInstance

public static DJBeansLoader getInstance()
Retrieve the singleton instance of this class.

Returns:
the singleton instance.

getPropertyMap

public PropertyMap getPropertyMap(java.lang.String componentPath)
                           throws java.sql.SQLException,
                                  NotFoundException
Throws:
java.sql.SQLException
NotFoundException

injectAllProperties

public void injectAllProperties(java.lang.Object bean,
                                java.lang.String componentPath,
                                boolean registerListener)
                         throws InjectException
Retrieve all properties of the bean and injects into the bean.

Parameters:
bean -
componentPath - /folder1/../folderN/componentName
registerListener -
Throws:
InjectException - Any errors on type conversion or on instantiation of the nested bean properties .

injectAllProperties

public void injectAllProperties(java.lang.Object bean,
                                java.lang.String componentPath)
                         throws InjectException
Retrieve all properties of the bean and injects into the bean.

Parameters:
bean -
componentPath - /folder1/../folderN/componentName
Throws:
InjectException - Any errors on type conversion or on instantiation of the nested bean properties .

injectProperties

public void injectProperties(java.lang.Object bean,
                             java.lang.String componentPath,
                             boolean registerListener)
                      throws InjectException
Retrieve all properties of the bean and injects into the bean.

Parameters:
bean -
componentPath - /folder1/../folderN/componentName
registerListener -
Throws:
InjectException - Any errors on type conversion or on instantiation of the nested bean properties .

injectProperties

public void injectProperties(java.lang.Object bean,
                             java.lang.String componentPath)
                      throws InjectException
Retrieve all properties of the bean and injects into the bean.

Parameters:
bean -
componentPath - /folder1/../folderN/componentName
registerListener -
Throws:
InjectException - Any errors on type conversion or on instantiation of the nested bean properties .

addPropertyListener

public void addPropertyListener(PropertyListener listener,
                                java.lang.String componentPath)
                         throws java.sql.SQLException,
                                NotFoundException
Throws:
java.sql.SQLException
NotFoundException

removePropertyListener

public boolean removePropertyListener(PropertyListener listener,
                                      java.lang.String componentPath)