01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@ow2.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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: JRemove.java 1970 2007-10-16 11:49:25Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.ow2.easybeans.deployment.annotations.impl;
25:
26: import java.lang.annotation.Annotation;
27:
28: import javax.ejb.Remove;
29:
30: /**
31: * Acts as an implementation of @{@link javax.ejb.Remove} annotation.
32: * @author Florent Benoit
33: */
34: public class JRemove implements Remove {
35:
36: /**
37: * Don't remove object if there is an application exception.
38: */
39: private boolean retainIfException = false;
40:
41: /**
42: * Build an object which represents@{@link javax.ejb.Remove}.<br>
43: * Default value for retainIfException is false.
44: */
45: public JRemove() {
46: this (false);
47: }
48:
49: /**
50: * Build an object which represents@{@link javax.ejb.Remove} with a
51: * given boolean.
52: * @param retainIfException true/false (false is a default value)
53: */
54: public JRemove(final boolean retainIfException) {
55: this .retainIfException = retainIfException;
56: }
57:
58: /**
59: * @return the retainIfException value (true/false).
60: */
61: public boolean retainIfException() {
62: return retainIfException;
63: }
64:
65: /**
66: * @return annotation type.
67: */
68: public Class<? extends Annotation> annotationType() {
69: return Remove.class;
70: }
71:
72: /**
73: * @return string representation.
74: */
75: @Override
76: public String toString() {
77: StringBuilder sb = new StringBuilder();
78: // classname
79: sb.append(this .getClass().getName().substring(
80: this .getClass().getPackage().getName().length() + 1));
81: // retainIfException
82: sb.append("[retainIfException=");
83: sb.append(retainIfException);
84:
85: sb.append("]");
86: return sb.toString();
87: }
88: }
|