org.jboss.kernel.plugins.config
Class Configurator

java.lang.Object
  extended by org.jboss.joinpoint.plugins.Config
      extended by org.jboss.kernel.plugins.config.Configurator

public class Configurator
extends org.jboss.joinpoint.plugins.Config

Configuration utilities.

Version:
$Revision: 81535 $
Author:
Adrian Brock, Ales Justin

Field Summary
 
Fields inherited from class org.jboss.joinpoint.plugins.Config
log
 
Constructor Summary
Configurator()
           
 
Method Summary
static void configure(boolean trace, Object object, org.jboss.beans.info.spi.BeanInfo info, ClassLoader cl, PropertyMetaData metaData)
          Configure a bean property
static void configure(boolean trace, Object object, org.jboss.beans.info.spi.PropertyInfo info, ClassLoader cl, PropertyMetaData metaData)
          Configure a bean property
static void configure(Object object, org.jboss.beans.info.spi.BeanInfo info, BeanMetaData metaData)
          Configure a bean
static void configure(Object object, org.jboss.beans.info.spi.BeanInfo info, ClassLoader cl, PropertyMetaData metaData)
          Configure a bean property
static void configure(Object object, org.jboss.beans.info.spi.PropertyInfo info, ClassLoader cl, PropertyMetaData metaData)
          Configure a bean property
static org.jboss.joinpoint.spi.ConstructorJoinpoint findConstructor(boolean trace, org.jboss.beans.info.spi.BeanInfo info, BeanMetaData metaData)
          Find a constructor
static org.jboss.joinpoint.spi.ConstructorJoinpoint findConstructor(boolean trace, org.jboss.beans.info.spi.BeanInfo info, ConstructorMetaData metaData)
          Find a constructor
static org.jboss.joinpoint.spi.ConstructorJoinpoint findConstructor(boolean trace, org.jboss.beans.info.spi.BeanInfo info, ConstructorMetaData metaData, Object object)
          Find a constructor
static org.jboss.joinpoint.spi.MethodJoinpoint findMethod(org.jboss.beans.info.spi.BeanInfo info, ClassLoader cl, String name, List<ParameterMetaData> parameters, boolean isStatic, boolean isPublic)
          Find a method
static org.jboss.joinpoint.spi.MethodJoinpoint findMethod(boolean trace, org.jboss.beans.info.spi.BeanInfo info, ClassLoader cl, String name, List<ParameterMetaData> parameters, boolean isStatic, boolean isPublic)
          Find a method
static ClassLoader getClassLoader(BeanMetaData metaData)
          Get the classloader for some BeanMetaData
static ClassLoader getClassLoader(ClassLoaderMetaData metaData)
          Get the classloader for some ClassLoaderMetaData
static org.jboss.joinpoint.spi.Joinpoint getConstructorJoinPoint(KernelConfig config, org.jboss.beans.info.spi.BeanInfo info, ConstructorMetaData metaData, BeanMetaData beanMetaData)
          Get a constructor joinpoint
static org.jboss.joinpoint.spi.Joinpoint getConstructorJoinPoint(KernelConfig config, org.jboss.beans.info.spi.BeanInfo info, ConstructorMetaData metaData, BeanMetaData beanMetaData, Object object)
          Get a constructor joinpoint
static Object[] getParameters(boolean trace, ClassLoader cl, org.jboss.reflect.spi.TypeInfo[] pinfos, List<ParameterMetaData> parameters)
          Get the parameters
static String[] getParameterTypes(boolean trace, List<ParameterMetaData> parameters)
          Get the parameters types
static String[] getParameterTypes(boolean trace, org.jboss.reflect.spi.TypeInfo[] parameters)
          Get the parameters types
static Object instantiate(KernelConfig config, org.jboss.beans.info.spi.BeanInfo info, BeanMetaData metaData)
          Instantiate a bean
static Object instantiateAndConfigure(KernelConfig config, org.jboss.beans.info.spi.BeanInfo info, BeanMetaData metaData)
          Instantiate and configure a bean
