[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-1029) PerNestedConversation not detected on EJB3 beans

Norman Richards (JIRA) jira-events at lists.jboss.org
Sat Mar 24 23:52:50 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBSEAM-1029?page=all ]

Norman Richards closed JBSEAM-1029.
-----------------------------------

    Resolution: Done

Fixed by delegating to Component to test for the annotation.  

> PerNestedConversation not detected on EJB3 beans
> ------------------------------------------------
>
>                 Key: JBSEAM-1029
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1029
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.0.GA
>         Environment: JBoss 4.0.5.GA, Seam 1.2.0.Patch1, myFaces 1.1.4
>            Reporter: Richard Brooks
>         Assigned To: Norman Richards
>             Fix For: 1.2.1.GA
>
>         Attachments: ServerConversationContext.java.patch
>
>
> The PerNestedConversation annotation isn't detected on ejb3 seam beans (or their interfaces).  The call in ServerConversationContext to java.lang.Class.isAnnotationPresent isn't working for my ejb3 stateful session beans as at runtime the class is proxied and only implements the EJB interface
> To get it to work I changed the call to isAnnotationPresent in ServerConversationContext below:
> [code]
>                   boolean found = result!=null && 
>                         ( i==0 || !result.getClass().isAnnotationPresent(PerNestedConversation.class) );
> [/code]
> to a local method that searches through the interfaces and hierachy as well
> [code]
> 	private boolean isAnnotationPresent(Class clazz, Class<? extends Annotation> annotation) {
> 		boolean result = false;
> 		if ((clazz != null) && (annotation != null)) {
> 			result = clazz.isAnnotationPresent(annotation);
> 			if (!result) {
> 				//check the interfaces
> 				Class[] intfs = clazz.getInterfaces();
> 				if (intfs != null) {
> 					for (Class intf : intfs) {
> 						if (isAnnotationPresent(intf, annotation)) {
> 							result = true;
> 							break;
> 						}
> 					}
> 				}
> 				
> 				if (!result) {
> 					//check the super classes
> 					Class superClazz = clazz.getSuperclass();
> 					if (superClazz != null) {
> 						result = isAnnotationPresent(superClazz, annotation);
> 					}
> 				}
> 			}
> 				
> 		}
> 		return result;
> 	}
> [/code]

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list