001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: ItfCallbackLoggerAccess.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger;
025:
026: import java.util.List;
027:
028: import org.ow2.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType;
029:
030: /**
031: * Accesses the entity that registers the callback events.
032: * @author Gisele Pinheiro Souza
033: * @author Eduardo Studzinski Estima de Castro
034: */
035: public interface ItfCallbackLoggerAccess {
036:
037: /**
038: * Sleep time.
039: */
040: int SLEEP = 500;
041:
042: /**
043: * Creates an instance of CallbackLogger with the parameters and the current
044: * time.
045: * @param className the class for which the callback event was called.
046: * @param callbackEvent the callback event name.
047: * @param callbackClassName the name of the class that contains the callback
048: * method.
049: */
050: void insertCallbackLogger(final String className,
051: final CallbackType callbackEvent,
052: final String callbackClassName);
053:
054: /**
055: * Deletes a callback event from the database.
056: * @param id the callback identifier.
057: */
058: void deleteCallbackEvent(int id);
059:
060: /**
061: * Finds all callback events for a class.
062: * @param className the class for each the callback was called.
063: * @return the list of results.
064: */
065: List findCallbackEvent(String className);
066:
067: /**
068: * Finds a callback event for a class.
069: * @param className the class for each the callback was called.
070: * @param callbackEvent the callback method that was called.
071: * @return the list of results.
072: */
073: List findCallbackEvent(String className, CallbackType callbackEvent);
074:
075: /**
076: * Finds a callback event that was called for the class in the className
077: * parameter and is defined in the class callbackClassName.
078: * @param className the class for each the callback was called.
079: * @param callbackEvent the callback method that was called.
080: * @param callbackClassName the class taht the callback method is defined.
081: * @return the list of results.
082: */
083: List findCallbackEventByCallbackMethod(String className,
084: CallbackType callbackEvent, String callbackClassName);
085:
086: /**
087: * Finds all callback events.
088: * @return events
089: */
090: List findAll();
091:
092: /**
093: * Deletes all callback events from the database.
094: */
095: void deleteAll();
096:
097: /**
098: * Verifies if the callback interceptor methods for a life cycle callback
099: * event are executed in the correct order.
100: * @param className the class where the interceptor must executes.
101: * @param callbackEvent the lifecycle callback interceptor method type.
102: * @param callbackClassNames the list of interceptors that must be called
103: * organized in the correct order.
104: */
105: void verifyCallbackOrder(String className,
106: CallbackType callbackEvent, String[] callbackClassNames);
107:
108: /**
109: * Verifies if the callback interceptor methods for a life cycle callback
110: * event are executed in the correct order.
111: * @param className the class where the interceptor must executes.
112: * @param callbackEvent the lifecycle callback interceptor method type.
113: * @param callbackClassNames the list of interceptors that must be called
114: * organized in the correct order.
115: */
116: void verifyCallbackOrder(Class className,
117: CallbackType callbackEvent, String[] callbackClassNames);
118:
119: }
|