static boolean isAssignable(org.jboss.reflect.spi.TypeInfoFactory tif, ClassLoader cl, String[] typeNames, org.jboss.reflect.spi.TypeInfo[] typeInfos)
          Test whether type names can be assigned to type infos
static org.jboss.reflect.spi.ConstructorInfo resolveConstructor(boolean trace, org.jboss.beans.info.spi.BeanInfo info, ConstructorMetaData metaData)
          Resolve a constructor
static org.jboss.beans.info.spi.PropertyInfo resolveProperty(boolean trace, org.jboss.beans.info.spi.BeanInfo info, ClassLoader cl, String name, String type)
          Get the property info
static org.jboss.beans.info.spi.PropertyInfo resolveProperty(boolean trace, org.jboss.beans.info.spi.BeanInfo info, String name)
          Get the property info
static void unconfigure(boolean trace, Object object, org.jboss.beans.info.spi.PropertyInfo info, PropertyMetaData metaData)
          UnConfigure a bean property
static void unconfigure(Object object, org.jboss.beans.info.spi.BeanInfo info, BeanMetaData metaData)
          Unconfigure a bean
static void unconfigure(Object object, ClassLoader cl, org.jboss.beans.info.spi.BeanInfo info, PropertyMetaData metaData)
          Unconfigure a bean property
 
Methods inherited from class org.jboss.joinpoint.plugins.Config
configure, equals, findConstructorInfo, findFieldInfo, findMethodInfo, findMethodInfo, findMethodInfo, findMethodInfo, getConstructorJoinpoint, getConstructorJoinpoint, getFieldGetJoinpoint, getFieldSetJoinpoint, getMethodJoinpoint, getStaticMethodJoinpoint, instantiate, invoke, simpleCheck, unconfigure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configurator

public Configurator()
Method Detail

instantiateAndConfigure

public static Object instantiateAndConfigure(KernelConfig config,
                                             org.jboss.beans.info.spi.BeanInfo info,
                                             BeanMetaData metaData)
                                      throws Throwable
Instantiate and configure a bean

Parameters:
config - the confg
info - the bean info
metaData - the bean metadata
Returns:
the instantiated and configured object
Throws:
Throwable - for any error

instantiate

public static Object instantiate(KernelConfig config,
                                 org.jboss.beans.info.spi.BeanInfo info,
                                 BeanMetaData metaData)
                          throws Throwable
Instantiate a bean

Parameters:
config - the kernel config
info - the bean info
metaData - the bean metadata
Returns:
the instantiated object
Throws:
Throwable - for any error

getConstructorJoinPoint

public static org.jboss.joinpoint.spi.Joinpoint getConstructorJoinPoint(KernelConfig config,
                                                                        org.jboss.beans.info.spi.BeanInfo info,
                                                                        ConstructorMetaData metaData,
                                                                        BeanMetaData beanMetaData)
                                                                 throws Throwable
Get a constructor joinpoint

Parameters:
config - the kernel config
info - the bean info
metaData - the constructor metadata
beanMetaData - the bean metadata
Returns:
the joinpoint
Throws:
Throwable - for any error

getConstructorJoinPoint

public static org.jboss.joinpoint.spi.Joinpoint getConstructorJoinPoint(KernelConfig config,
                                                                        org.jboss.beans.info.spi.BeanInfo info,
                                                                        ConstructorMetaData metaData,
                                                                        BeanMetaData beanMetaData,
                                                                        Object object)
                                                                 throws Throwable
Get a constructor joinpoint

Parameters:
config - the kernel config
info - the bean info
metaData - the constructor metadata
beanMetaData - the bean metadata
object - an opaque object
Returns:
the joinpoint
Throws:
Throwable - for any error

findConstructor

public static org.jboss.joinpoint.spi.ConstructorJoinpoint findConstructor(boolean trace,
                                                                           org.jboss.beans.info.spi.BeanInfo info,
                                                                           BeanMetaData metaData)
                                                                    throws Exception
Find a constructor

Parameters:
trace - whether trace is enabled
info - the bean info
metaData - the bean metadata
Returns:
the constructor join point
Throws:
Exception - for any error

findConstructor

