summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra
diff options
context:
space:
mode:
Diffstat (limited to 'Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra')
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionFactoryImpl.java69
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionImpl.java54
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionMetaDataImpl.java31
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionRequestInfoImpl.java27
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionSpecImpl.java9
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/InteractionImpl.java96
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/META-INF/ra.xml28
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ManagedConnectionFactoryImpl.java100
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ManagedConnectionImpl.java135
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ManagedConnectionMetaDataImpl.java35
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/MappedRecordImpl.java121
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/RecordFactoryImpl.java20
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ResourceAdapterMetaDataImpl.java124
13 files changed, 849 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
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionImpl.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionImpl.java
new file mode 100644
index 0000000..5cd6b72
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionImpl.java
@@ -0,0 +1,54 @@
+package examples.integration.out_loan_ra;
+
+import java.util.*;
+
+import javax.resource.cci.*;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionEvent;
+import javax.resource.spi.IllegalStateException;
+import javax.resource.spi.*;
+import javax.resource.NotSupportedException;
+
+public class ConnectionImpl implements javax.resource.cci.Connection {
+
+ private ManagedConnectionImpl manConn;
+
+ ConnectionImpl(ManagedConnectionImpl manConn) {
+
+ System.out.println("ConnectionImpl(ManagedConnectionImpl) called");
+
+ this.manConn = manConn;
+ }
+
+ public Interaction createInteraction() throws ResourceException {
+
+ return new InteractionImpl(this);
+ }
+
+ public javax.resource.cci.LocalTransaction getLocalTransaction() throws ResourceException {
+
+ throw new NotSupportedException("Local transactions are not supported.");
+ }
+
+ public ResultSetInfo getResultSetInfo() throws ResourceException {
+
+ throw new NotSupportedException("ResultSet records are not supported.");
+ }
+
+ public void close() throws ResourceException {
+
+ System.out.println("ConnectionImpl.close() called");
+
+ if (manConn == null)
+ return;
+
+ manConn.sendEvent(ConnectionEvent.CONNECTION_CLOSED, null, this);
+
+ manConn = null;
+ }
+
+ public ConnectionMetaData getMetaData() throws ResourceException {
+
+ return new ConnectionMetaDataImpl(manConn);
+ }
+} \ No newline at end of file
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionMetaDataImpl.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionMetaDataImpl.java
new file mode 100644
index 0000000..e51860b
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionMetaDataImpl.java
@@ -0,0 +1,31 @@
+package examples.integration.out_loan_ra;
+
+import javax.resource.ResourceException;
+import javax.resource.cci.*;
+import javax.resource.spi.*;
+
+public class ConnectionMetaDataImpl implements ConnectionMetaData {
+
+ private ManagedConnectionImpl manConn;
+
+ public ConnectionMetaDataImpl (ManagedConnectionImpl manConn) {
+
+ this.manConn = manConn;
+ }
+
+ public String getEISProductName() throws ResourceException {
+
+ return "Loan Application DLL";
+ }
+
+ public String getEISProductVersion() throws ResourceException {
+
+ return "1.0";
+ }
+
+ public String getUserName() throws ResourceException {
+
+ return null;
+ }
+}
+
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionRequestInfoImpl.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionRequestInfoImpl.java
new file mode 100644
index 0000000..cbfa9d8
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionRequestInfoImpl.java
@@ -0,0 +1,27 @@
+package examples.integration.out_loan_ra;
+
+import javax.resource.spi.ConnectionRequestInfo;
+
+public class ConnectionRequestInfoImpl implements ConnectionRequestInfo {
+
+ public ConnectionRequestInfoImpl() {
+ }
+
+ public boolean equals(Object object) {
+
+ if (object == null) return false;
+
+ if (object instanceof ConnectionRequestInfoImpl) {
+
+ return true;
+ } else {
+
+ return false;
+ }
+ }
+
+ public int hashCode() {
+
+ return (new String("ConnectionRequestInfoImpl")).hashCode();
+ }
+} \ No newline at end of file
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionSpecImpl.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionSpecImpl.java
new file mode 100644
index 0000000..dd426f0
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ConnectionSpecImpl.java
@@ -0,0 +1,9 @@
+package examples.integration.out_loan_ra;
+
+import javax.resource.cci.*;
+
+public class ConnectionSpecImpl implements ConnectionSpec {
+
+ public ConnectionSpecImpl() {
+ }
+} \ No newline at end of file
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/InteractionImpl.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/InteractionImpl.java
new file mode 100644
index 0000000..2f532f9
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/InteractionImpl.java
@@ -0,0 +1,96 @@
+package examples.integration.out_loan_ra;
+
+import examples.jni.JavaLoanApp;
+
+import java.util.*;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionEvent;
+import javax.resource.spi.IllegalStateException;
+import javax.resource.cci.*;
+import java.lang.reflect.*;
+import java.lang.*;
+
+public class InteractionImpl implements Interaction {
+
+ Connection conn = null;
+
+ public InteractionImpl(Connection conn) {
+
+ System.out.println("InteractionImpl(Connection conn) called");
+
+ this.conn = conn;
+ }
+
+ public javax.resource.cci.Connection getConnection() {
+
+ return conn;
+ }
+
+ public void close() throws ResourceException {
+
+ conn = null;
+ }
+
+ public boolean execute (InteractionSpec iSpec, Record in, Record out) throws ResourceException {
+
+ System.out.println ("InteractionImpl.execute(InteractionSpec iSpec, Record in, Record out) called");
+
+ out = exec((MappedRecord)in,(MappedRecord)out);
+
+ if (out != null) {
+
+ return true;
+ } else {
+
+ return false;
+ }
+ }
+
+ public Record execute (InteractionSpec iSpec, Record in) throws ResourceException {
+
+ System.out.println ("InteractionImpl.execute(InteractionSpec iSpec, Record in) called");
+
+ MappedRecord out = new MappedRecordImpl();
+
+ return exec((MappedRecord)in, out);
+ }
+
+ Record exec(MappedRecord in, MappedRecord out) throws ResourceException {
+
+ try {
+
+ System.out.println("InteractionImpl.exec(MappedRecord in, MappedRecord out) called");
+
+ Set keys = in.keySet();
+ Iterator iterator = keys.iterator();
+
+ while (iterator.hasNext()) {
+
+ String key = (String)iterator.next();
+
+ if (key.equalsIgnoreCase("HomeEquityRate")) {
+
+ JavaLoanApp jlaObj = new JavaLoanApp("C:\\LoanApp.dll");
+ float equityRate = jlaObj.getHomeEquityLoanRate();
+ System.out.println ("JNI Call Returned: " + equityRate);
+ out.put(key, new Float(equityRate));
+ }
+ }
+
+ return out;
+ }
+ catch(Exception e) {
+
+ throw new ResourceException(e.getMessage());
+ }
+ }
+
+ public ResourceWarning getWarnings() throws ResourceException {
+
+ return null;
+ }
+
+ public void clearWarnings() throws ResourceException {
+
+ }
+} \ No newline at end of file
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/META-INF/ra.xml b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/META-INF/ra.xml
new file mode 100644
index 0000000..7e08c79
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/META-INF/ra.xml
@@ -0,0 +1,28 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<connector
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ version="1.5"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+ >
+ <display-name>OutboundLoanRa</display-name>
+ <vendor-name>Vendor Name</vendor-name>
+ <eis-type>EIS Type</eis-type>
+ <resourceadapter-version>1.5</resourceadapter-version>
+ <license>
+ <license-required>false</license-required>
+ </license>
+ <resourceadapter>
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>examples.integration.out_loan_ra.ManagedConnectionFactoryImpl</managedconnectionfactory-class>
+ <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
+ <connectionfactory-impl-class>examples.integration.out_loan_ra.ConnectionFactoryImpl</connectionfactory-impl-class>
+ <connection-interface>javax.resource.cci.Connection</connection-interface>
+ <connection-impl-class>examples.integration.out_loan_ra.ConnectionImpl</connection-impl-class>
+ </connection-definition>
+ <transaction-support>LocalTransaction</transaction-support>
+ <reauthentication-support>false</reauthentication-support>
+ </outbound-resourceadapter>
+ </resourceadapter>
+</connector>
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ManagedConnectionFactoryImpl.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ManagedConnectionFactoryImpl.java
new file mode 100644
index 0000000..3d3407e
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ManagedConnectionFactoryImpl.java
@@ -0,0 +1,100 @@
+package examples.integration.out_loan_ra;
+
+import java.io.*;
+import java.util.*;
+
+import javax.resource.*;
+import javax.resource.spi.*;
+import javax.resource.spi.security.PasswordCredential;
+import javax.resource.spi.SecurityException;
+import javax.security.auth.Subject;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+public class ManagedConnectionFactoryImpl implements ManagedConnectionFactory, Serializable {
+
+ private PrintWriter manConnLogWriter;
+
+ public ManagedConnectionFactoryImpl() {
+
+ System.out.println("ManagedConnectionFactoryImpl() called");
+ }
+
+ public Object createConnectionFactory(ConnectionManager connManager) throws ResourceException {
+
+ System.out.println("ManagedConnectionFactoryImpl.createConnectionFactory(ConnectionManager) called");
+
+ return new ConnectionFactoryImpl(this, connManager);
+ }
+
+ public Object createConnectionFactory() throws ResourceException {
+ throw new ResourceException ("How can you call this method in a managed environment?");
+ }
+
+
+ public ManagedConnection createManagedConnection (Subject subject, ConnectionRequestInfo connRequestInfo) {
+
+ System.out.println ("ManagedConnectionFactoryImpl.createManagedConnection (Subject, ConnectionRequestInfo) called");
+
+ return new ManagedConnectionImpl (this);
+ }
+
+
+ public ManagedConnection matchManagedConnections(Set connSet, Subject subject, ConnectionRequestInfo connRequestInfo)
+ throws ResourceException {
+
+ System.out.println("ManagedConnectionFactoryImpl.matchManagedConnections(Set, Subject, ConnectionRequestInfo) called");
+
+ Iterator iterator = connSet.iterator();
+
+ while (iterator.hasNext()) {
+
+ Object object = iterator.next();
+
+ if (object instanceof ManagedConnectionImpl) {
+
+ ManagedConnectionImpl manConn = (ManagedConnectionImpl) object;
+ ManagedConnectionFactory manConnFactory = manConn.getManagedConnectionFactory();
+
+ if (manConnFactory.equals(this)) {
+
+ System.out.println("From ManagedConnectionFactoryImpl.matchManagedConnections() -> Connection matched");
+
+ return manConn;
+ }
+ }
+ }
+
+ System.out.println("From ManagedConnectionFactoryImpl.matchManagedConnections() -> Connection did not match");
+
+ return null;
+ }
+
+ public void setLogWriter(PrintWriter manConnLogWriter) {
+
+ this.manConnLogWriter = manConnLogWriter;
+ }
+
+ public PrintWriter getLogWriter() {
+
+ return manConnLogWriter;
+ }
+
+ public boolean equals(Object object) {
+
+ if (object == null) return false;
+
+ if (object instanceof ManagedConnectionFactoryImpl) {
+
+ return true;
+ } else {
+
+ return false;
+ }
+ }
+
+ public int hashCode() {
+
+ return (new String("ManagedConnectionFactoryImpl")).hashCode();
+ }
+} \ No newline at end of file
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ManagedConnectionImpl.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ManagedConnectionImpl.java
new file mode 100644
index 0000000..2087172
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ManagedConnectionImpl.java
@@ -0,0 +1,135 @@
+package examples.integration.out_loan_ra;
+
+import java.io.*;
+import java.util.*;
+
+import javax.resource.*;
+import javax.resource.spi.*;
+import javax.resource.spi.security.PasswordCredential;
+import javax.resource.spi.IllegalStateException;
+import javax.resource.spi.SecurityException;
+import javax.resource.NotSupportedException;
+import javax.security.auth.Subject;
+import javax.transaction.xa.XAResource;
+
+public class ManagedConnectionImpl implements ManagedConnection {
+
+ private ConnectionEventListener connEventListener;
+ private ManagedConnectionFactory manConnFactory;
+ private boolean isDestroyed;
+ private PrintWriter manConnLogWriter;
+
+ ManagedConnectionImpl (ManagedConnectionFactory manConnFactory) {
+
+ System.out.println("ManagedConnectionImpl(ManagedConnectionFactory) called");
+
+ this.manConnFactory = manConnFactory;
+ }
+
+ public Object getConnection(Subject subject, ConnectionRequestInfo connectionRequestInfo)
+ throws ResourceException {
+
+ System.out.println("ManagedConnectionImpl.getConnection(Subject, ConnectionRequestInfo) called");
+
+ ConnectionImpl conn = new ConnectionImpl(this);
+
+ return conn;
+ }
+
+ public void destroy() throws ResourceException {
+
+ System.out.println("ManagedConnectionImpl.destroy() called");
+
+ isDestroyed=true;
+
+ cleanup();
+ }
+
+ public void cleanup() throws ResourceException {
+
+ System.out.println("ManagedConnectionImpl.cleanup() called");
+ }
+
+ public void associateConnection(Object connection) throws ResourceException {
+
+ throw new NotSupportedException("ManagedConnectionImpl.associateConnection() not supported.");
+ }
+
+ public void addConnectionEventListener(ConnectionEventListener connEventListener) {
+
+ System.out.println("ManagedConnectionImpl.addConnectionEventListener(ConnectionEventListener) called");
+
+ this.connEventListener = connEventListener;
+ }
+
+ public void removeConnectionEventListener (ConnectionEventListener connEventListener) {
+
+ }
+
+ public XAResource getXAResource() throws ResourceException {
+
+ throw new NotSupportedException("Global transactions are not supported");
+ }
+
+ public LocalTransaction getLocalTransaction() throws ResourceException {
+
+ throw new NotSupportedException("Local transactions are not supported");
+ }
+
+ public ManagedConnectionMetaData getMetaData() throws ResourceException {
+
+ if (isDestroyed)
+ throw new ResourceException ("Managed connection has already been closed.");
+
+ return new ManagedConnectionMetaDataImpl (this);
+ }
+
+ public void setLogWriter(PrintWriter manConnLogWriter) {
+
+ this.manConnLogWriter = manConnLogWriter;
+ }
+
+ public PrintWriter getLogWriter() {
+
+ return manConnLogWriter;
+ }
+
+ void sendEvent(int eventType, Exception e, Object connHandle) {
+
+ System.out.println("ManagedConnectionImpl.sendEvent(int, e, connHandle) called");
+
+ ConnectionEvent connEvent = null;
+
+ if (e == null)
+ connEvent = new ConnectionEvent(this, eventType);
+ else
+ connEvent = new ConnectionEvent(this, eventType, e);
+
+ connEvent.setConnectionHandle(connHandle);
+
+ switch (connEvent.getId()) {
+ case ConnectionEvent.CONNECTION_CLOSED:
+ this.connEventListener.connectionClosed(connEvent);
+ break;
+ case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
+ this.connEventListener.localTransactionStarted(connEvent);
+ break;
+ case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
+ this.connEventListener.localTransactionCommitted(connEvent);
+ break;
+ case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
+ this.connEventListener.localTransactionRolledback(connEvent);
+ break;
+ case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
+ this.connEventListener.connectionErrorOccurred(connEvent);
+ break;
+ default:
+ throw new IllegalArgumentException("Unsupported event: " + connEvent.getId());
+ }
+ }
+
+ ManagedConnectionFactory getManagedConnectionFactory() {
+
+ return manConnFactory;
+ }
+} \ No newline at end of file
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ManagedConnectionMetaDataImpl.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ManagedConnectionMetaDataImpl.java
new file mode 100644
index 0000000..cc47162
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ManagedConnectionMetaDataImpl.java
@@ -0,0 +1,35 @@
+package examples.integration.out_loan_ra;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.IllegalStateException;
+import javax.resource.spi.*;
+
+public class ManagedConnectionMetaDataImpl implements ManagedConnectionMetaData {
+
+ private ManagedConnectionImpl manConn;
+
+ public ManagedConnectionMetaDataImpl(ManagedConnectionImpl manConn) {
+
+ this.manConn = manConn;
+ }
+
+ public String getEISProductName() throws ResourceException {
+
+ return "Loan Application DLL";
+ }
+
+ public String getEISProductVersion() throws ResourceException {
+
+ return "1.0";
+ }
+
+ public int getMaxConnections() throws ResourceException {
+
+ return 1;
+ }
+
+ public String getUserName() throws ResourceException {
+
+ return null;
+ }
+} \ No newline at end of file
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/MappedRecordImpl.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/MappedRecordImpl.java
new file mode 100644
index 0000000..7ade217
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/MappedRecordImpl.java
@@ -0,0 +1,121 @@
+package examples.integration.out_loan_ra;
+
+import java.util.*;
+
+public class MappedRecordImpl implements javax.resource.cci.MappedRecord {
+
+ private String recordName;
+ private String recordDescription;
+ private HashMap mappedRecord;
+
+ public MappedRecordImpl() {
+
+ mappedRecord = new HashMap();
+ }
+
+ public MappedRecordImpl (String recordName) {
+
+ mappedRecord = new HashMap();
+ this.recordName = recordName;
+ }
+
+ public String getRecordName() {
+
+ return this.recordName;
+ }
+
+ public void setRecordName(String recordName) {
+
+ this.recordName = recordName;
+ }
+
+ public String getRecordShortDescription() {
+
+ return recordDescription;
+ }
+
+ public void setRecordShortDescription(String recordDescription) {
+
+ this.recordDescription = recordDescription;
+ }
+
+ public boolean equals(Object object) {
+
+ if(!(object instanceof MappedRecordImpl))
+ return false;
+
+ MappedRecordImpl mappedRecordObject = (MappedRecordImpl)object;
+
+ return (recordName == mappedRecordObject.recordName) && mappedRecord.equals(mappedRecordObject.mappedRecord);
+ }
+
+ public int hashCode() {
+
+ return (new String("MappedRecordImpl")).hashCode();
+ }
+
+ public Object clone() throws CloneNotSupportedException {
+
+ return this.clone();
+ }
+
+ public void clear() {
+
+ mappedRecord.clear();
+ }
+
+ public boolean containsKey(Object key) {
+
+ return mappedRecord.containsKey(key);
+ }
+
+ public boolean containsValue(Object value) {
+
+ return mappedRecord.containsValue(value);
+ }
+
+ public Set entrySet() {
+
+ return mappedRecord.entrySet();
+ }
+
+ public Object get(Object object) {
+
+ return mappedRecord.get(object);
+ }
+
+ public boolean isEmpty(){
+
+ return mappedRecord.isEmpty();
+ }
+
+ public Set keySet(){
+
+ return mappedRecord.keySet();
+ }
+
+ public Object put(Object key, Object value) {
+
+ return mappedRecord.put(key, value);
+ }
+
+ public void putAll(Map map) {
+
+ mappedRecord.putAll (map);
+ }
+
+ public Object remove(Object object) {
+
+ return mappedRecord.remove(object);
+ }
+
+ public int size() {
+
+ return mappedRecord.size();
+ }
+
+ public Collection values() {
+
+ return mappedRecord.values();
+ }
+} \ No newline at end of file
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/RecordFactoryImpl.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/RecordFactoryImpl.java
new file mode 100644
index 0000000..d3f051a
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/RecordFactoryImpl.java
@@ -0,0 +1,20 @@
+package examples.integration.out_loan_ra;
+
+import javax.resource.cci.*;
+import java.util.Map;
+import java.util.Collection;
+import javax.resource.ResourceException;
+import javax.resource.NotSupportedException;
+
+public class RecordFactoryImpl implements javax.resource.cci.RecordFactory{
+
+ public MappedRecord createMappedRecord(String recordName) throws ResourceException {
+
+ return new MappedRecordImpl(recordName);
+ }
+
+ public IndexedRecord createIndexedRecord(String recordName) throws ResourceException {
+
+ throw new NotSupportedException("IndexedRecords are not supported.");
+ }
+} \ No newline at end of file
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ResourceAdapterMetaDataImpl.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ResourceAdapterMetaDataImpl.java
new file mode 100644
index 0000000..44c153f
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/out_loan_ra/ResourceAdapterMetaDataImpl.java
@@ -0,0 +1,124 @@
+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 ResourceAdapterMetaDataImpl implements ResourceAdapterMetaData {
+
+ private String adapterName;
+ private String adapterShortDescription;
+ private String adapterVendorName;
+ private String adapterVersion;
+ private String[] interactionSpecsSupported;
+ private String specVersion;
+ private boolean supportsExecuteWithInputAndOutputRecord;
+ private boolean supportsExecuteWithInputRecordOnly;
+ private boolean supportsLocalTransactionDemarcation;
+
+ // Additional properties
+ private boolean supportsGlobalTransactions;
+ private boolean supportsLifecycleManagement;
+ private boolean supportsMessageInflow;
+ private boolean supportsTransactionInflow;
+ private boolean supportsConnectionManagement;
+ private boolean supportsSecurityManagement;
+
+ public ResourceAdapterMetaDataImpl() {
+
+ adapterName = "Loan Application Resource Adapter";
+ adapterShortDescription = "Loan Application Resource Adapter provides connectivity to Loan Application DLL";
+ adapterVendorName = "Connectors Inc.";
+ adapterVersion = "1.0";
+ interactionSpecsSupported[0] = "InteractionImpl";
+ specVersion = "1.5";
+ supportsExecuteWithInputAndOutputRecord = true;
+ supportsExecuteWithInputRecordOnly = true;
+ supportsLocalTransactionDemarcation = false;
+ supportsGlobalTransactions = false;
+ supportsLifecycleManagement = false;
+ supportsMessageInflow = false;
+ supportsTransactionInflow = false;
+ supportsConnectionManagement = true;
+ supportsSecurityManagement = false;
+ }
+
+ public String getAdapterName() {
+
+ return adapterName;
+ }
+
+ public String getAdapterShortDescription() {
+
+ return adapterShortDescription;
+ }
+
+ public String getAdapterVendorName() {
+
+ return adapterVendorName;
+ }
+
+ public String getAdapterVersion() {
+
+ return adapterVersion;
+ }
+
+ public String[] getInteractionSpecsSupported() {
+
+ return interactionSpecsSupported;
+ }
+
+ public String getSpecVersion() {
+
+ return specVersion;
+ }
+
+ public boolean supportsExecuteWithInputAndOutputRecord() {
+
+ return supportsExecuteWithInputAndOutputRecord;
+ }
+
+ public boolean supportsExecuteWithInputRecordOnly() {
+
+ return supportsExecuteWithInputRecordOnly;
+ }
+
+ public boolean supportsLocalTransactionDemarcation() {
+
+ return supportsLocalTransactionDemarcation;
+ }
+
+ public boolean supportsGlobalTransactions() {
+
+ return supportsGlobalTransactions;
+ }
+
+ public boolean supportsLifecycleManagement() {
+
+ return supportsLifecycleManagement;
+ }
+
+ public boolean supportsMessageInflow() {
+
+ return supportsMessageInflow;
+ }
+
+ public boolean supportsTransactionInflow() {
+
+ return supportsTransactionInflow;
+ }
+
+ public boolean supportsConnectionManagement() {
+
+ return supportsConnectionManagement;
+ }
+
+ public boolean supportsSecurityManagement() {
+
+ return supportsSecurityManagement;
+ }
+} \ No newline at end of file