KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > deployment > annotations > helper > bean > SessionBeanHelper


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * 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: SessionBeanHelper.java 843 2006-07-12 09:05:58Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.deployment.annotations.helper.bean;
27
28 import org.objectweb.easybeans.deployment.annotations.exceptions.ResolverException;
29 import org.objectweb.easybeans.deployment.annotations.helper.bean.session.SessionBeanInterface;
30 import org.objectweb.easybeans.deployment.annotations.helper.bean.session.SessionBusinessInterfaceFinder;
31 import org.objectweb.easybeans.deployment.annotations.helper.bean.session.checks.SessionBeanValidator;
32 import org.objectweb.easybeans.deployment.annotations.metadata.ClassAnnotationMetadata;
33
34 /**
35  * Helper class which manages only Session bean class.
36  * @author Florent Benoit
37  */

38 public final class SessionBeanHelper {
39
40     /**
41      * Validation.
42      */

43     private static boolean validating = true;
44
45     /**
46      * Helper class, no public constructor.
47      */

48     private SessionBeanHelper() {
49     }
50
51     /**
52      * Apply all helper.
53      * @param sessionBean Session bean to analyze
54      * @throws ResolverException if there is a failure in a resolver
55      */

56     public static void resolve(final ClassAnnotationMetadata sessionBean) throws ResolverException {
57         // call helpers
58

59         // Search session bean that implements javax.ejb.SessionBean and add metadata on it
60
SessionBeanInterface.resolve(sessionBean);
61
62         // Find annotated interfaces
63
SessionBusinessInterfaceFinder.resolve(sessionBean);
64
65         if (validating) {
66             SessionBeanValidator.validate(sessionBean);
67         }
68     }
69 }
70
Popular Tags