openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r726297 - /incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java
Date Sat, 13 Dec 2008 23:23:46 GMT
Author: gerdogdu
Date: Sat Dec 13 15:23:46 2008
New Revision: 726297

URL: http://svn.apache.org/viewvc?rev=726297&view=rev
Log:
Annotation generator proxy is added.

Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java?rev=726297&r1=726296&r2=726297&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java
Sat Dec 13 15:23:46 2008
@@ -17,8 +17,10 @@
 package org.apache.webbeans.proxy;
 
 import java.io.Serializable;
+import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 
+import org.apache.webbeans.annotation.WebBeansAnnotation;
 import org.apache.webbeans.component.AbstractComponent;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.intercept.InterceptorHandler;
@@ -63,5 +65,26 @@
 		
 		return result;
 	}
+	
+	public static WebBeansAnnotation createNewAnnotationProxy(Class<? extends Annotation>
annotationType)
+	{	
+		WebBeansAnnotation result = null;
+		
+		try
+		{
+			ProxyFactory pf = new ProxyFactory();
+			pf.setInterfaces(new Class<?>[]{annotationType,Annotation.class});
+			pf.setSuperclass(WebBeansAnnotation.class);
+			pf.setHandler(new WebBeansAnnotation(annotationType));
+			
+			result = (WebBeansAnnotation)pf.create(new Class[]{Class.class}, new Object[]{annotationType});
+			
+		}catch(Exception e)
+		{
+			throw new WebBeansException(e);
+		}
+		
+		return result;
+	}
 
 }



Mime
View raw message