public static org.jboss.joinpoint.spi.ConstructorJoinpoint findConstructor(boolean trace,
                                                                           org.jboss.beans.info.spi.BeanInfo info,
                                                                           ConstructorMetaData metaData)
                                                                    throws Exception
Find a constructor

Parameters:
trace - whether trace is enabled
info - the bean info
metaData - the constructor metadata
Returns:
the constructor join point
Throws:
Exception - for any error

findConstructor

public static org.jboss.joinpoint.spi.ConstructorJoinpoint findConstructor(boolean trace,
                                                                           org.jboss.beans.info.spi.BeanInfo info,
                                                                           ConstructorMetaData metaData,
                                                                           Object object)
                                                                    throws Exception
Find a constructor

Parameters:
trace - whether trace is enabled
info - the bean info
metaData - the constructor metadata
object - an opaque object
Returns:
the constructor join point
Throws:
Exception - for any error

resolveConstructor

public static org.jboss.reflect.spi.ConstructorInfo resolveConstructor(boolean trace,
                                                                       org.jboss.beans.info.spi.BeanInfo info,
                                                                       ConstructorMetaData metaData)
Resolve a constructor

Parameters:
trace - whether trace is enabled
info - the bean info
metaData - the constructor metadata
Returns:
the constructor info

configure

public static void configure(Object object,
                             org.jboss.beans.info.spi.BeanInfo info,
                             BeanMetaData metaData)
                      throws Throwable
Configure a bean

Parameters:
object - the object to configure
info - the bean info
metaData - the bean metadata
Throws:
Throwable - for any error

configure

public static void configure(Object object,
                             org.jboss.beans.info.spi.BeanInfo info,
                             ClassLoader cl,
                             PropertyMetaData metaData)
                      throws Throwable
Configure a bean property

Parameters:
object - the object to configure
info - the bean info
cl - the classloader
metaData - the property metadata
Throws:
Throwable - for any error

configure

public static void configure(boolean trace,
                             Object object,
                             org.jboss.beans.info.spi.BeanInfo info,
                             ClassLoader cl,
                             PropertyMetaData metaData)
                      throws Throwable
Configure a bean property

Parameters:
trace - whether trace is enabled
object - the object to configure
info - the bean info
cl - the classloader
metaData - the property metadata
Throws:
Throwable - for any error

configure

public static void configure(Object object,
                             org.jboss.beans.info.spi.PropertyInfo info,
                             ClassLoader cl,
                             PropertyMetaData metaData)
                      throws Throwable
Configure a bean property

Parameters:
object - the object to configure
info - the property info
cl - the classloader
metaData - the property metadata
Throws:
Throwable - for any error

configure

public static void configure(boolean trace,
                             Object object,
                             org.jboss.beans.info.spi.PropertyInfo info,
                             ClassLoader cl,
                             PropertyMetaData metaData)
                      throws Throwable
Configure a bean property

Parameters:
trace - whether trace is enabled
object - the object to configure
info - the property info
cl - the classloader
metaData - the property metadata
Throws:
Throwable - for any error

unconfigure

public static void unconfigure(Object object,
                               org.jboss.beans.info.spi.BeanInfo info,
                               BeanMetaData metaData)
                        throws Throwable
Unconfigure a bean

Parameters:
object - the object to unconfigure
info - the bean info
metaData - the bean metadata
Throws:
Throwable - for any error

unconfigure

public static void unconfigure(Object object,
                               ClassLoader cl,
                               org.jboss.beans.info.spi.BeanInfo info,
                               PropertyMetaData metaData)
                        throws Throwable
Unconfigure a bean property

Parameters:
object - the object to unconfigure
cl - the classloader
info - the bean info
metaData - the property metadata
Throws:
Throwable - for any error

unconfigure

public static void unconfigure(boolean trace,
                               Object object,
                               org.jboss.beans.info.spi.PropertyInfo info,
                               PropertyMetaData metaData)
                        throws Throwable
UnConfigure a bean property

Parameters:
trace - whether trace is enabled
object - the object to configure
info - the property info
metaData - the property metadata
Throws:
Throwable - for any error

resolveProperty

