KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > stateless > containermanaged > callbacklogger > BaseInsertOperation


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: BaseInsertOperation.java 731 2006-06-23 09:12:59Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger;
26
27 import javax.ejb.EJB JavaDoc;
28
29 import org.objectweb.easybeans.log.JLog;
30 import org.objectweb.easybeans.log.JLogFactory;
31 import org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType;
32 import org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.OperationType;
33
34 /**
35  * @author Eduardo Studzinski Estima de Castro
36  * @author Gisele Pinheiro Souza
37  */

38 public class BaseInsertOperation {
39
40     /**
41      * Log helper.
42      */

43     private JLog logger = JLogFactory.getLog(BaseInsertOperation.class);
44
45     /**
46      * Bean logger.
47      */

48     @EJB JavaDoc(beanName = "SLSBOperationLoggerAccess")
49     private ItfOperationLoggerAccess beanLogger;
50
51     /**
52      * Log action.
53      * @param className the bean class.
54      * @param event the event type.
55      * @param eventClassName the class where the event method is defined.
56      * @param operationType the operationType.
57      */

58     public void log(final Class JavaDoc className, final CallbackType event, final Class JavaDoc eventClassName,
59             final OperationType operationType) {
60         log(className.getName(), event, eventClassName.getName(), operationType);
61     }
62
63     /**
64      * Log action.
65      * @param className the bean class.
66      * @param event the event type.
67      * @param eventClassName the class where the event method is defined.
68      * @param operationType the operationType.
69      */

70     public void log(final String JavaDoc className, final CallbackType event, final String JavaDoc eventClassName,
71             final OperationType operationType) {
72         logger.debug("Logging event in: {0}", className);
73         beanLogger.insertOperationLogger(className, event, eventClassName, operationType);
74     }
75
76     /**
77      * Log action.
78      * @param className the bean class.
79      * @param event the event type.
80      * @param eventClassName the class where the event method is defined.
81      * @param operationType the operationType.
82      * @param description the operation description.
83      */

84     public void log(final String JavaDoc className, final CallbackType event, final String JavaDoc eventClassName,
85             final OperationType operationType, final String JavaDoc description) {
86         logger.debug("Logging event in: {0}", className);
87         beanLogger.insertOperationLogger(className, event, eventClassName, operationType, description);
88     }
89 }
90
Popular Tags