[jboss-cvs] JBossAS SVN: r95215 - in projects/mc-ann/trunk: core and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 20 18:16:37 EDT 2009
Author: alesj
Date: 2009-10-20 18:16:36 -0400 (Tue, 20 Oct 2009)
New Revision: 95215
Added:
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/AbstractElement.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/ClassElement.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/ClassSignaturePair.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/CommitElement.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/DefaultAnnotationRepository.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/DefaultElement.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/GenericAnnotationResourceVisitor.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/IntrospectionTypeInfoProvider.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/ParametersElement.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/RepositoryPutList.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/TypeInfoProvider.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/WeakClassLoaderHolder.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/javassist/
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/ModuleAnnotationScanner.java
Removed:
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/JavassistAnnotationScanner.java
Modified:
projects/mc-ann/trunk/core/pom.xml
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationScannerFactory.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/javassist/JavassistTypeInfoProvider.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/DefaultAnnotationScanner.java
projects/mc-ann/trunk/pom.xml
Log:
Fix packages.
Remove duplicated config.
Modified: projects/mc-ann/trunk/core/pom.xml
===================================================================
--- projects/mc-ann/trunk/core/pom.xml 2009-10-20 22:04:50 UTC (rev 95214)
+++ projects/mc-ann/trunk/core/pom.xml 2009-10-20 22:16:36 UTC (rev 95215)
@@ -34,6 +34,14 @@
<artifactId>jboss-reflect</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-metatype</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.cl</groupId>
<artifactId>jboss-classloading</artifactId>
</dependency>
Modified: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationScannerFactory.java
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationScannerFactory.java 2009-10-20 22:04:50 UTC (rev 95214)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationScannerFactory.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -22,7 +22,7 @@
package org.jboss.mcann;
import org.jboss.mcann.scanner.DefaultAnnotationScanner;
-import org.jboss.mcann.scanner.JavassistAnnotationScanner;
+import org.jboss.mcann.repository.javassist.JavassistTypeInfoProvider;
/**
* An annotation scanner factory
@@ -98,11 +98,13 @@
*/
public static AnnotationScanner getStrategy(int strategy)
{
- if (strategy == JAVA_LANG_REFLECT)
- return new DefaultAnnotationScanner();
- else if (strategy == JAVASSIST)
- return new JavassistAnnotationScanner();
- else
+ if (strategy >= 2)
throw new IllegalArgumentException("No such strategy: "+ strategy);
+
+ DefaultAnnotationScanner scanner = new DefaultAnnotationScanner();
+ if (strategy == JAVASSIST)
+ scanner.setTypeInfoProvider(new JavassistTypeInfoProvider());
+
+ return scanner;
}
}
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/AbstractElement.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/AbstractElement.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/AbstractElement.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/AbstractElement.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.repository;
+
+import org.jboss.mcann.Element;
+
+import java.lang.annotation.Annotation;
+import java.lang.ref.SoftReference;
+import java.lang.reflect.AnnotatedElement;
+
+/**
+ * Abstract annotations element.
+ *
+ * @param <A> the annotation type
+ * @param <M> the annotated element type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractElement<A extends Annotation, M extends AnnotatedElement> extends WeakClassLoaderHolder implements Element<A, M>
+{
+ protected String className;
+ protected Class<A> annClass;
+ private A annotation;
+
+ private SoftReference<Class<?>> classRef;
+
+ public AbstractElement(ClassLoader classLoader, String className, Class<A> annClass, A annotation)
+ {
+ super(classLoader);
+
+ if (className == null)
+ throw new IllegalArgumentException("Null className");
+ if (annClass == null)
+ throw new IllegalArgumentException("Null annotation class");
+
+ this.className = className;
+ this.annClass = annClass;
+ this.annotation = annotation;
+ }
+
+ public String getOwnerClassName()
+ {
+ return className;
+ }
+
+ public Class<?> getOwner()
+ {
+ if (classRef != null)
+ {
+ Class<?> clazz = classRef.get();
+ if (clazz != null)
+ return clazz;
+ }
+
+ Class<?> clazz = loadClass(className);
+ classRef = new SoftReference<Class<?>>(clazz);
+ return clazz;
+ }
+
+ public A getAnnotation()
+ {
+ if (annotation == null)
+ annotation = readAnnotation();
+
+ return annotation;
+ }
+
+ /**
+ * Read the annotation.
+ *
+ * @return the read annotation
+ */
+ protected A readAnnotation()
+ {
+ AnnotatedElement annotatedElement = getAnnotatedElement();
+ return annotatedElement.getAnnotation(annClass);
+ }
+
+ public int getHashCode()
+ {
+ int hash = className.hashCode();
+ hash += 7 * annClass.hashCode();
+ if (annotation != null)
+ hash += 11 * annotation.hashCode();
+ return hash;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj == null || getClass().equals(obj.getClass()) == false)
+ return false;
+
+ AbstractElement<?, ?> ae = AbstractElement.class.cast(obj);
+ if (className.equals(ae.className) == false)
+ return false;
+ if (annClass.equals(ae.annClass) == false)
+ return false;
+
+ // we don't check annotation
+ // since I doubt classname + annClass + signature + aoClass is not enough
+ // the only way this could happen is probably if class was diff version - diff annotation values
+
+ return true;
+ }
+}
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/ClassElement.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/ClassElement.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/ClassElement.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/ClassElement.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.repository;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+
+/**
+ * Class annotations element.
+ *
+ * @param <A> the annotation type
+ * @param <M> the annotated element type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ClassElement<A extends Annotation, M extends AnnotatedElement> extends AbstractElement<A, M>
+{
+ public ClassElement(ClassLoader classLoader, String className, Class<A> annClass, A annotation)
+ {
+ super(classLoader, className, annClass, annotation);
+ }
+
+ @SuppressWarnings("unchecked")
+ public M getAnnotatedElement()
+ {
+ AnnotatedElement em = getOwner();
+ return (M)em;
+ }
+}
\ No newline at end of file
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/ClassSignaturePair.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/ClassSignaturePair.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/ClassSignaturePair.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/ClassSignaturePair.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.repository;
+
+import org.jboss.util.JBossObject;
+import org.jboss.metadata.spi.signature.Signature;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * Class name and signature pair.
+ * With those two we can re-create annotation value.
+ *
+ * If the keepAnnotations flag is on in DefaultAnnotationRepository
+ * we cache the annotation value from GenericAnnotationResourceVisitor.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ClassSignaturePair extends JBossObject
+{
+ private String className;
+ private Signature signature;
+ private Annotation annotation;
+
+ public ClassSignaturePair(String className, Signature signature)
+ {
+ this(className, signature, null);
+ }
+
+ public ClassSignaturePair(String className, Signature signature, Annotation annotation)
+ {
+ if (className == null)
+ throw new IllegalArgumentException("Null class name");
+
+ this.className = className;
+ this.signature = signature;
+ this.annotation = annotation;
+ }
+
+ /**
+ * Get the classname.
+ *
+ * @return the classname
+ */
+ public String getClassName()
+ {
+ return className;
+ }
+
+ /**
+ * Get the signature.
+ *
+ * @return the signature
+ */
+ public Signature getSignature()
+ {
+ return signature;
+ }
+
+ /**
+ * Get the annotation.
+ *
+ * @return the annotation
+ */
+ public Annotation getAnnotation()
+ {
+ return annotation;
+ }
+
+ protected int getHashCode()
+ {
+ int hash = className.hashCode();
+ if (signature != null)
+ hash += 7 * signature.hashCode();
+ return hash;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof ClassSignaturePair == false)
+ return false;
+
+ ClassSignaturePair csPair = (ClassSignaturePair)obj;
+ if (className.equals(csPair.getClassName()))
+ return equals(signature, csPair.getSignature());
+ else
+ return false;
+ }
+}
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/CommitElement.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/CommitElement.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/CommitElement.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/CommitElement.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.repository;
+
+import org.jboss.metadata.spi.signature.Signature;
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.ElementType;
+
+/**
+ * Gathering annotation information.
+ *
+ * Only push all this info into AnnotationEnvironment if
+ * complete lookup was successful.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+class CommitElement
+{
+ private Annotation annotation;
+ private ElementType type;
+ private String className;
+ private Signature signature;
+
+ CommitElement(Annotation annotation, ElementType type, String className, Signature signature)
+ {
+ this.annotation = annotation;
+ this.type = type;
+ this.className = className;
+ this.signature = signature;
+ }
+
+ /**
+ * Get the annotation.
+ *
+ * @return the annotation
+ */
+ public Annotation getAnnotation()
+ {
+ return annotation;
+ }
+
+ /**
+ * Get element type.
+ *
+ * @return the element type
+ */
+ public ElementType getType()
+ {
+ return type;
+ }
+
+ /**
+ * Get class name.
+ *
+ * @return the class name
+ */
+ public String getClassName()
+ {
+ return className;
+ }
+
+ /**
+ * Get signature.
+ *
+ * @return the signature
+ */
+ public Signature getSignature()
+ {
+ return signature;
+ }
+}
\ No newline at end of file
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/DefaultAnnotationRepository.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/DefaultAnnotationRepository.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/DefaultAnnotationRepository.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/DefaultAnnotationRepository.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,309 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.repository;
+
+import org.jboss.metadata.spi.signature.Signature;
+import org.jboss.mcann.AnnotationRepository;
+import org.jboss.mcann.Element;
+import org.jboss.util.collection.CollectionsFactory;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.annotation.ElementType;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * DefaultAnnotationEnvironment.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class DefaultAnnotationRepository extends WeakClassLoaderHolder implements AnnotationRepository, Serializable
+{
+ /** The serial version UID */
+ private static final long serialVersionUID = 1L;
+ /** The info map */
+ private transient Map<Class<? extends Annotation>, Map<ElementType, Set<ClassSignaturePair>>> env;
+ /** The checked class names */
+ private transient Set<String> checkedClassNames;
+ /** Should we keep the annotation */
+ private boolean keepAnnotations;
+
+ public DefaultAnnotationRepository(ClassLoader classLoader)
+ {
+ super(classLoader);
+ env = new HashMap<Class<? extends Annotation>, Map<ElementType, Set<ClassSignaturePair>>>();
+ checkedClassNames = new HashSet<String>();
+ }
+
+ /**
+ * Set the keep annotations flag.
+ *
+ * @param keepAnnotations the keep annotations flag
+ */
+ public void setKeepAnnotations(boolean keepAnnotations)
+ {
+ this.keepAnnotations = keepAnnotations;
+ }
+
+ /**
+ * Get env map.
+ *
+ * @return the env map
+ */
+ protected Map<Class<? extends Annotation>, Map<ElementType, Set<ClassSignaturePair>>> getEnv()
+ {
+ if (env == null)
+ throw new IllegalArgumentException("Null env, previously serialized?");
+
+ return env;
+ }
+
+ /**
+ * Was class name already checked.
+ *
+ * @param className the class name
+ * @return true if already checked, false otherwise
+ */
+ boolean isAlreadyChecked(String className)
+ {
+ return checkedClassNames.contains(className);
+ }
+
+ public void merge(AnnotationRepository repository)
+ {
+ if (repository instanceof DefaultAnnotationRepository == false)
+ log.info("Cannot merge with non DefaultAnnotationRepository repo.");
+
+ // FIXME -- restrictions, filtering, ...
+
+ DefaultAnnotationRepository oldRepo = DefaultAnnotationRepository.class.cast(repository);
+ Map<Class<? extends Annotation>, Map<ElementType, Set<ClassSignaturePair>>> env = oldRepo.getEnv();
+ for (Map.Entry<Class<? extends Annotation>, Map<ElementType, Set<ClassSignaturePair>>> entry : env.entrySet())
+ {
+ Map<ElementType, Set<ClassSignaturePair>> etMap = entry.getValue();
+ for (Map.Entry<ElementType, Set<ClassSignaturePair>> et : etMap.entrySet())
+ {
+ for (ClassSignaturePair csp : et.getValue())
+ {
+ putAnnotation(csp.getAnnotation(), entry.getKey(), et.getKey(), csp.getClassName(), csp.getSignature());
+ }
+ }
+ }
+ }
+
+ /**
+ * Put the annotation info.
+ *
+ * @param annotation the annotation
+ * @param type the annotation type
+ * @param className the class name
+ * @param signature the signature
+ */
+ void putAnnotation(Annotation annotation, ElementType type, String className, Signature signature)
+ {
+ putAnnotation(annotation, annotation.annotationType(), type, className, signature);
+ }
+
+ /**
+ * Put the annotation info.
+ *
+ * @param annotation the annotation
+ * @param annClass the annotation class
+ * @param type the annotation type
+ * @param className the class name
+ * @param signature the signature
+ */
+ protected void putAnnotation(Annotation annotation, Class<? extends Annotation> annClass, ElementType type, String className, Signature signature)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Adding annotation @" + annClass.getSimpleName() + " for " + className + " at type " + type + ", signature: " + signature);
+
+ // add to checked
+ checkedClassNames.add(className);
+
+ Map<Class<? extends Annotation>, Map<ElementType, Set<ClassSignaturePair>>> env = getEnv();
+
+ Map<ElementType, Set<ClassSignaturePair>> elements = env.get(annClass);
+ if (elements == null)
+ {
+ elements = new HashMap<ElementType, Set<ClassSignaturePair>>();
+ env.put(annClass, elements);
+ }
+
+ Set<ClassSignaturePair> classes = elements.get(type);
+ if (classes == null)
+ {
+ classes = CollectionsFactory.createLazySet();
+ elements.put(type, classes);
+ }
+
+ ClassSignaturePair pair;
+ if (keepAnnotations)
+ pair = new ClassSignaturePair(className, signature, annotation);
+ else
+ pair = new ClassSignaturePair(className, signature);
+ classes.add(pair);
+ }
+
+ /**
+ * Get matching cs pairs.
+ *
+ * @param annClass the annotation class
+ * @param type the annotation type
+ * @return class names
+ */
+ protected Set<ClassSignaturePair> getCSPairs(Class<? extends Annotation> annClass, ElementType type)
+ {
+ Set<ClassSignaturePair> pairs = null;
+
+ Map<ElementType, Set<ClassSignaturePair>> elements = getEnv().get(annClass);
+ if (elements != null)
+ pairs = elements.get(type);
+
+ return (pairs != null) ? pairs : Collections.<ClassSignaturePair>emptySet();
+ }
+
+ /**
+ * Transform class names into classes.
+ *
+ * @param <A> the annotation type
+ * @param <M> the annotated element type
+ * @param type the annotation type
+ * @param annClass the annotation class
+ * @param aoClass the ao class
+ * @return classes
+ */
+ protected <A extends Annotation, M extends AnnotatedElement> Set<Element<A, M>> transformToElements(
+ ElementType type,
+ Class<A> annClass,
+ Class<M> aoClass
+ )
+ {
+ Set<ClassSignaturePair> pairs = getCSPairs(annClass, type);
+ if (pairs.isEmpty())
+ return Collections.emptySet();
+
+ ClassLoader classLoader = getClassLoader();
+ Set<Element<A, M>> elements = new HashSet<Element<A, M>>();
+ for (ClassSignaturePair pair : pairs)
+ {
+ String className = pair.getClassName();
+ A annotation = annClass.cast(pair.getAnnotation());
+
+ Element<A, M> element;
+ if (type == ElementType.TYPE)
+ element = new ClassElement<A, M>(classLoader, className, annClass, annotation);
+ else if (type == ElementType.PARAMETER)
+ element = new ParametersElement<A,M>(classLoader, className, pair.getSignature(), annClass, annotation, aoClass);
+ else
+ element = new DefaultElement<A,M>(classLoader, className, pair.getSignature(), annClass, annotation, aoClass);
+ elements.add(element);
+ }
+ return elements;
+ }
+
+ public boolean hasClassAnnotatedWith(Class<? extends Annotation> annotation)
+ {
+ return getCSPairs(annotation, ElementType.TYPE).isEmpty() == false;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <A extends Annotation> Set<Element<A, Class<?>>> classIsAnnotatedWith(Class<A> annotation)
+ {
+ return (Set) transformToElements(ElementType.TYPE, annotation, Class.class);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <A extends Annotation> Set<Element<A, Constructor<?>>> classHasConstructorAnnotatedWith(Class<A> annotation)
+ {
+ return (Set) transformToElements(ElementType.CONSTRUCTOR, annotation, Constructor.class);
+ }
+
+ public <A extends Annotation> Set<Element<A, Field>> classHasFieldAnnotatedWith(Class<A> annotation)
+ {
+ return transformToElements(ElementType.FIELD, annotation, Field.class);
+ }
+
+ public <A extends Annotation> Set<Element<A, Method>> classHasMethodAnnotatedWith(Class<A> annotation)
+ {
+ return transformToElements(ElementType.METHOD, annotation, Method.class);
+ }
+
+ public <A extends Annotation> Set<Element<A, AnnotatedElement>> classHasParameterAnnotatedWith(Class<A> annotation)
+ {
+ return transformToElements(ElementType.PARAMETER, annotation, AnnotatedElement.class);
+ }
+
+ /**
+ * Load the annotation class.
+ *
+ * @param annotationName the annoation class name
+ * @return annotation class
+ */
+ @SuppressWarnings("unchecked")
+ protected Class<Annotation> getAnnotationClass(String annotationName)
+ {
+ Class<?> clazz = loadClass(annotationName);
+ if (Annotation.class.isAssignableFrom(clazz) == false)
+ throw new IllegalArgumentException("Annotation name " + annotationName + " doesn't extend Annotation class.");
+
+ return (Class<Annotation>)clazz;
+ }
+
+ public boolean hasClassAnnotatedWith(String annotationName)
+ {
+ return hasClassAnnotatedWith(getAnnotationClass(annotationName));
+ }
+
+ public Set<Element<Annotation, Class<?>>> classIsAnnotatedWith(String annotationName)
+ {
+ return classIsAnnotatedWith(getAnnotationClass(annotationName));
+ }
+
+ public Set<Element<Annotation, Constructor<?>>> classHasConstructorAnnotatedWith(String annotationName)
+ {
+ return classHasConstructorAnnotatedWith(getAnnotationClass(annotationName));
+ }
+
+ public Set<Element<Annotation, Field>> classHasFieldAnnotatedWith(String annotationName)
+ {
+ return classHasFieldAnnotatedWith(getAnnotationClass(annotationName));
+ }
+
+ public Set<Element<Annotation, Method>> classHasMethodAnnotatedWith(String annotationName)
+ {
+ return classHasMethodAnnotatedWith(getAnnotationClass(annotationName));
+ }
+
+ public Set<Element<Annotation, AnnotatedElement>> classHasParameterAnnotatedWith(String annotationName)
+ {
+ return classHasParameterAnnotatedWith(getAnnotationClass(annotationName));
+ }
+}
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/DefaultElement.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/DefaultElement.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/DefaultElement.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/DefaultElement.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.repository;
+
+import org.jboss.metadata.spi.signature.Signature;
+import org.jboss.metadata.spi.signature.ConstructorSignature;
+import org.jboss.metadata.spi.signature.ConstructorParametersSignature;
+import org.jboss.metadata.spi.signature.MethodSignature;
+import org.jboss.metadata.spi.signature.MethodParametersSignature;
+import org.jboss.metadata.spi.signature.FieldSignature;
+import org.jboss.reflect.plugins.introspection.ReflectionUtils;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+
+/**
+ * Default annotations element.
+ *
+ * @param <A> the annotation type
+ * @param <M> the annotated element type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class DefaultElement<A extends Annotation, M extends AnnotatedElement> extends AbstractElement<A, M>
+{
+ protected Signature signature;
+ protected Class<M> aoClass;
+
+ public DefaultElement(ClassLoader classLoader, String className, Signature signature, Class<A> annClass, A annotation, Class<M> aoClass)
+ {
+ super(classLoader, className, annClass, annotation);
+
+ if (signature == null)
+ throw new IllegalArgumentException("Null signature");
+ if (aoClass == null)
+ throw new IllegalArgumentException("Null ao class");
+
+ this.signature = signature;
+ this.aoClass = aoClass;
+ }
+
+ public M getAnnotatedElement()
+ {
+ AnnotatedElement result = null;
+
+ Class<?> clazz = getOwner();
+ if (signature instanceof ConstructorSignature || signature instanceof ConstructorParametersSignature)
+ {
+ try
+ {
+ result = clazz.getConstructor(signature.getParametersTypes(clazz));
+ }
+ catch (NoSuchMethodException ignored)
+ {
+ }
+ }
+ else if (signature instanceof MethodSignature || signature instanceof MethodParametersSignature)
+ {
+ try
+ {
+ result = clazz.getMethod(signature.getName(), signature.getParametersTypes(clazz));
+ }
+ catch (NoSuchMethodException ignored)
+ {
+ }
+ }
+ else if (signature instanceof FieldSignature)
+ {
+ result = ReflectionUtils.findField(clazz, signature.getName());
+ }
+
+ if (result == null)
+ throw new IllegalArgumentException("Expected accessible object " + className + "." + signature);
+ if (aoClass.isInstance(result) == false)
+ throw new IllegalArgumentException("Expected accessible object " + className + "." + signature + " of type " + aoClass);
+
+ return aoClass.cast(result);
+ }
+
+ public int getHashCode()
+ {
+ int hash = super.getHashCode();
+ hash += 19 * signature.hashCode();
+ hash += 37 * aoClass.hashCode();
+ return hash;
+ }
+
+ @SuppressWarnings({"EqualsWhichDoesntCheckParameterClass"})
+ public boolean equals(Object obj)
+ {
+ if (super.equals(obj) == false)
+ return false;
+
+ DefaultElement<?, ?> de = DefaultElement.class.cast(obj);
+ if (aoClass.equals(de.aoClass) == false)
+ return false;
+ if (signature.equals(de.signature) == false)
+ return false;
+
+ return true;
+ }
+}
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/GenericAnnotationResourceVisitor.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/GenericAnnotationResourceVisitor.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/GenericAnnotationResourceVisitor.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/GenericAnnotationResourceVisitor.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,356 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.repository;
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.ElementType;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.classloading.spi.visitor.ClassFilter;
+import org.jboss.classloading.spi.visitor.ResourceContext;
+import org.jboss.classloading.spi.visitor.ResourceFilter;
+import org.jboss.classloading.spi.visitor.ResourceVisitor;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.spi.signature.Signature;
+import org.jboss.reflect.spi.AnnotatedInfo;
+import org.jboss.reflect.spi.AnnotationValue;
+import org.jboss.reflect.spi.ClassInfo;
+import org.jboss.reflect.spi.ConstructorInfo;
+import org.jboss.reflect.spi.MemberInfo;
+import org.jboss.reflect.spi.MethodInfo;
+import org.jboss.reflect.spi.ParameterInfo;
+import org.jboss.reflect.spi.TypeInfo;
+
+/**
+ * Generic annotation scanner deployer.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class GenericAnnotationResourceVisitor implements ResourceVisitor
+{
+ private static final Logger log = Logger.getLogger(GenericAnnotationResourceVisitor.class);
+
+ private ResourceFilter resourceFilter = ClassFilter.INSTANCE;
+ private boolean forceAnnotations;
+ private boolean checkSuper;
+ private boolean checkInterfaces = true;
+ private DefaultAnnotationRepository repository;
+ private TypeInfoProvider typeInfoProvider = new IntrospectionTypeInfoProvider();
+
+ public GenericAnnotationResourceVisitor(DefaultAnnotationRepository repository)
+ {
+ this.repository = repository;
+ }
+
+ @SuppressWarnings("deprecation")
+ protected boolean isRelevant(ClassInfo ci)
+ {
+ return ci.getType().equals(Object.class) == false;
+ }
+
+ protected ClassInfo createClassInfo(ResourceContext context) throws Exception
+ {
+ TypeInfo typeInfo = typeInfoProvider.createTypeInfo(context);
+ if (typeInfo instanceof ClassInfo == false)
+ throw new IllegalArgumentException("Can only handle class info: " + typeInfo);
+
+ return ClassInfo.class.cast(typeInfo);
+ }
+
+ public ResourceFilter getFilter()
+ {
+ return resourceFilter;
+ }
+
+ public void visit(ResourceContext resource)
+ {
+ try
+ {
+ ClassInfo ctClass = createClassInfo(resource);
+ List<CommitElement> commit = createCommitList();
+ handleClass(ctClass, commit);
+ if (commit.isEmpty() == false)
+ {
+ for (CommitElement ce : commit)
+ {
+ repository.putAnnotation(ce.getAnnotation(), ce.getType(), ce.getClassName(), ce.getSignature());
+ }
+ }
+ }
+ catch (ClassNotFoundException e)
+ {
+ if (forceAnnotations)
+ throw new RuntimeException(e);
+
+ logThrowable(resource, e);
+ }
+ catch (Throwable t)
+ {
+ logThrowable(resource, t);
+ }
+ }
+
+ /**
+ * Create commit list.
+ *
+ * @return the commit list
+ */
+ protected List<CommitElement> createCommitList()
+ {
+ return forceAnnotations ? new RepositoryPutList(repository) : new ArrayList<CommitElement>();
+ }
+
+ /**
+ * Log throwable.
+ *
+ * @param resource the resource we're visiting
+ * @param t the throwable
+ */
+ protected void logThrowable(ResourceContext resource, Throwable t)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Exception reading resource: " + resource.getResourceName(), t);
+ }
+
+ /**
+ * Handle class adapter for annotations.
+ *
+ * @param classInfo the class info instance
+ * @param commit the commit list
+ * @throws Exception for any annotations lookup problems
+ */
+ protected void handleClass(ClassInfo classInfo, List<CommitElement> commit) throws Exception
+ {
+ if (classInfo == null || isRelevant(classInfo) == false)
+ return;
+
+ String className = classInfo.getName();
+ if (repository.isAlreadyChecked(className))
+ {
+ if (log.isTraceEnabled())
+ log.trace("Skipping already checked class name: " + className);
+ return;
+ }
+
+ if (checkInterfaces == false && classInfo.isInterface())
+ {
+ if (log.isTraceEnabled())
+ log.trace("Skipping interface: " + className);
+ return;
+ }
+
+ if (log.isTraceEnabled())
+ log.trace("Scanning class " + className + " for annotations");
+
+ AnnotationValue[] annotations = classInfo.getAnnotations();
+ handleAnnotations(ElementType.TYPE, (Signature)null, annotations, className, commit);
+
+ handleMembers(ElementType.CONSTRUCTOR, classInfo.getDeclaredConstructors(), className, commit);
+ handleMembers(ElementType.METHOD, classInfo.getDeclaredMethods(), className, commit);
+ handleMembers(ElementType.FIELD, classInfo.getDeclaredFields(), className, commit);
+
+ if (checkSuper)
+ {
+ if (checkInterfaces)
+ {
+ // interfaces
+ ClassInfo[] interfaces = classInfo.getInterfaces();
+ if (interfaces != null && interfaces.length > 0)
+ {
+ for (ClassInfo intf : interfaces)
+ handleClass(intf, commit);
+ }
+ }
+ // super class
+ handleClass(classInfo.getSuperclass(), commit);
+ }
+ }
+
+ /**
+ * Handle members for annotations.
+ *
+ * @param type where we found the annotations
+ * @param members the member instances
+ * @param className the className
+ * @param commit the commit list
+ * @throws Exception for any annotations lookup problems
+ */
+ protected void handleMembers(ElementType type, AnnotatedInfo[] members, String className, List<CommitElement> commit) throws Exception
+ {
+ if (members != null && members.length > 0)
+ {
+ for (AnnotatedInfo ainfo : members)
+ {
+ if (ainfo instanceof MemberInfo == false)
+ throw new IllegalArgumentException("Can only handle member info: " + ainfo);
+
+ AnnotationValue[] annotations = ainfo.getAnnotations();
+ MemberInfo member = MemberInfo.class.cast(ainfo);
+ handleAnnotations(type, member, annotations, className, commit);
+ if (isParametrized(ainfo))
+ {
+ AnnotationValue[][] paramAnnotations = getParameterAnnotations(member);
+ for (AnnotationValue[] paramAnnotation : paramAnnotations)
+ {
+ handleAnnotations(ElementType.PARAMETER, Signature.getSignature(member), paramAnnotation, className, commit);
+ }
+ }
+ }
+ }
+ }
+
+ protected boolean isParametrized(AnnotatedInfo member)
+ {
+ return member instanceof MethodInfo || member instanceof ConstructorInfo;
+ }
+
+ protected AnnotationValue[][] getParameterAnnotations(MemberInfo info)
+ {
+ ParameterInfo[] pinfos;
+ if (info instanceof ConstructorInfo)
+ {
+ ConstructorInfo ci = ConstructorInfo.class.cast(info);
+ pinfos = ci.getParameters();
+ }
+ else if (info instanceof MethodInfo)
+ {
+ MethodInfo mi = MethodInfo.class.cast(info);
+ pinfos = mi.getParameters();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot handle info: " + info);
+ }
+
+ AnnotationValue[][] values = new AnnotationValue[pinfos.length][];
+ for (int i = 0; i < pinfos.length; i++)
+ {
+ ParameterInfo pi = pinfos[i];
+ values[i] = pi.getAnnotations();
+ }
+ return values;
+ }
+
+ /**
+ * Handle annotations.
+ *
+ * @param type where we found the annotations
+ * @param member the member
+ * @param annotations the actual annotations
+ * @param className the className
+ * @param commit the commit list
+ * @throws Exception for any annotations lookup problems
+ */
+ protected static void handleAnnotations(ElementType type, MemberInfo member, AnnotationValue[] annotations, String className, List<CommitElement> commit) throws Exception
+ {
+ Signature signature = null;
+ if (member != null)
+ signature = Signature.getSignature(member);
+
+ handleAnnotations(type, signature, annotations, className, commit);
+ }
+
+ /**
+ * Handle annotations.
+ *
+ * @param type where we found the annotations
+ * @param signature the signature
+ * @param annotations the actual annotations
+ * @param className the className
+ * @param commit the commit list
+ */
+ protected static void handleAnnotations(ElementType type, Signature signature, AnnotationValue[] annotations, String className, List<CommitElement> commit)
+ {
+ if (annotations != null && annotations.length > 0)
+ {
+ for (AnnotationValue annotationValue : annotations)
+ {
+ Annotation annotation = annotationValue.getUnderlyingAnnotation();
+ commit.add(new CommitElement(annotation, type, className, signature));
+ }
+ }
+ }
+
+ /**
+ * Set the resource filter.
+ *
+ * @param resourceFilter the resource filter
+ */
+ public void setResourceFilter(ResourceFilter resourceFilter)
+ {
+ this.resourceFilter = resourceFilter;
+ }
+
+ /**
+ * Should we force all annotations to be available.
+ *
+ * @param forceAnnotations the force annotations flag
+ */
+ public void setForceAnnotations(boolean forceAnnotations)
+ {
+ this.forceAnnotations = forceAnnotations;
+ }
+
+ /**
+ * Set the keep annotations flag.
+ *
+ * @param keepAnnotations the keep annotations flag
+ */
+ public void setKeepAnnotations(boolean keepAnnotations)
+ {
+ repository.setKeepAnnotations(keepAnnotations);
+ }
+
+ /**
+ * Should we check super class for annotations as well.
+ *
+ * @param checkSuper the check super flag
+ */
+ public void setCheckSuper(boolean checkSuper)
+ {
+ this.checkSuper = checkSuper;
+ }
+
+ /**
+ * Should we check interfaces for annotations as well.
+ *
+ * @param checkInterfaces the check interfaces flag
+ */
+ public void setCheckInterfaces(boolean checkInterfaces)
+ {
+ this.checkInterfaces = checkInterfaces;
+ }
+
+ /**
+ * Set type info provider.
+ *
+ * @param typeInfoProvider the type info factory
+ */
+ public void setTypeInfoProvider(TypeInfoProvider typeInfoProvider)
+ {
+ if (typeInfoProvider == null)
+ throw new IllegalArgumentException("Null type info provider.");
+
+ this.typeInfoProvider = typeInfoProvider;
+ }
+}
\ No newline at end of file
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/IntrospectionTypeInfoProvider.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/IntrospectionTypeInfoProvider.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/IntrospectionTypeInfoProvider.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/IntrospectionTypeInfoProvider.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.repository;
+
+import org.jboss.classloading.spi.visitor.ResourceContext;
+import org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactory;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.reflect.spi.TypeInfoFactory;
+
+/**
+ * Introspection type info provider
+ */
+public class IntrospectionTypeInfoProvider implements TypeInfoProvider
+{
+ private TypeInfoFactory factory = new IntrospectionTypeInfoFactory();
+
+ public TypeInfo createTypeInfo(ResourceContext context) throws Exception
+ {
+ return factory.getTypeInfo(context.loadClass());
+ }
+}
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/ParametersElement.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/ParametersElement.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/ParametersElement.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/ParametersElement.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.repository;
+
+import org.jboss.metadata.spi.signature.Signature;
+import org.jboss.metadata.spi.signature.ConstructorParametersSignature;
+import org.jboss.metadata.spi.signature.MethodParametersSignature;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+/**
+ * Parameters annotations element.
+ *
+ * @param <A> the annotation type
+ * @param <M> the annotated element type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ParametersElement<A extends Annotation, M extends AnnotatedElement> extends DefaultElement<A, M>
+{
+ public ParametersElement(ClassLoader classLoader, String className, Signature signature, Class<A> annClass, A annotation, Class<M> aoClass)
+ {
+ super(classLoader, className, signature, annClass, annotation, aoClass);
+ }
+
+ protected A readAnnotation()
+ {
+ Annotation[] annotations = null;
+ Class<?> clazz = getOwner();
+ if (signature instanceof ConstructorParametersSignature)
+ {
+ ConstructorParametersSignature cps = (ConstructorParametersSignature)signature;
+ try
+ {
+ Constructor<?> constructor = clazz.getConstructor(signature.getParametersTypes(clazz));
+ annotations = constructor.getParameterAnnotations()[cps.getParam()];
+ }
+ catch (NoSuchMethodException ignored)
+ {
+ }
+ }
+ else if (signature instanceof MethodParametersSignature)
+ {
+ MethodParametersSignature mps = (MethodParametersSignature)signature;
+ try
+ {
+ Method method = clazz.getMethod(signature.getName(), signature.getParametersTypes(clazz));
+ annotations = method.getParameterAnnotations()[mps.getParam()];
+ }
+ catch (NoSuchMethodException ignored)
+ {
+ }
+ }
+
+ if (annotations == null || annotations.length == 0)
+ throw new IllegalArgumentException("Expected annotations " + className + "." + signature);
+
+ for(Annotation annotation : annotations)
+ {
+ if (annClass.equals(annotation.annotationType()))
+ return annClass.cast(annotation);
+ }
+
+ throw new IllegalArgumentException("No matching annotation: " + Arrays.asList(annotations));
+ }
+}
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/RepositoryPutList.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/EnvPutList.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/RepositoryPutList.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/RepositoryPutList.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.repository;
+
+import java.util.AbstractList;
+
+/**
+ * Put elements directly into repository
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+class RepositoryPutList extends AbstractList<CommitElement>
+{
+ private DefaultAnnotationRepository repository;
+
+ RepositoryPutList(DefaultAnnotationRepository repository)
+ {
+ if (repository == null)
+ throw new IllegalArgumentException("Null repository.");
+ this.repository = repository;
+ }
+
+ public boolean add(CommitElement ce)
+ {
+ repository.putAnnotation(ce.getAnnotation(), ce.getType(), ce.getClassName(), ce.getSignature());
+ return true;
+ }
+
+ public CommitElement get(int index)
+ {
+ throw new UnsupportedOperationException("Should not be invoked.");
+ }
+
+ public int size()
+ {
+ return 0;
+ }
+}
\ No newline at end of file
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/TypeInfoProvider.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/TypeInfoProvider.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/TypeInfoProvider.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/TypeInfoProvider.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.repository;
+
+import org.jboss.classloading.spi.visitor.ResourceContext;
+import org.jboss.reflect.spi.TypeInfo;
+
+/**
+ * Type info provider.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface TypeInfoProvider
+{
+ /**
+ * Create type info.
+ *
+ * @param context the resource context
+ * @return type info
+ * @throws Exception for any error
+ */
+ TypeInfo createTypeInfo(ResourceContext context) throws Exception;
+}
\ No newline at end of file
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/WeakClassLoaderHolder.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/WeakClassLoaderHolder.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/WeakClassLoaderHolder.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/WeakClassLoaderHolder.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.repository;
+
+import org.jboss.util.JBossObject;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * ClassLoader holder helper.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+abstract class WeakClassLoaderHolder extends JBossObject
+{
+ private transient WeakReference<ClassLoader> clRef;
+
+ public WeakClassLoaderHolder(ClassLoader classLoader)
+ {
+ if (classLoader == null)
+ throw new IllegalArgumentException("Null classloader");
+
+ clRef = new WeakReference<ClassLoader>(classLoader);
+ }
+
+ /**
+ * Get the classloader from weak ref.
+ *
+ * @return the classloader
+ */
+ protected ClassLoader getClassLoader()
+ {
+ if (clRef == null)
+ throw new IllegalArgumentException("Null classloader ref, previously serialized?");
+
+ ClassLoader classLoader = clRef.get();
+ if (classLoader == null)
+ throw new IllegalArgumentException("ClassLoader was already garbage collected.");
+
+ return classLoader;
+ }
+
+ /**
+ * Load class from class name.
+ *
+ * @param className the class name
+ * @return loaded class
+ */
+ protected Class<?> loadClass(String className)
+ {
+ try
+ {
+ return Class.forName(className, false, getClassLoader());
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
\ No newline at end of file
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/javassist (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/javassist)
Modified: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/javassist/JavassistTypeInfoProvider.java
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/javassist/JavassistTypeInfoProvider.java 2009-10-20 20:16:44 UTC (rev 95198)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/javassist/JavassistTypeInfoProvider.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -19,14 +19,14 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.mcann.repository.plugins.javassist;
+package org.jboss.mcann.repository.javassist;
import java.io.InputStream;
import javassist.ClassPool;
import javassist.CtClass;
import org.jboss.classloading.spi.visitor.ResourceContext;
-import org.jboss.mcann.repository.plugins.TypeInfoProvider;
+import org.jboss.mcann.repository.TypeInfoProvider;
import org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl;
import org.jboss.reflect.plugins.javassist.JavassistUtil;
import org.jboss.reflect.plugins.javassist.classpool.ClassPoolFactory;
Modified: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/DefaultAnnotationScanner.java
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/DefaultAnnotationScanner.java 2009-10-20 22:04:50 UTC (rev 95214)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/DefaultAnnotationScanner.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -21,17 +21,18 @@
*/
package org.jboss.mcann.scanner;
+import java.net.URL;
+
import org.jboss.classloader.spi.filter.ClassFilter;
-import org.jboss.classloading.plugins.vfs.VFSResourceVisitor;
import org.jboss.classloading.spi.visitor.ResourceFilter;
import org.jboss.classloading.spi.visitor.ResourceVisitor;
-import org.jboss.mcann.repository.plugins.DefaultAnnotationRepository;
-import org.jboss.mcann.repository.plugins.GenericAnnotationResourceVisitor;
+import org.jboss.classloading.plugins.vfs.VFSResourceVisitor;
+import org.jboss.mcann.repository.DefaultAnnotationRepository;
+import org.jboss.mcann.repository.GenericAnnotationResourceVisitor;
+import org.jboss.mcann.repository.TypeInfoProvider;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
-import java.net.URL;
-
/**
* Default annotation scanner.
*
@@ -39,10 +40,15 @@
*/
public class DefaultAnnotationScanner extends AbstractAnnotationScanner<DefaultAnnotationRepository>
{
- private VirtualFile[] excludedRoots;
- private ClassFilter included;
- private ClassFilter excluded;
- private ResourceFilter recurseFilter;
+ protected boolean forceAnnotations;
+ protected boolean keepAnnotations;
+ protected boolean checkInterfaces;
+ protected VirtualFile[] excludedRoots;
+ protected ClassFilter included;
+ protected ClassFilter excluded;
+ protected ResourceFilter resourceFilter;
+ protected ResourceFilter recurseFilter;
+ protected TypeInfoProvider typeInfoProvider;
protected DefaultAnnotationRepository createAnnotationRepository(ClassLoader classLoader)
{
@@ -57,15 +63,60 @@
roots[i] = VFS.getRoot(urls[i]);
}
- ResourceVisitor visitor = createResourceVisitor(repo, classLoader);
- VFSResourceVisitor.visit(roots, excludedRoots, included, excluded, classLoader, visitor, visitor.getFilter(), recurseFilter, urls);
+ ResourceVisitor visitor = createResourceVisitor(repo);
+ ResourceFilter filter = resourceFilter;
+ if (filter == null)
+ filter = visitor.getFilter();
+
+ visit(roots, classLoader, visitor, filter, urls);
}
- protected ResourceVisitor createResourceVisitor(DefaultAnnotationRepository repository, ClassLoader classLoader)
+ protected void visit(VirtualFile[] roots, ClassLoader classLoader, ResourceVisitor visitor, ResourceFilter filter, URL[] urls)
{
- return new GenericAnnotationResourceVisitor(repository);
+ VFSResourceVisitor.visit(roots, excludedRoots, included, excluded, classLoader, visitor, filter, recurseFilter, urls);
}
+ protected ResourceVisitor createResourceVisitor(DefaultAnnotationRepository repository)
+ {
+ GenericAnnotationResourceVisitor visitor = new GenericAnnotationResourceVisitor(repository);
+ visitor.setForceAnnotations(forceAnnotations);
+ visitor.setKeepAnnotations(keepAnnotations);
+ visitor.setCheckInterfaces(checkInterfaces);
+ if (typeInfoProvider != null)
+ visitor.setTypeInfoProvider(typeInfoProvider);
+ return visitor;
+ }
+
+ /**
+ * Should we force all annotations to be available.
+ *
+ * @param forceAnnotations the force annotations flag
+ */
+ public void setForceAnnotations(boolean forceAnnotations)
+ {
+ this.forceAnnotations = forceAnnotations;
+ }
+
+ /**
+ * Set the keep annotations flag.
+ *
+ * @param keepAnnotations the keep annotations flag
+ */
+ public void setKeepAnnotations(boolean keepAnnotations)
+ {
+ this.keepAnnotations = keepAnnotations;
+ }
+
+ /**
+ * Should we check interfaces for annotations as well.
+ *
+ * @param checkInterfaces the check interfaces flag
+ */
+ public void setCheckInterfaces(boolean checkInterfaces)
+ {
+ this.checkInterfaces = checkInterfaces;
+ }
+
public void setExcludedRoots(VirtualFile[] excludedRoots)
{
this.excludedRoots = excludedRoots;
@@ -81,8 +132,18 @@
this.excluded = excluded;
}
+ public void setResourceFilter(ResourceFilter resourceFilter)
+ {
+ this.resourceFilter = resourceFilter;
+ }
+
public void setRecurseFilter(ResourceFilter recurseFilter)
{
this.recurseFilter = recurseFilter;
}
+
+ public void setTypeInfoProvider(TypeInfoProvider typeInfoProvider)
+ {
+ this.typeInfoProvider = typeInfoProvider;
+ }
}
Deleted: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/JavassistAnnotationScanner.java
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/JavassistAnnotationScanner.java 2009-10-20 22:04:50 UTC (rev 95214)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/JavassistAnnotationScanner.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.mcann.scanner;
-
-import javassist.ClassPath;
-import javassist.ClassPool;
-import javassist.LoaderClassPath;
-import org.jboss.classloading.spi.visitor.ResourceVisitor;
-import org.jboss.mcann.repository.plugins.DefaultAnnotationRepository;
-import org.jboss.mcann.repository.plugins.GenericAnnotationResourceVisitor;
-import org.jboss.mcann.repository.plugins.javassist.JavassistTypeInfoProvider;
-
-/**
- * Javassist annotation scanner.
- *
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class JavassistAnnotationScanner extends DefaultAnnotationScanner
-{
- private ClassPool pool;
-
- @Override
- protected ResourceVisitor createResourceVisitor(DefaultAnnotationRepository repository, ClassLoader classLoader)
- {
- ClassPool cp = pool;
- if (cp == null)
- cp = ClassPool.getDefault();
-
- ClassPath classPath = new LoaderClassPath(classLoader);
- cp.appendClassPath(classPath);
-
- GenericAnnotationResourceVisitor visitor = new GenericAnnotationResourceVisitor(repository);
- visitor.setTypeInfoProvider(new JavassistTypeInfoProvider(cp));
- return visitor;
- }
-
- public void setPool(ClassPool pool)
- {
- this.pool = pool;
- }
-}
\ No newline at end of file
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/ModuleAnnotationScanner.java (from rev 95198, projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/DefaultAnnotationScanner.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/ModuleAnnotationScanner.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/ModuleAnnotationScanner.java 2009-10-20 22:16:36 UTC (rev 95215)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mcann.scanner;
+
+import java.net.URL;
+
+import org.jboss.classloading.spi.dependency.Module;
+import org.jboss.classloading.spi.visitor.ResourceFilter;
+import org.jboss.classloading.spi.visitor.ResourceVisitor;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Module annotation scanner.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class ModuleAnnotationScanner extends DefaultAnnotationScanner
+{
+ private Module module;
+
+ public ModuleAnnotationScanner(Module module)
+ {
+ if (module == null)
+ throw new IllegalArgumentException("Null module");
+ this.module = module;
+ }
+
+ @Override
+ protected void visit(VirtualFile[] roots, ClassLoader classLoader, ResourceVisitor visitor, ResourceFilter filter, URL[] urls)
+ {
+ module.visit(visitor, filter, recurseFilter, urls);
+ }
+}
\ No newline at end of file
Modified: projects/mc-ann/trunk/pom.xml
===================================================================
--- projects/mc-ann/trunk/pom.xml 2009-10-20 22:04:50 UTC (rev 95214)
+++ projects/mc-ann/trunk/pom.xml 2009-10-20 22:16:36 UTC (rev 95215)
@@ -26,6 +26,7 @@
<version.org.jboss.common.core>2.2.16.GA</version.org.jboss.common.core>
<version.org.jboss.vfs>2.1.3.SP1</version.org.jboss.vfs>
<version.org.jboss.reflect>2.2.0-SNAPSHOT</version.org.jboss.reflect>
+ <version.org.jboss.man>2.1.1.GA</version.org.jboss.man>
<version.org.jboss.classloader>2.0.7.GA</version.org.jboss.classloader>
<version.javassist>3.11.0.GA</version.javassist>
<version.ant>1.7.1</version.ant>
@@ -108,6 +109,16 @@
<version>${version.org.jboss.reflect}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ <version>${version.org.jboss.man}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-metatype</artifactId>
+ <version>${version.org.jboss.man}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.cl</groupId>
<artifactId>jboss-classloading</artifactId>
<version>${version.org.jboss.classloader}</version>
More information about the jboss-cvs-commits
mailing list