1 22 package org.jboss.kernel.plugins.config; 23 24 import java.util.List ; 25 import java.util.Set ; 26 27 import org.jboss.beans.info.spi.BeanInfo; 28 import org.jboss.beans.info.spi.PropertyInfo; 29 import org.jboss.beans.metadata.spi.BeanMetaData; 30 import org.jboss.beans.metadata.spi.ConstructorMetaData; 31 import org.jboss.beans.metadata.spi.PropertyMetaData; 32 import org.jboss.beans.metadata.spi.ValueMetaData; 33 import org.jboss.joinpoint.spi.Joinpoint; 34 import org.jboss.joinpoint.spi.MethodJoinpoint; 35 import org.jboss.joinpoint.spi.TargettedJoinpoint; 36 import org.jboss.kernel.Kernel; 37 import org.jboss.kernel.plugins.AbstractKernelObject; 38 import org.jboss.kernel.spi.config.KernelConfig; 39 import org.jboss.kernel.spi.config.KernelConfigurator; 40 import org.jboss.reflect.spi.ClassInfo; 41 import org.jboss.reflect.spi.TypeInfo; 42 43 49 public class AbstractKernelConfigurator extends AbstractKernelObject implements KernelConfigurator 50 { 51 52 protected KernelConfig config; 53 54 59 public AbstractKernelConfigurator() throws Exception 60 { 61 } 62 63 public BeanInfo getBeanInfo(String className, ClassLoader cl) throws Throwable 64 { 65 return config.getBeanInfo(className, cl); 66 } 67 68 public BeanInfo getBeanInfo(Class clazz) throws Throwable 69 { 70 return config.getBeanInfo(clazz); 71 } 72 73 public BeanInfo getBeanInfo(TypeInfo type) throws Throwable 74 { 75 return config.getBeanInfo(type); 76 } 77 78 public BeanInfo getBeanInfo(BeanMetaData metaData) throws Throwable 79 { 80 ClassLoader cl = Configurator.getClassLoader(metaData); 81 String className = metaData.getBean(); 82 if (className == null) 83 return null; 84 return getBeanInfo(className, cl); 85 } 86 87 public ClassInfo getClassInfo(String className, ClassLoader cl) throws Throwable 88 { 89 return config.getClassInfo(className, cl); 90 } 91 92 public ClassInfo getClassInfo(Class clazz) throws Throwable 93 { 94 return config.getClassInfo(clazz); 95 } 96 97 public Joinpoint getConstructorJoinPoint(BeanInfo info) throws Throwable 98 { 99 return getConstructorJoinPoint(info, null, null); 100 } 101 102 public Joinpoint getConstructorJoinPoint(BeanMetaData metaData) throws Throwable 103 { 104 BeanInfo info = getBeanInfo(metaData); 105 return getConstructorJoinPoint(info, metaData.getConstructor(), metaData); 106 } 107 108 public Joinpoint getConstructorJoinPoint(BeanInfo info, ConstructorMetaData metaData, BeanMetaData beanMetaData) throws Throwable 109 { 110 return Configurator.getConstructorJoinPoint(config, info, metaData, beanMetaData); 111 } 112 113 public TargettedJoinpoint getPropertyGetterJoinPoint(BeanInfo info, String property) throws Throwable 114 { 115 return Configurator.getPropertyGetterJoinPoint(info, property); 116 } 117 118 public Set <TargettedJoinpoint> getPropertySetterJoinPoints(BeanInfo info, BeanMetaData metaData) throws Throwable 119 { 120 return Configurator.getPropertySetterJoinPoints(info, metaData); 121 } 122 123 public TargettedJoinpoint getPropertySetterJoinPoint(BeanInfo info, ClassLoader cl, PropertyMetaData metaData) throws Throwable 124 { 125 return Configurator.getPropertySetterJoinPoint(info, cl, metaData); 126 } 127 128 public TargettedJoinpoint getPropertySetterJoinPoint(PropertyInfo info, ClassLoader cl, PropertyMetaData metaData) throws Throwable 129 { 130 return Configurator.getPropertySetterJoinPoint(info, cl, metaData); 131 } 132 133 public TargettedJoinpoint getPropertySetterJoinPoint(BeanInfo info, String property, ClassLoader cl, ValueMetaData vmd) throws Throwable 134 { 135 return Configurator.getPropertySetterJoinPoint(info, property, cl, vmd); 136 } 137 138 public Set <TargettedJoinpoint> getPropertyNullerJoinPoints(BeanInfo info, BeanMetaData metaData) throws Throwable 139 { 140 return Configurator.getPropertyNullerJoinPoints(info, metaData); 141 } 142 143 public TargettedJoinpoint getPropertyNullerJoinPoint(BeanInfo info, PropertyMetaData metaData) throws Throwable 144 { 145 return Configurator.getPropertyNullerJoinPoint(info, metaData); 146 } 147 148 public TargettedJoinpoint getPropertyNullerJoinPoint(PropertyInfo info, PropertyMetaData metaData) throws Throwable 149 { 150 return Configurator.getPropertyNullerJoinPoint(info, metaData); 151 } 152 153 public MethodJoinpoint getMethodJoinPoint(BeanInfo info, ClassLoader cl, String name, List parameters, boolean isStatic, boolean isPublic) throws Throwable 154 { 155 return Configurator.findMethod(info, cl, name, parameters, isStatic, isPublic); 156 } 157 158 public void setKernel(Kernel kernel) throws Throwable 159 { 160 super.setKernel(kernel); 161 config = kernel.getConfig(); 162 } 163 } 164 | Popular Tags |