public static org.jboss.beans.info.spi.PropertyInfo resolveProperty(boolean trace,
                                                                    org.jboss.beans.info.spi.BeanInfo info,
                                                                    String name)
                                                             throws Throwable
Get the property info

Parameters:
trace - whether trace is enabled
info - the bean info
name - the property name
Returns:
the property info
Throws:
Throwable - for any error

resolveProperty

public static org.jboss.beans.info.spi.PropertyInfo resolveProperty(boolean trace,
                                                                    org.jboss.beans.info.spi.BeanInfo info,
                                                                    ClassLoader cl,
                                                                    String name,
                                                                    String type)
                                                             throws Throwable
Get the property info

Parameters:
trace - whether trace is enabled
info - the bean info
cl - the classloader
name - the property name
type - the property type
Returns:
the property info
Throws:
Throwable - for any error

findMethod

public static org.jboss.joinpoint.spi.MethodJoinpoint findMethod(org.jboss.beans.info.spi.BeanInfo info,
                                                                 ClassLoader cl,
                                                                 String name,
                                                                 List<ParameterMetaData> parameters,
                                                                 boolean isStatic,
                                                                 boolean isPublic)
                                                          throws Throwable
Find a method

Parameters:
info - the bean info
cl - the classloader
name - the method name
parameters - the parameter metadata
isStatic - whether the method is static
isPublic - whether the method is public
Returns:
the method join point
Throws:
Throwable - for any error

findMethod

public static org.jboss.joinpoint.spi.MethodJoinpoint findMethod(boolean trace,
                                                                 org.jboss.beans.info.spi.BeanInfo info,
                                                                 ClassLoader cl,
                                                                 String name,
                                                                 List<ParameterMetaData> parameters,
                                                                 boolean isStatic,
                                                                 boolean isPublic)
                                                          throws Throwable
Find a method

Parameters:
trace - whether trace is enabled
info - the bean info
cl - the classloader
name - the method name
parameters - the parameter metadata
isStatic - whether the method is static
isPublic - whether the method is public
Returns:
the method join point
Throws:
Throwable - for any error

getParameterTypes

public static String[] getParameterTypes(boolean trace,
                                         List<ParameterMetaData> parameters)
                                  throws Throwable
Get the parameters types

Parameters:
trace - whether trace is enabled
parameters - the parameter metadata
Returns:
an array of parameter types
Throws:
Throwable - for any error

getParameterTypes

public static String[] getParameterTypes(boolean trace,
                                         org.jboss.reflect.spi.TypeInfo[] parameters)
                                  throws Throwable
Get the parameters types

Parameters:
trace - whether trace is enabled
parameters - the parameter types
Returns:
an array of parameter types
Throws:
Throwable - for any error

getParameters

public static Object[] getParameters(boolean trace,
                                     ClassLoader cl,
                                     org.jboss.reflect.spi.TypeInfo[] pinfos,
                                     List<ParameterMetaData> parameters)
                              throws Throwable
Get the parameters

Parameters:
trace - whether trace is enabled
cl - the classloader
pinfos - the parameter infos
parameters - the parameter metadata
Returns:
an array of parameters
Throws:
Throwable - for any error

getClassLoader

public static ClassLoader getClassLoader(BeanMetaData metaData)
                                  throws Throwable
Get the classloader for some BeanMetaData

Parameters:
metaData - the metaData
Returns:
the classloader
Throws:
Throwable - for any error

getClassLoader

public static ClassLoader getClassLoader(ClassLoaderMetaData metaData)
                                  throws Throwable
Get the classloader for some ClassLoaderMetaData

Parameters:
metaData - the metaData
Returns:
the classloader
Throws:
Throwable - for any error

isAssignable

public static boolean isAssignable(org.jboss.reflect.spi.TypeInfoFactory tif,
                                   ClassLoader cl,
                                   String[] typeNames,
                                   org.jboss.reflect.spi.TypeInfo[] typeInfos)
                            throws Throwable
Test whether type names can be assigned to type infos

Parameters:
tif - the type info factory
cl - bean classloader
typeNames - the type names
typeInfos - the type infos
Returns:
true when they can be assigned
Throws:
Throwable - for any error


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.