[jboss-cvs] JBossAS SVN: r72905 - in projects/microcontainer/trunk: kernel/src/main/org/jboss/kernel/plugins/annotations and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Apr 30 19:59:21 EDT 2008
Author: alesj
Date: 2008-04-30 19:59:20 -0400 (Wed, 30 Apr 2008)
New Revision: 72905
Added:
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractConstructorParameterAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractMethodParameterAnnotationPlugin.java
Modified:
projects/microcontainer/trunk/build/pom.xml
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractParameterAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ConstructorParameterAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/FactoryMethodAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/InstallationParameterAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/LifecycleParameterAnnotationPlugin.java
Log:
Update to use ConstructorParametersSignature.
Modified: projects/microcontainer/trunk/build/pom.xml
===================================================================
--- projects/microcontainer/trunk/build/pom.xml 2008-04-30 22:46:28 UTC (rev 72904)
+++ projects/microcontainer/trunk/build/pom.xml 2008-04-30 23:59:20 UTC (rev 72905)
@@ -41,7 +41,7 @@
<version.javassist>3.7.1.GA</version.javassist>
<version.jboss.aop>2.0.0.CR8</version.jboss.aop>
<version.org.jboss.reflect>2.0.0.Beta12</version.org.jboss.reflect>
- <version.org.jboss.mdr>2.0.0.Beta14</version.org.jboss.mdr>
+ <version.org.jboss.mdr>2.0.0-SNAPSHOT</version.org.jboss.mdr>
<version.org.jboss.test>1.0.5.GA</version.org.jboss.test>
<version.junit>4.4</version.junit>
<version.jboss.profiler.jvmti>1.0.0.CR5</version.jboss.profiler.jvmti>
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractConstructorParameterAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractConstructorParameterAnnotationPlugin.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractConstructorParameterAnnotationPlugin.java 2008-04-30 23:59:20 UTC (rev 72905)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.kernel.plugins.annotations;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import org.jboss.beans.metadata.plugins.builder.MutableParameterizedMetaData;
+import org.jboss.metadata.spi.signature.ConstructorParametersSignature;
+import org.jboss.metadata.spi.signature.Signature;
+import org.jboss.reflect.spi.ConstructorInfo;
+
+/**
+ * Annotation plugin for handling annotations that take parameters in constructors.
+ *
+ * @param <C> annotation type
+ * @param <P> mutable parametrized type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractConstructorParameterAnnotationPlugin<C extends Annotation, P extends MutableParameterizedMetaData> extends AbstractParameterAnnotationPlugin<ConstructorInfo, C, P>
+{
+ protected AbstractConstructorParameterAnnotationPlugin(Class<C> annotation, Set<Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters)
+ {
+ super(annotation, adapters);
+ }
+
+ protected Signature createParametersSignature(String name, String[] parameters, int index)
+ {
+ return new ConstructorParametersSignature(index, parameters);
+ }
+}
\ No newline at end of file
Copied: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractMethodParameterAnnotationPlugin.java (from rev 72904, projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractParameterAnnotationPlugin.java)
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractMethodParameterAnnotationPlugin.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractMethodParameterAnnotationPlugin.java 2008-04-30 23:59:20 UTC (rev 72905)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.kernel.plugins.annotations;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import org.jboss.beans.metadata.plugins.builder.MutableParameterizedMetaData;
+import org.jboss.metadata.spi.signature.MethodParametersSignature;
+import org.jboss.metadata.spi.signature.Signature;
+import org.jboss.reflect.spi.MethodInfo;
+
+/**
+ * Annotation plugin for handling annotations that take parameters in methods.
+ *
+ * @param <C> annotation type
+ * @param <P> mutable parametrized type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractMethodParameterAnnotationPlugin<C extends Annotation, P extends MutableParameterizedMetaData> extends AbstractParameterAnnotationPlugin<MethodInfo, C, P>
+{
+ protected AbstractMethodParameterAnnotationPlugin(Class<C> annotation, Set<Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters)
+ {
+ super(annotation, adapters);
+ }
+
+ protected Signature createParametersSignature(String name, String[] parameters, int index)
+ {
+ return new MethodParametersSignature(name, parameters, index);
+ }
+}
\ No newline at end of file
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractParameterAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractParameterAnnotationPlugin.java 2008-04-30 22:46:28 UTC (rev 72904)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/AbstractParameterAnnotationPlugin.java 2008-04-30 23:59:20 UTC (rev 72905)
@@ -36,7 +36,6 @@
import org.jboss.beans.metadata.spi.ValueMetaData;
import org.jboss.kernel.plugins.config.Configurator;
import org.jboss.metadata.spi.MetaData;
-import org.jboss.metadata.spi.signature.MethodParametersSignature;
import org.jboss.metadata.spi.signature.Signature;
import org.jboss.reflect.spi.AnnotatedInfo;
import org.jboss.reflect.spi.ParameterInfo;
@@ -153,7 +152,7 @@
for(int i=0; i < parameters.length; i++)
{
ParameterInfo pi = parameters[i];
- Signature pis = new MethodParametersSignature(
+ Signature pis = createParametersSignature(
pi.getName(),
Configurator.getParameterTypes(log.isTraceEnabled(), typeInfos),
i
@@ -188,4 +187,14 @@
throw new IllegalArgumentException("ParameterizedMetaData not MetaDataVisitor: " + parameterizedMetaData);
return Collections.singletonList((MetaDataVisitorNode)parameterizedMetaData);
}
+
+ /**
+ * Create parameters signature.
+ *
+ * @param name the name
+ * @param parameters the parameters
+ * @param index the index
+ * @return new signature
+ */
+ protected abstract Signature createParametersSignature(String name, String[] parameters, int index);
}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ConstructorParameterAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ConstructorParameterAnnotationPlugin.java 2008-04-30 22:46:28 UTC (rev 72904)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ConstructorParameterAnnotationPlugin.java 2008-04-30 23:59:20 UTC (rev 72905)
@@ -26,9 +26,9 @@
import java.util.List;
import java.util.Set;
+import org.jboss.beans.metadata.api.annotations.Constructor;
import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData;
-import org.jboss.beans.metadata.api.annotations.Constructor;
import org.jboss.beans.metadata.spi.BeanMetaData;
import org.jboss.beans.metadata.spi.MetaDataVisitorNode;
import org.jboss.reflect.spi.ConstructorInfo;
@@ -39,7 +39,7 @@
*
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
-public class ConstructorParameterAnnotationPlugin extends AbstractParameterAnnotationPlugin<ConstructorInfo, Constructor, AbstractConstructorMetaData>
+public class ConstructorParameterAnnotationPlugin extends AbstractConstructorParameterAnnotationPlugin<Constructor, AbstractConstructorMetaData>
{
protected ConstructorParameterAnnotationPlugin(Set<Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters)
{
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/FactoryMethodAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/FactoryMethodAnnotationPlugin.java 2008-04-30 22:46:28 UTC (rev 72904)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/FactoryMethodAnnotationPlugin.java 2008-04-30 23:59:20 UTC (rev 72905)
@@ -40,7 +40,7 @@
*
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
-public class FactoryMethodAnnotationPlugin extends AbstractParameterAnnotationPlugin<MethodInfo, FactoryMethod, AbstractConstructorMetaData>
+public class FactoryMethodAnnotationPlugin extends AbstractMethodParameterAnnotationPlugin<FactoryMethod, AbstractConstructorMetaData>
{
public FactoryMethodAnnotationPlugin(Set<Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters)
{
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/InstallationParameterAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/InstallationParameterAnnotationPlugin.java 2008-04-30 22:46:28 UTC (rev 72904)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/InstallationParameterAnnotationPlugin.java 2008-04-30 23:59:20 UTC (rev 72905)
@@ -43,7 +43,7 @@
* @param <C> annotation type
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
-public abstract class InstallationParameterAnnotationPlugin<C extends Annotation> extends AbstractParameterAnnotationPlugin<MethodInfo, C, AbstractInstallMetaData>
+public abstract class InstallationParameterAnnotationPlugin<C extends Annotation> extends AbstractMethodParameterAnnotationPlugin<C, AbstractInstallMetaData>
{
protected InstallationParameterAnnotationPlugin(Class<C> annotation, Set<Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters)
{
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/LifecycleParameterAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/LifecycleParameterAnnotationPlugin.java 2008-04-30 22:46:28 UTC (rev 72904)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/LifecycleParameterAnnotationPlugin.java 2008-04-30 23:59:20 UTC (rev 72905)
@@ -40,7 +40,7 @@
* @param <C> annotation type
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
-public abstract class LifecycleParameterAnnotationPlugin<C extends Annotation> extends AbstractParameterAnnotationPlugin<MethodInfo, C, AbstractLifecycleMetaData>
+public abstract class LifecycleParameterAnnotationPlugin<C extends Annotation> extends AbstractMethodParameterAnnotationPlugin<C, AbstractLifecycleMetaData>
{
protected LifecycleParameterAnnotationPlugin(Class<C> annotation, Set<Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters)
{
More information about the jboss-cvs-commits
mailing list