|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| AllLifeCallback00.java | - | 0% | 0% | 0% |
|
||||||||||||||
| 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: AllLifeCallback00.java 602 2006-06-08 08:40:57Z studzine $ | |
| 23 | * -------------------------------------------------------------------------- | |
| 24 | */ | |
| 25 | package org.objectweb.easybeans.tests.common.interceptors.lifecycle.misc; | |
| 26 | ||
| 27 | import javax.annotation.PostConstruct; | |
| 28 | import javax.annotation.PreDestroy; | |
| 29 | import javax.ejb.PostActivate; | |
| 30 | import javax.ejb.PrePassivate; | |
| 31 | import javax.interceptor.InvocationContext; | |
| 32 | ||
| 33 | import org.objectweb.easybeans.log.JLog; | |
| 34 | import org.objectweb.easybeans.log.JLogFactory; | |
| 35 | ||
| 36 | /** | |
| 37 | * This interceptor contains methods to the four lifecycle callbacks. | |
| 38 | * @author Eduardo Studzinski Estima de Castro | |
| 39 | * @author Gisele Pinheiro Souza | |
| 40 | */ | |
| 41 | public class AllLifeCallback00 { | |
| 42 | ||
| 43 | /** | |
| 44 | * Logger. | |
| 45 | */ | |
| 46 | private JLog logger = JLogFactory.getLog(AllLifeCallback00.class); | |
| 47 | ||
| 48 | /** | |
| 49 | * Simple lifecyle callback interceptor method to PostConstruct. | |
| 50 | * @param ic contains attributes of invocation | |
| 51 | */ | |
| 52 | 0 | @PostConstruct |
| 53 | public void postConstruct(final InvocationContext ic){ | |
| 54 | 0 | logger.debug("PostConstruct method."); |
| 55 | 0 | try { |
| 56 | 0 | ic.proceed(); |
| 57 | } catch (Exception e) { | |
| 58 | 0 | return; |
| 59 | } | |
| 60 | } | |
| 61 | ||
| 62 | /** | |
| 63 | * Simple lifecyle callback interceptor method to PreDestroy. | |
| 64 | * @param ic contains attributes of invocation | |
| 65 | */ | |
| 66 | 0 | @PreDestroy |
| 67 | public void preDestroy(final InvocationContext ic){ | |
| 68 | 0 | logger.debug("PreDestroy method."); |
| 69 | 0 | try { |
| 70 | 0 | ic.proceed(); |
| 71 | } catch (Exception e) { | |
| 72 | 0 | e.printStackTrace(); |
| 73 | } | |
| 74 | } | |
| 75 | ||
| 76 | /** | |
| 77 | * Simple lifecyle callback interceptor method to PostActivate. | |
| 78 | * @param ic contains attributes of invocation | |
| 79 | */ | |
| 80 | 0 | @PostActivate |
| 81 | public void postActivate(final InvocationContext ic){ | |
| 82 | 0 | logger.debug("PostActivate method."); |
| 83 | 0 | try { |
| 84 | 0 | ic.proceed(); |
| 85 | } catch (Exception e) { | |
| 86 | 0 | e.printStackTrace(); |
| 87 | } | |
| 88 | } | |
| 89 | ||
| 90 | /** | |
| 91 | * Simple lifecyle callback interceptor method to PrePassivate. | |
| 92 | * @param ic contains attributes of invocation | |
| 93 | */ | |
| 94 | 0 | @PrePassivate |
| 95 | public void prePassivate(final InvocationContext ic){ | |
| 96 | 0 | logger.debug("PrePassivate method."); |
| 97 | 0 | try { |
| 98 | 0 | ic.proceed(); |
| 99 | } catch (Exception e) { | |
| 100 | 0 | e.printStackTrace(); |
| 101 | } | |
| 102 | } | |
| 103 | ||
| 104 | } |
|
||||||||||