summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionFactoryImpl.java
diff options
context:
space:
mode:
authorSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
committerSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
commit33613a85afc4b1481367fbe92a17ee59c240250b (patch)
tree670b842326116b376b505ec2263878912fca97e2 /Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionFactoryImpl.java
downloadStudium-master.tar.gz
Studium-master.tar.bz2
add new repoHEADmaster
Diffstat (limited to 'Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionFactoryImpl.java')
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionFactoryImpl.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionFactoryImpl.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionFactoryImpl.java
new file mode 100644
index 0000000..02e4aaf
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionFactoryImpl.java
@@ -0,0 +1,69 @@
+package examples.integration.out_loan_ra;
+
+import java.io.*;
+
+import javax.resource.Referenceable;
+import javax.resource.*;
+import javax.resource.spi.*;
+import javax.naming.Reference;
+import javax.resource.cci.*;
+
+public class ConnectionFactoryImpl implements ConnectionFactory, Serializable, Referenceable {
+
+ private ManagedConnectionFactory manConnFactory;
+ private ConnectionManager connManager;
+ private Reference ref;
+
+ public ConnectionFactoryImpl(ManagedConnectionFactory manConnFactory, ConnectionManager connManager) {
+
+ System.out.println("ConnectionFactoryImpl(ManagedConnectionFactory manConnFactory, ConnectionManager connManager) called");
+
+ this.manConnFactory = manConnFactory;
+
+ this.connManager = connManager;
+ }
+
+ public javax.resource.cci.Connection getConnection() throws ResourceException {
+
+ System.out.println("ConnectionFactoryImpl.getConnection() called");
+
+ javax.resource.cci.Connection conn = null;
+
+ conn = (javax.resource.cci.Connection) connManager.allocateConnection(manConnFactory, null);
+
+ return conn;
+ }
+
+ public javax.resource.cci.Connection getConnection(ConnectionSpec cSpec) throws ResourceException {
+
+ System.out.println("ConnectionFactoryImpl.getConnection(ConnectionSpec cSpec) called");
+
+ javax.resource.cci.Connection conn = null;
+
+ ConnectionRequestInfo connRequestInfo = new ConnectionRequestInfoImpl();
+
+ conn = (javax.resource.cci.Connection) connManager.allocateConnection(manConnFactory, connRequestInfo);
+
+ return conn;
+ }
+
+ public ResourceAdapterMetaData getMetaData() throws ResourceException {
+
+ return new ResourceAdapterMetaDataImpl();
+ }
+
+ public RecordFactory getRecordFactory() throws ResourceException {
+
+ return new RecordFactoryImpl();
+ }
+
+ public void setReference(Reference ref) {
+
+ this.ref = ref;
+ }
+
+ public Reference getReference() {
+
+ return ref;
+ }
+} \ No newline at end of file