com.caucho.config.program
Class ConfigProgram

java.lang.Object
  extended by com.caucho.config.program.ConfigProgram
All Implemented Interfaces:
java.lang.Comparable<ConfigProgram>
Direct Known Subclasses:
ContainerProgram, ExprProgram, FieldGeneratorProgram, FlowProgram, MethodGeneratorProgram, NamedProgram, NullProgram, PostConstructProgram, PreDestroyInject, PropertyStringProgram, PropertyValueProgram, ResourceAdapterAssociationProgram, ResourceGroupConfig, ResourceInjectionTargetProgram, ResourceProgram, XaInterceptor

public abstract class ConfigProgram
extends java.lang.Object
implements java.lang.Comparable<ConfigProgram>

A saved program for configuring an object.


Constructor Summary
ConfigProgram()
           
 
Method Summary
 void addProgram(ConfigProgram program)
           
 void bind()
          Binds the injection point
 int compareTo(ConfigProgram peer)
           
<T> T
configure(java.lang.Class<T> type)
           
protected
<T> T
configure(java.lang.Class<T> type, XmlConfigContext env)
          Configures a bean given a class to instantiate.
 void configure(java.lang.Object bean)
          Configures the object.
protected
<T> T
create(java.lang.Class<T> type, CreationalContext<T> env)
          Configures a bean given a class to instantiate.
<T> T
create(ConfigType<T> type)
           
<T> T
create(ConfigType<T> type, CreationalContext<T> env)
           
 java.lang.Class<?> getDeclaringClass()
          Returns the declaring class.
 java.lang.String getName()
          Returns the name.
 int getPriority()
           
 QName getQName()
          Returns the program's QName
 void init(java.lang.Object bean)
           
abstract
<T> void
inject(T bean, CreationalContext<T> createContext)
          Configures the bean using the current program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigProgram

public ConfigProgram()
Method Detail

getQName

public QName getQName()
Returns the program's QName


getPriority

public int getPriority()

getDeclaringClass

public java.lang.Class<?> getDeclaringClass()
Returns the declaring class.


getName

public java.lang.String getName()
Returns the name.


inject

public abstract <T> void inject(T bean,
                                CreationalContext<T> createContext)
Configures the bean using the current program.

Parameters:
bean - the bean to configure
env - the Config environment

bind

public void bind()
Binds the injection point


addProgram

public void addProgram(ConfigProgram program)

configure

public final void configure(java.lang.Object bean)
                     throws ConfigException
Configures the object.

Throws:
ConfigException

configure

public final <T> T configure(java.lang.Class<T> type)
                  throws ConfigException
Throws:
ConfigException

configure

protected final <T> T configure(java.lang.Class<T> type,
                                XmlConfigContext env)
                     throws ConfigException
Configures a bean given a class to instantiate.

Throws:
ConfigException

create

protected final <T> T create(java.lang.Class<T> type,
                             CreationalContext<T> env)
                  throws ConfigException
Configures a bean given a class to instantiate.

Throws:
ConfigException

create

public final <T> T create(ConfigType<T> type)
               throws ConfigException
Throws:
ConfigException

create

public <T> T create(ConfigType<T> type,
                    CreationalContext<T> env)
         throws ConfigException
Throws:
ConfigException

init

public void init(java.lang.Object bean)
          throws ConfigException
Throws:
ConfigException

compareTo

public int compareTo(ConfigProgram peer)
Specified by:
compareTo in interface java.lang.Comparable<ConfigProgram>