01: /**
02: * EasyBeans
03: * Copyright (C) 2007 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: ENCBinding.java 2054 2007-11-20 14:43:55Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.ow2.easybeans.deployment.enc;
25:
26: import org.ow2.easybeans.deployment.api.IBinding;
27:
28: /**
29: * JNDI Binding used in ENC for a given type (like persistence context, ejb,
30: * etc.).
31: * @param <T> the given type
32: * @author Florent BENOIT
33: */
34: public class ENCBinding<T> implements IBinding<T> {
35:
36: /**
37: * Name of the binding.
38: */
39: private String name = null;
40:
41: /**
42: * Value of the binding.
43: */
44: private T value = null;
45:
46: /**
47: * Build the given ENC binding.
48: * @param name the given name.
49: * @param value the given value.
50: */
51: public ENCBinding(final String name, final T value) {
52: this .name = name;
53: this .value = value;
54: }
55:
56: /**
57: * @return the name used for the ENC.
58: */
59: public String getName() {
60: return name;
61: }
62:
63: /**
64: * @return the object associated to the ENC name.
65: */
66: public T getValue() {
67: return value;
68: }
69: }
|