public class MicroClassReader
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MicroClassReader.DummyClassLoader |
Constructor and Description |
---|
MicroClassReader() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkMethodReturnType(java.lang.Class<? extends java.lang.annotation.Annotation> ann,
java.lang.reflect.Method m,
java.lang.ClassLoader cl)
Check, if the return type of the agent method is acceptable.
|
static RequiredServiceBinding |
createBinding(RequiredService rq)
Create a service binding.
|
protected ComponentInstanceInfo |
createComponentInstanceInfo(Component comp)
Create component instance info from component annotation.
|
static ComponentInstanceInfo |
createComponentInstanceInfo(CreationInfo comp)
Create component instance info from creation info annotation.
|
static ProvidedServiceImplementation |
createImplementation(Implementation impl,
java.lang.Class<?> cma)
Create a service implementation.
|
protected java.util.List<NFRPropertyInfo> |
createNFRProperties(NFRProperty[] nfrp)
Create req service props.
|
protected RequiredServiceInfo |
createRequiredServiceInfo(RequiredService rs,
java.lang.ClassLoader cl)
Create a required service info and add it to the map.
|
static UnparsedExpression[] |
createUnparsedExpressions(Value[] values)
Create unparsed expressions.
|
protected java.lang.Object |
evaluateExpression(java.lang.String exp,
java.lang.String[] imports,
IValueFetcher fetcher,
java.lang.ClassLoader classloader)
Evaluate an expression string (using "" -> null mapping) as annotations
do not support null values.
|
protected void |
fillMicroModelFromAnnotations(MicroModel micromodel,
java.lang.String model,
java.lang.Class<?> clazz,
java.lang.ClassLoader cl)
Fill the model details using annotation.
|
static <T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<?> clazz,
java.lang.Class<T> anclazz,
java.lang.ClassLoader cl) |
static <T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<?> clazz,
java.lang.Class<T> anclazz,
java.lang.ClassLoader cl1,
java.lang.ClassLoader cl2) |
static <T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.reflect.Constructor<?> c,
java.lang.Class<T> anclazz,
java.lang.ClassLoader cl) |
static <T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.reflect.Field f,
java.lang.Class<T> anclazz,
java.lang.ClassLoader cl) |
static <T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.reflect.Method m,
java.lang.Class<T> anclazz,
java.lang.ClassLoader cl) |
static java.lang.Class<?> |
getClass(java.lang.Class<?> clazz,
java.lang.ClassLoader cl) |
static java.lang.Class<?>[] |
getClassArray(java.lang.Class<?>[] clazzes,
java.lang.ClassLoader cl) |
protected java.lang.Class<?> |
getMicroAgentClass(java.lang.String clname,
java.lang.String[] imports,
java.lang.ClassLoader classloader)
Get the mirco agent class.
|
protected java.util.List<java.lang.Object> |
getOrCreateList(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> map)
Get or create a list.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getOrCreateMap(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> map)
Get or create a map.
|
protected java.util.Set<java.lang.Object> |
getOrCreateSet(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> map)
Get or create a set.
|
static java.lang.annotation.Annotation[][] |
getParameterAnnotations(java.lang.reflect.Constructor c,
java.lang.ClassLoader cl) |
static java.lang.annotation.Annotation[][] |
getParameterAnnotations(java.lang.reflect.Method m,
java.lang.ClassLoader cl) |
static <T extends java.lang.annotation.Annotation> |
getProxyAnnotation(T an,
java.lang.ClassLoader cl)
Gets proxy annotation that can be invoked by corresponding classloader.
|
static boolean |
isAnnotationPresent(java.lang.Class<?> clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> anclazz,
java.lang.ClassLoader cl) |
static boolean |
isAnnotationPresent(java.lang.reflect.Constructor<?> con,
java.lang.Class<? extends java.lang.annotation.Annotation> anclazz,
java.lang.ClassLoader cl) |
static boolean |
isAnnotationPresent(java.lang.reflect.Field f,
java.lang.Class<? extends java.lang.annotation.Annotation> anclazz,
java.lang.ClassLoader cl) |
static boolean |
isAnnotationPresent(java.lang.reflect.Method m,
java.lang.Class<? extends java.lang.annotation.Annotation> anclazz,
java.lang.ClassLoader cl) |
protected static boolean |
isClassLoaderCompatible(java.lang.Class<?> clazz,
java.lang.ClassLoader cl) |
protected MicroModel |
read(java.lang.String model,
java.lang.Class<?> cma,
java.lang.ClassLoader classloader,
IResourceIdentifier rid,
IComponentIdentifier root,
java.util.List<IComponentFeatureFactory> features)
Load the model.
|
MicroModel |
read(java.lang.String model,
java.lang.String[] imports,
java.lang.ClassLoader classloader,
IResourceIdentifier rid,
IComponentIdentifier root,
java.util.List<IComponentFeatureFactory> features)
Load a model.
|
public MicroModel read(java.lang.String model, java.lang.String[] imports, java.lang.ClassLoader classloader, IResourceIdentifier rid, IComponentIdentifier root, java.util.List<IComponentFeatureFactory> features)
model
- The model (e.g. file name).The
- imports (if any).protected MicroModel read(java.lang.String model, java.lang.Class<?> cma, java.lang.ClassLoader classloader, IResourceIdentifier rid, IComponentIdentifier root, java.util.List<IComponentFeatureFactory> features)
protected void fillMicroModelFromAnnotations(MicroModel micromodel, java.lang.String model, java.lang.Class<?> clazz, java.lang.ClassLoader cl)
protected void checkMethodReturnType(java.lang.Class<? extends java.lang.annotation.Annotation> ann, java.lang.reflect.Method m, java.lang.ClassLoader cl)
protected RequiredServiceInfo createRequiredServiceInfo(RequiredService rs, java.lang.ClassLoader cl)
protected java.util.Map<java.lang.String,java.lang.Object> getOrCreateMap(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> map)
protected java.util.List<java.lang.Object> getOrCreateList(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> map)
protected java.util.Set<java.lang.Object> getOrCreateSet(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> map)
protected java.lang.Object evaluateExpression(java.lang.String exp, java.lang.String[] imports, IValueFetcher fetcher, java.lang.ClassLoader classloader)
public static ProvidedServiceImplementation createImplementation(Implementation impl, java.lang.Class<?> cma)
public static RequiredServiceBinding createBinding(RequiredService rq)
protected java.util.List<NFRPropertyInfo> createNFRProperties(NFRProperty[] nfrp)
protected ComponentInstanceInfo createComponentInstanceInfo(Component comp)
public static ComponentInstanceInfo createComponentInstanceInfo(CreationInfo comp)
public static UnparsedExpression[] createUnparsedExpressions(Value[] values)
protected java.lang.Class<?> getMicroAgentClass(java.lang.String clname, java.lang.String[] imports, java.lang.ClassLoader classloader)
public static boolean isAnnotationPresent(java.lang.Class<?> clazz, java.lang.Class<? extends java.lang.annotation.Annotation> anclazz, java.lang.ClassLoader cl)
public static boolean isAnnotationPresent(java.lang.reflect.Field f, java.lang.Class<? extends java.lang.annotation.Annotation> anclazz, java.lang.ClassLoader cl)
public static boolean isAnnotationPresent(java.lang.reflect.Method m, java.lang.Class<? extends java.lang.annotation.Annotation> anclazz, java.lang.ClassLoader cl)
public static boolean isAnnotationPresent(java.lang.reflect.Constructor<?> con, java.lang.Class<? extends java.lang.annotation.Annotation> anclazz, java.lang.ClassLoader cl)
public static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<?> clazz, java.lang.Class<T> anclazz, java.lang.ClassLoader cl)
public static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.reflect.Field f, java.lang.Class<T> anclazz, java.lang.ClassLoader cl)
public static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.reflect.Method m, java.lang.Class<T> anclazz, java.lang.ClassLoader cl)
public static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.reflect.Constructor<?> c, java.lang.Class<T> anclazz, java.lang.ClassLoader cl)
public static java.lang.annotation.Annotation[][] getParameterAnnotations(java.lang.reflect.Method m, java.lang.ClassLoader cl)
public static java.lang.annotation.Annotation[][] getParameterAnnotations(java.lang.reflect.Constructor c, java.lang.ClassLoader cl)
public static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<?> clazz, java.lang.Class<T> anclazz, java.lang.ClassLoader cl1, java.lang.ClassLoader cl2)
public static java.lang.Class<?> getClass(java.lang.Class<?> clazz, java.lang.ClassLoader cl)
public static java.lang.Class<?>[] getClassArray(java.lang.Class<?>[] clazzes, java.lang.ClassLoader cl)
public static <T extends java.lang.annotation.Annotation> T getProxyAnnotation(T an, java.lang.ClassLoader cl)
protected static boolean isClassLoaderCompatible(java.lang.Class<?> clazz, java.lang.ClassLoader cl)