01: package com.bm.introspectors;
02:
03: import com.bm.ejb3metadata.annotations.metadata.ClassAnnotationMetadata;
04: import com.bm.ejb3metadata.annotations.metadata.MetaDataCache;
05:
06: /**
07: * SessionBeanIntrospector.
08: *
09: * @author Daniel Wiese
10: * @param <T> -
11: * the type of the session bean
12: * @since 08.11.2005
13: */
14: public class SessionBeanIntrospector<T> extends AbstractIntrospector<T> {
15:
16: /**
17: * Constructor.
18: *
19: * @param toInspect -
20: * the sesion bean to inspect
21: */
22: public SessionBeanIntrospector(Class<? extends T> toInspect) {
23: super (toInspect);
24:
25: boolean isSessionBean = accept(toInspect);
26: if (!isSessionBean) {
27: throw new RuntimeException(
28: "The class is not a session/service/mdb bean");
29: }
30:
31: // FIXME: distinguish between field and method based annotations
32: // analyse the fields
33: this .processAccessTypeField(toInspect);
34:
35: }
36:
37: /**
38: * Returns true is this intorspector accept this class.
39: *
40: * @param toCheck -
41: * to check
42: * @return true id the introspector will accept this class
43: */
44: public static boolean accept(Class toCheck) {
45: ClassAnnotationMetadata classMeta = MetaDataCache
46: .getMetaData(toCheck);
47: return classMeta.isBean();
48: }
49:
50: }
|