01: /*
02: * This file is part of the WfMOpen project.
03: * Copyright (C) 2001-2006 Danet GmbH (www.danet.de), BU BTS.
04: * All rights reserved.
05: *
06: * This program is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU General Public License as published by
08: * the Free Software Foundation; either version 2 of the License, or
09: * (at your option) any later version.
10: *
11: * This program 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
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: *
20: * $Id: ConnectionSupport.java,v 1.1 2007/05/17 21:52:59 mlipp Exp $
21: *
22: * $Log: ConnectionSupport.java,v $
23: * Revision 1.1 2007/05/17 21:52:59 mlipp
24: * Refactored resource adaptors.
25: *
26: */
27: package de.danet.an.util.ra;
28:
29: import javax.resource.ResourceException;
30:
31: /**
32: * This class provides a base for implementing resource adapter connections.
33: *
34: * @author mnl
35: *
36: */
37: public class ConnectionSupport {
38:
39: private ManagedConnectionSupport mc = null;
40:
41: /**
42: * Create a new instance with attributes set to the given values.
43: * @param mc
44: */
45: public ConnectionSupport() {
46: }
47:
48: /**
49: * Associates a new managed connection with this connection.
50: * @param mc the managed connection.
51: */
52: public void setManagedConnection(ManagedConnectionSupport mc) {
53: this .mc = mc;
54: }
55:
56: /**
57: * Make the managed connection available to the derived class.
58: * @return the managed connection
59: */
60: protected ManagedConnectionSupport getManagedConnection() {
61: return mc;
62: }
63:
64: /* (non-Javadoc)
65: * @see javax.resource.cci.Connection#close()
66: */
67: public void close() throws ResourceException {
68: if (mc != null) {
69: mc.close(this);
70: }
71: }
72:
73: }
|