View Javadoc

1   /*
2    * EL4J, the Extension Library for the J2EE, adds incremental enhancements to
3    * the spring framework, http://el4j.sf.net
4    * Copyright (C) 2010 by ELCA Informatique SA, Av. de la Harpe 22-24,
5    * 1000 Lausanne, Switzerland, http://www.elca.ch
6    *
7    * EL4J is published under the GNU Lesser General Public License (LGPL)
8    * Version 2.1. See http://www.gnu.org/licenses/
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   * GNU Lesser General Public License for more details.
14   *
15   * For alternative licensing, please contact info@elca.ch
16   */
17  package ch.elca.el4j.tests.aspects.services;
18  
19  import org.slf4j.Logger;
20  import org.slf4j.LoggerFactory;
21  import org.springframework.transaction.annotation.Propagation;
22  import org.springframework.transaction.annotation.Transactional;
23  
24  import ch.elca.el4j.tests.aspects.interceptor.Logged;
25  
26  /**
27   * Test service implementation with static counter.
28   *
29   * @svnLink $Revision: 4253 $;$Date: 2010-12-21 11:08:04 +0100 (Di, 21. Dez 2010) $;$Author: swismer $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/tests/aspects/src/main/java/ch/elca/el4j/tests/aspects/services/Service.java $
30   *
31   * @author Martin Zeltner (MZE)
32   * @author Reynald Borer (RBR)
33   */
34  public class Service {
35  	/**
36  	 * Private logger.
37  	 */
38  	private static final Logger s_logger = LoggerFactory.getLogger(Service.class);
39  
40  	/**
41  	 * Is the intercepted method.
42  	 */
43  	@Logged
44  	@Transactional(propagation = Propagation.REQUIRED)
45  	public void oneMethod() {
46  		s_logger.info("I expect to run this method once.");
47  	}
48  }