01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: ResolverHelper.java 854 2006-07-12 12:57:45Z benoitf $
23: * --------------------------------------------------------------------------
24: */package com.bm.ejb3metadata.annotations.helper;
25:
26: import com.bm.ejb3metadata.annotations.exceptions.ResolverException;
27: import com.bm.ejb3metadata.annotations.helper.bean.BusinessMethodResolver;
28: import com.bm.ejb3metadata.annotations.helper.bean.InheritanceInterfacesHelper;
29: import com.bm.ejb3metadata.annotations.helper.bean.InheritanceMethodResolver;
30: import com.bm.ejb3metadata.annotations.helper.bean.InterfaceAnnotatedHelper;
31: import com.bm.ejb3metadata.annotations.helper.bean.SessionBeanHelper;
32: import com.bm.ejb3metadata.annotations.helper.bean.mdb.MDBListenerBusinessMethodResolver;
33: import com.bm.ejb3metadata.annotations.metadata.ClassAnnotationMetadata;
34: import com.bm.ejb3metadata.annotations.metadata.EjbJarAnnotationMetadata;
35:
36: /**
37: * This class handle some steps that need to be done after the meta-data
38: * generation.
39: *
40: * @author Florent Benoit
41: */
42: public final class ResolverHelper {
43:
44: /**
45: * Helper class, no public constructor.
46: */
47: private ResolverHelper() {
48:
49: }
50:
51: /**
52: * The helper will analyze datas of a given EjbJarAnnotationMetadata object.
53: *
54: * @param ejbJarAnnotationMetadata
55: * object to analyze
56: * @throws ResolverException
57: * if one of resolver fails
58: */
59: public static void resolve(
60: final EjbJarAnnotationMetadata ejbJarAnnotationMetadata)
61: throws ResolverException {
62:
63: // Found each bean class
64: for (ClassAnnotationMetadata classMetaData : ejbJarAnnotationMetadata
65: .getClassAnnotationMetadataCollection()) {
66:
67: if (classMetaData.isBean()) {
68: // Inheritance on interfaces
69: InheritanceInterfacesHelper.resolve(classMetaData);
70: InterfaceAnnotatedHelper.resolve(classMetaData);
71: InheritanceMethodResolver.resolve(classMetaData);
72: // Find business method
73: if (classMetaData.isSession()) {
74: BusinessMethodResolver.resolve(classMetaData);
75: } else if (classMetaData.isMdb()) {
76: MDBListenerBusinessMethodResolver
77: .resolve(classMetaData);
78: }
79:
80: // Transaction
81: // TransactionResolver.resolve(classMetaData);
82:
83: // Interceptors
84: // InterceptorsClassResolver.resolve(classMetaData);
85:
86: }
87:
88: // for each bean, call sub helper
89: if (classMetaData.isSession()) {
90: SessionBeanHelper.resolve(classMetaData);
91: }
92: }
93: }
94: }
|