[jboss-cvs] JBossAS SVN: r95198 - in projects/mc-ann/trunk: core/src/main/java/org/jboss/mcann and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 20 16:16:45 EDT 2009
Author: alesj
Date: 2009-10-20 16:16:44 -0400 (Tue, 20 Oct 2009)
New Revision: 95198
Added:
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/
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/plugins/TypeInfoProvider.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/javassist/JavassistTypeInfoProvider.java
projects/mc-ann/trunk/core/src/test/java/org/jboss/mcann/
projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/
Removed:
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/javassist/JavassistAnnotationResourceVisitor.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/papaki/
projects/mc-ann/trunk/core/src/test/java/org/jboss/papaki/
projects/mc-ann/trunk/indexer/src/main/java/org/jboss/papaki/
Modified:
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationRepository.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationScanner.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationScannerFactory.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/Element.java
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/plugins/ClassElement.java
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/plugins/CommitElement.java
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/plugins/DefaultElement.java
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/plugins/GenericAnnotationResourceVisitor.java
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/plugins/WeakClassLoaderHolder.java
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/AbstractAnnotationScanner.java
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/JavassistAnnotationScanner.java
projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/indexer/FileUtil.java
projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/indexer/HTMLWriter.java
projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/indexer/IndexerTask.java
projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/indexer/Main.java
Log:
papaki --> mcann
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann (from rev 95189, projects/mc-ann/trunk/core/src/main/java/org/jboss/papaki)
Modified: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationRepository.java
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/papaki/AnnotationRepository.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationRepository.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -20,7 +20,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.papaki;
+package org.jboss.mcann;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
Modified: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationScanner.java
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/papaki/AnnotationScanner.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationScanner.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,7 +19,7 @@
* 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.papaki;
+package org.jboss.mcann;
import java.net.URL;
Modified: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationScannerFactory.java
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/papaki/AnnotationScannerFactory.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/AnnotationScannerFactory.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,10 +19,10 @@
* 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.papaki;
+package org.jboss.mcann;
-import org.jboss.papaki.scanner.DefaultAnnotationScanner;
-import org.jboss.papaki.scanner.JavassistAnnotationScanner;
+import org.jboss.mcann.scanner.DefaultAnnotationScanner;
+import org.jboss.mcann.scanner.JavassistAnnotationScanner;
/**
* An annotation scanner factory
Modified: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/Element.java
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/papaki/Element.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/Element.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -20,7 +20,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.papaki;
+package org.jboss.mcann;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
Modified: 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/papaki/repository/plugins/AbstractElement.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/AbstractElement.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,9 +19,9 @@
* 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.papaki.repository.plugins;
+package org.jboss.mcann.repository.plugins;
-import org.jboss.papaki.Element;
+import org.jboss.mcann.Element;
import java.lang.annotation.Annotation;
import java.lang.ref.SoftReference;
Modified: 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/papaki/repository/plugins/ClassElement.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/ClassElement.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,7 +19,7 @@
* 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.papaki.repository.plugins;
+package org.jboss.mcann.repository.plugins;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
Modified: 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/papaki/repository/plugins/ClassSignaturePair.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/ClassSignaturePair.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,7 +19,7 @@
* 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.papaki.repository.plugins;
+package org.jboss.mcann.repository.plugins;
import org.jboss.util.JBossObject;
import org.jboss.metadata.spi.signature.Signature;
Modified: 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/papaki/repository/plugins/CommitElement.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/CommitElement.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,7 +19,7 @@
* 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.papaki.repository.plugins;
+package org.jboss.mcann.repository.plugins;
import org.jboss.metadata.spi.signature.Signature;
Modified: 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/papaki/repository/plugins/DefaultAnnotationRepository.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/DefaultAnnotationRepository.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,11 +19,11 @@
* 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.papaki.repository.plugins;
+package org.jboss.mcann.repository.plugins;
import org.jboss.metadata.spi.signature.Signature;
-import org.jboss.papaki.AnnotationRepository;
-import org.jboss.papaki.Element;
+import org.jboss.mcann.AnnotationRepository;
+import org.jboss.mcann.Element;
import org.jboss.util.collection.CollectionsFactory;
import java.io.Serializable;
Modified: 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/papaki/repository/plugins/DefaultElement.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/DefaultElement.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,7 +19,7 @@
* 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.papaki.repository.plugins;
+package org.jboss.mcann.repository.plugins;
import org.jboss.metadata.spi.signature.Signature;
import org.jboss.metadata.spi.signature.ConstructorSignature;
Modified: 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/papaki/repository/plugins/EnvPutList.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/EnvPutList.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,7 +19,7 @@
* 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.papaki.repository.plugins;
+package org.jboss.mcann.repository.plugins;
import java.util.AbstractList;
Modified: 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/papaki/repository/plugins/GenericAnnotationResourceVisitor.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/GenericAnnotationResourceVisitor.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,15 +19,19 @@
* 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.papaki.repository.plugins;
+package org.jboss.mcann.repository.plugins;
+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.plugins.introspection.IntrospectionTypeInfoFactory;
import org.jboss.reflect.spi.AnnotatedInfo;
import org.jboss.reflect.spi.AnnotationValue;
import org.jboss.reflect.spi.ClassInfo;
@@ -36,13 +40,7 @@
import org.jboss.reflect.spi.MethodInfo;
import org.jboss.reflect.spi.ParameterInfo;
import org.jboss.reflect.spi.TypeInfo;
-import org.jboss.reflect.spi.TypeInfoFactory;
-import java.lang.annotation.Annotation;
-import java.lang.annotation.ElementType;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* Generic annotation scanner deployer.
*
@@ -57,32 +55,22 @@
private boolean checkSuper;
private boolean checkInterfaces = true;
private DefaultAnnotationRepository repository;
- private TypeInfoFactory typeInfoFactory = createTypeInfoFactory();
+ private TypeInfoProvider typeInfoProvider = new IntrospectionTypeInfoProvider();
public GenericAnnotationResourceVisitor(DefaultAnnotationRepository repository)
{
this.repository = repository;
}
- protected TypeInfoFactory createTypeInfoFactory()
- {
- return new IntrospectionTypeInfoFactory();
- }
-
@SuppressWarnings("deprecation")
protected boolean isRelevant(ClassInfo ci)
{
return ci.getType().equals(Object.class) == false;
}
- protected TypeInfo createTypeInfo(ResourceContext context) throws Exception
- {
- return typeInfoFactory.getTypeInfo(context.loadClass());
- }
-
protected ClassInfo createClassInfo(ResourceContext context) throws Exception
{
- TypeInfo typeInfo = createTypeInfo(context);
+ TypeInfo typeInfo = typeInfoProvider.createTypeInfo(context);
if (typeInfo instanceof ClassInfo == false)
throw new IllegalArgumentException("Can only handle class info: " + typeInfo);
@@ -352,4 +340,17 @@
{
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/plugins/IntrospectionTypeInfoProvider.java (from rev 95189, projects/mc-ann/trunk/core/src/main/java/org/jboss/papaki/repository/plugins/GenericAnnotationResourceVisitor.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/IntrospectionTypeInfoProvider.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/IntrospectionTypeInfoProvider.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -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.plugins;
+
+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());
+ }
+}
Modified: 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/papaki/repository/plugins/ParametersElement.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/ParametersElement.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,7 +19,7 @@
* 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.papaki.repository.plugins;
+package org.jboss.mcann.repository.plugins;
import org.jboss.metadata.spi.signature.Signature;
import org.jboss.metadata.spi.signature.ConstructorParametersSignature;
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/TypeInfoProvider.java (from rev 95189, projects/mc-ann/trunk/core/src/main/java/org/jboss/papaki/repository/plugins/GenericAnnotationResourceVisitor.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/TypeInfoProvider.java (rev 0)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/TypeInfoProvider.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -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.plugins;
+
+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
Modified: 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/papaki/repository/plugins/WeakClassLoaderHolder.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/WeakClassLoaderHolder.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,7 +19,7 @@
* 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.papaki.repository.plugins;
+package org.jboss.mcann.repository.plugins;
import org.jboss.util.JBossObject;
Deleted: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/javassist/JavassistAnnotationResourceVisitor.java
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/papaki/repository/plugins/javassist/JavassistAnnotationResourceVisitor.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/javassist/JavassistAnnotationResourceVisitor.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -1,98 +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.papaki.repository.plugins.javassist;
-
-import org.jboss.classloading.spi.visitor.ResourceContext;
-import org.jboss.papaki.repository.plugins.DefaultAnnotationRepository;
-import org.jboss.papaki.repository.plugins.GenericAnnotationResourceVisitor;
-import org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactory;
-import org.jboss.reflect.plugins.javassist.JavassistUtil;
-import org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl;
-import org.jboss.reflect.plugins.javassist.classpool.ClassPoolFactory;
-import org.jboss.reflect.spi.TypeInfo;
-import org.jboss.reflect.spi.TypeInfoFactory;
-
-import java.io.InputStream;
-
-import javassist.ClassPool;
-import javassist.CtClass;
-
-/**
- * Javassist based annotation visitor.
- *
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class JavassistAnnotationResourceVisitor extends GenericAnnotationResourceVisitor
-{
- private ClassPool pool;
-
- public JavassistAnnotationResourceVisitor(DefaultAnnotationRepository repository)
- {
- this(repository, null);
- }
-
- public JavassistAnnotationResourceVisitor(DefaultAnnotationRepository repository, ClassPool pool)
- {
- super(repository);
- this.pool = pool;
- }
-
- @Override
- protected TypeInfoFactory createTypeInfoFactory()
- {
- return new JavassistTypeInfoFactory();
- }
-
- protected ClassPool getClassPool(ResourceContext context)
- {
- ClassPool cp = pool;
- if (cp == null)
- {
- ClassPoolFactory factory = JavassistTypeInfoFactoryImpl.getPoolFactory();
- cp = factory.getPoolForLoader(context.getClassLoader());
-
- if (cp == null)
- cp = ClassPool.getDefault();
- }
-
- return cp;
- }
-
- protected TypeInfo createTypeInfo(ResourceContext context) throws Exception
- {
- ClassPool cp = getClassPool(context);
-
- InputStream stream = context.getInputStream();
- if (stream == null)
- throw new IllegalArgumentException("Null stream: " + context);
-
- try
- {
- CtClass ctClass = cp.makeClass(stream);
- return JavassistUtil.toTypeInfo(ctClass);
- }
- finally
- {
- stream.close();
- }
- }
-}
Copied: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/javassist/JavassistTypeInfoProvider.java (from rev 95189, projects/mc-ann/trunk/core/src/main/java/org/jboss/papaki/repository/plugins/javassist/JavassistAnnotationResourceVisitor.java)
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/plugins/javassist/JavassistTypeInfoProvider.java (rev 0)
+++ 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)
@@ -0,0 +1,86 @@
+/*
+ * 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.plugins.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.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl;
+import org.jboss.reflect.plugins.javassist.JavassistUtil;
+import org.jboss.reflect.plugins.javassist.classpool.ClassPoolFactory;
+import org.jboss.reflect.spi.TypeInfo;
+
+/**
+ * Javassist based type info provider.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class JavassistTypeInfoProvider implements TypeInfoProvider
+{
+ private ClassPool pool;
+
+ public JavassistTypeInfoProvider()
+ {
+ }
+
+ public JavassistTypeInfoProvider(ClassPool pool)
+ {
+ this.pool = pool;
+ }
+
+ protected ClassPool getClassPool(ResourceContext context)
+ {
+ ClassPool cp = pool;
+ if (cp == null)
+ {
+ ClassPoolFactory factory = JavassistTypeInfoFactoryImpl.getPoolFactory();
+ cp = factory.getPoolForLoader(context.getClassLoader());
+
+ if (cp == null)
+ cp = ClassPool.getDefault();
+ }
+
+ return cp;
+ }
+
+ public TypeInfo createTypeInfo(ResourceContext context) throws Exception
+ {
+ ClassPool cp = getClassPool(context);
+
+ InputStream stream = context.getInputStream();
+ if (stream == null)
+ throw new IllegalArgumentException("Null stream: " + context);
+
+ try
+ {
+ CtClass ctClass = cp.makeClass(stream);
+ return JavassistUtil.toTypeInfo(ctClass);
+ }
+ finally
+ {
+ stream.close();
+ }
+ }
+}
Modified: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/AbstractAnnotationScanner.java
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/papaki/scanner/AbstractAnnotationScanner.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/AbstractAnnotationScanner.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,10 +19,10 @@
* 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.papaki.scanner;
+package org.jboss.mcann.scanner;
-import org.jboss.papaki.AnnotationRepository;
-import org.jboss.papaki.AnnotationScanner;
+import org.jboss.mcann.AnnotationRepository;
+import org.jboss.mcann.AnnotationScanner;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
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/papaki/scanner/DefaultAnnotationScanner.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/DefaultAnnotationScanner.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -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.papaki.scanner;
+package org.jboss.mcann.scanner;
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.papaki.repository.plugins.DefaultAnnotationRepository;
-import org.jboss.papaki.repository.plugins.GenericAnnotationResourceVisitor;
+import org.jboss.mcann.repository.plugins.DefaultAnnotationRepository;
+import org.jboss.mcann.repository.plugins.GenericAnnotationResourceVisitor;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
Modified: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/JavassistAnnotationScanner.java
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/papaki/scanner/JavassistAnnotationScanner.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/scanner/JavassistAnnotationScanner.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -19,15 +19,15 @@
* 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.papaki.scanner;
+package org.jboss.mcann.scanner;
-import org.jboss.classloading.spi.visitor.ResourceVisitor;
-import org.jboss.papaki.repository.plugins.DefaultAnnotationRepository;
-import org.jboss.papaki.repository.plugins.javassist.JavassistAnnotationResourceVisitor;
-
+import javassist.ClassPath;
import javassist.ClassPool;
-import javassist.ClassPath;
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.
@@ -48,7 +48,9 @@
ClassPath classPath = new LoaderClassPath(classLoader);
cp.appendClassPath(classPath);
- return new JavassistAnnotationResourceVisitor(repository, cp);
+ GenericAnnotationResourceVisitor visitor = new GenericAnnotationResourceVisitor(repository);
+ visitor.setTypeInfoProvider(new JavassistTypeInfoProvider(cp));
+ return visitor;
}
public void setPool(ClassPool pool)
Copied: projects/mc-ann/trunk/core/src/test/java/org/jboss/mcann (from rev 95189, projects/mc-ann/trunk/core/src/test/java/org/jboss/papaki)
Copied: projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann (from rev 95189, projects/mc-ann/trunk/indexer/src/main/java/org/jboss/papaki)
Modified: projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/indexer/FileUtil.java
===================================================================
--- projects/mc-ann/trunk/indexer/src/main/java/org/jboss/papaki/indexer/FileUtil.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/indexer/FileUtil.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -20,7 +20,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.papaki.indexer;
+package org.jboss.mcann.indexer;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Modified: projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/indexer/HTMLWriter.java
===================================================================
--- projects/mc-ann/trunk/indexer/src/main/java/org/jboss/papaki/indexer/HTMLWriter.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/indexer/HTMLWriter.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -20,7 +20,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.papaki.indexer;
+package org.jboss.mcann.indexer;
import java.io.BufferedWriter;
import java.io.File;
Modified: projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/indexer/IndexerTask.java
===================================================================
--- projects/mc-ann/trunk/indexer/src/main/java/org/jboss/papaki/indexer/IndexerTask.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/indexer/IndexerTask.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -20,11 +20,11 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.papaki.indexer;
+package org.jboss.mcann.indexer;
-import org.jboss.papaki.AnnotationRepository;
-import org.jboss.papaki.AnnotationScanner;
-import org.jboss.papaki.AnnotationScannerFactory;
+import org.jboss.mcann.AnnotationRepository;
+import org.jboss.mcann.AnnotationScanner;
+import org.jboss.mcann.AnnotationScannerFactory;
import java.io.File;
import java.io.IOException;
Modified: projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/indexer/Main.java
===================================================================
--- projects/mc-ann/trunk/indexer/src/main/java/org/jboss/papaki/indexer/Main.java 2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/mc-ann/trunk/indexer/src/main/java/org/jboss/mcann/indexer/Main.java 2009-10-20 20:16:44 UTC (rev 95198)
@@ -20,11 +20,11 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.papaki.indexer;
+package org.jboss.mcann.indexer;
-import org.jboss.papaki.AnnotationRepository;
-import org.jboss.papaki.AnnotationScanner;
-import org.jboss.papaki.AnnotationScannerFactory;
+import org.jboss.mcann.AnnotationRepository;
+import org.jboss.mcann.AnnotationScanner;
+import org.jboss.mcann.AnnotationScannerFactory;
import java.io.BufferedOutputStream;
import java.io.File;
More information about the jboss-cvs-commits
mailing list