[jboss-cvs] jboss-seam/src/main/org/jboss/seam ...
Shane Bryzak
sbryzak at redhat.com
Thu Jun 7 07:34:11 EDT 2007
User: sbryzak2
Date: 07/06/07 07:34:11
Modified: src/main/org/jboss/seam Component.java
Log:
web service interceptor
Revision Changes Path
1.250 +28 -0 jboss-seam/src/main/org/jboss/seam/Component.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Component.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/Component.java,v
retrieving revision 1.249
retrieving revision 1.250
diff -u -b -r1.249 -r1.250
--- Component.java 3 Jun 2007 00:51:56 -0000 1.249
+++ Component.java 7 Jun 2007 11:34:11 -0000 1.250
@@ -112,6 +112,7 @@
import org.jboss.seam.interceptors.SynchronizationInterceptor;
import org.jboss.seam.interceptors.TransactionInterceptor;
import org.jboss.seam.interceptors.ValidationInterceptor;
+import org.jboss.seam.interceptors.WebServiceInterceptor;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import org.jboss.seam.util.Conversions;
@@ -902,6 +903,10 @@
{
addInterceptor( new Interceptor( new SecurityInterceptor(), this ) );
}
+ if ( beanClassHasAnnotation("javax.jws.WebService"))
+ {
+ addInterceptor( new Interceptor( new WebServiceInterceptor(), this ) );
+ }
}
private static boolean hasAnnotation(Class clazz, Class annotationType)
@@ -923,11 +928,34 @@
}
}
+ private static boolean hasAnnotation(Class clazz, String annotationName)
+ {
+ for (Annotation a : clazz.getAnnotations())
+ {
+ if (a.annotationType().getName().equals(annotationName)) return true;
+ }
+
+ for ( Method method : clazz.getMethods() )
+ {
+ for ( Annotation a : method.getAnnotations() )
+ {
+ if (a.annotationType().getName().equals(annotationName)) return true;
+ }
+ }
+
+ return false;
+ }
+
public boolean beanClassHasAnnotation(Class annotationType)
{
return hasAnnotation( getBeanClass(), annotationType );
}
+ public boolean beanClassHasAnnotation(String annotationName)
+ {
+ return hasAnnotation( getBeanClass(), annotationName );
+ }
+
public boolean businessInterfaceHasAnnotation(Class annotationType)
{
for (Class businessInterface: getBusinessInterfaces() )
More information about the jboss-cvs-commits
mailing list