01: /*
02: * Created on December 10, 2003
03: *
04: * InteractionImpl.java is used to test the J2EE Connector
05: * as implemented by JOnAS. This class implements the Interaction
06: * (cci) classes.
07: *
08: */
09: package ersatz.resourceadapter;
10:
11: import javax.resource.ResourceException;
12: import javax.resource.NotSupportedException;
13: import javax.resource.cci.Interaction;
14: import javax.resource.cci.InteractionSpec;
15: import javax.resource.cci.Connection;
16: import javax.resource.cci.Record;
17: import javax.resource.cci.ResourceWarning;
18:
19: /**
20: * @author Bob Kruse
21: *
22: * Jtest Resource Adapter
23: *
24: * used to test the J2EE Connector as implemented by JOnAS.
25: *
26: */
27: public class InteractionImpl implements Interaction {
28:
29: private Record output;
30: private boolean closed = false;
31: private ConnectionImpl con;
32: private ManagedConnectionImpl mcon;
33: String cName = "InteractionImpl";
34:
35: public InteractionImpl(ConnectionImpl c) {
36: Utility.log(cName + ".constructor");
37: con = c;
38: }
39:
40: public InteractionImpl(ConnectionImpl c, ManagedConnectionImpl mc) {
41: Utility.log(cName + ".constructor");
42: con = c;
43: mcon = mc;
44: }
45:
46: /*
47: If an Interaction implementation does not support a variant of the execute
48: method, the method must throw a javax.resource.NotSupportedException.
49: */
50: public boolean execute(InteractionSpec ispec, Record input,
51: Record output) throws ResourceException {
52: NotSupportedException nse = new NotSupportedException(
53: "InteractionImpl.execute is not currently supported");
54: Utility.log(cName + ".execute " + nse.toString());
55: throw nse;
56: }
57:
58: public Record execute(InteractionSpec ispec, Record input)
59: throws ResourceException {
60: NotSupportedException nse = new NotSupportedException(
61: "InteractionImpl.execute is not currently supported");
62: Utility.log(cName + ".execute " + nse.toString());
63: throw nse;
64: }
65:
66: public void close() throws ResourceException {
67: Utility.log(cName + ".close");
68: closed = true;
69: }
70:
71: public Connection getConnection() {
72: Utility.log(cName + ".getConnection");
73: return con;
74: }
75:
76: public ResourceWarning getWarnings() throws ResourceException {
77: Utility.log(cName + ".getWarnings");
78: NotSupportedException nse = new NotSupportedException(
79: "InteractionImpl.getWarnings is not currently supported");
80: throw nse;
81: }
82:
83: public void clearWarnings() throws ResourceException {
84: Utility.log(cName + ".clearWarnings");
85: NotSupportedException nse = new NotSupportedException(
86: "InteractionImpl.clearWarnings is not currently supported");
87: throw nse;
88: }
89:
90: }
|