diff options
Diffstat (limited to 'Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples')
61 files changed, 2057 insertions, 0 deletions
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/Readme.txt b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/Readme.txt new file mode 100644 index 0000000..98c39f3 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/Readme.txt @@ -0,0 +1,61 @@ +J2EE Connector Example
+----------------------
+
+The following are the steps to build, deploy, and run this sample.
+Make sure that the Java EE 5 server is running before deployment.
+
+1) Make sure the following DLLs are in the system classpath
+ (ideally, in c:\winnt\system32):
+ mfc71d.dll
+ msvcr71d.dll
+
+ You can download these DLLs from:
+ http://www.dll-files.com/dllindex/dll-files.shtml?mfc71d
+ http://www.dll-files.com/dllindex/dll-files.shtml?msvcr71d
+
+2) Copy /src/examples/jni/nativelib/LoanApp.dll to your C drive
+ (C:\LoanApp.dll).
+
+3) Make sure that the appropriate security permissions are granted to
+ the resource adapter for linking the dynamic library (LoanApp.dll)
+ by inserting the following line in the java.policy file under
+ <JDK Installation Directory>\jre\lib\security directory.
+
+ permission java.lang.RuntimePermission "loadLibrary.*";
+
+4) Compile and jar the JavaLoanApp.java, which uses JNI calls to
+ invoke functionality of LoanApp.dll library, by typing the following:
+
+ asant jnijar
+
+5) Compile the connector source files and and create the corresponding
+ connector RAR file by using the following target:
+
+ asant rar
+
+6) Deploy the connector, alongwith connector resources such as
+ connector connection pool and the associated JNDI name resource.
+
+ asant deploy_connector
+
+7) Now compile LoanRatesEJB files and create the corresponding ejbjar.
+
+ asant jar
+
+8) Deploy LoanRatesEjb.
+
+ asant deploy_common
+
+9) Compile and jar the LoanRatesEJB client application.
+
+ asant base_clientjar_common.
+
+10) Turn off the firewall, if any, and run the client now.
+
+ asant run_client
+
+11) Undeploy the connector and the EJB, and delete the build classes
+
+ asant undeploy_connector
+ asant undeploy_common
+ asant clean_all
\ No newline at end of file diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/build.xml b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/build.xml new file mode 100644 index 0000000..f42b509 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/build.xml @@ -0,0 +1,47 @@ +<?xml version="1.0"?>
+<!DOCTYPE project [ <!ENTITY include SYSTEM "../../../etc/common.xml"> ]>
+
+<project name="ejb3-examples-integration" default="jar"
+ basedir="../../..">
+
+ <!-- basic settings -->
+ <property name="src.dir" value="${basedir}/src"/>
+ <property name="build.dir" value="${basedir}/build"/>
+ <property name="appname" value="LoanApplication"/>
+ <property name="client.class" value="examples.integration.loanratesejb.LoanRatesClient"/>
+ <property name="app.pkg" value="examples/integration/loanratesejb"/>
+ <property name="package" value="${app.pkg}"/>
+ <property name="pack.dir" value="${src.dir}/${app.pkg}"/>
+ <property name="jar.pkg" value="examples/integration/loanratesejb"/>
+
+ <!-- Connector specific properties -->
+
+ <property name="jnijarname" value="JavaLoanApp"/>
+ <property name="jniapp.pkg" value="examples/jni"/>
+ <property name="jni.pack.dir" value="${src.dir}/examples/jni"/>
+
+ <property name="raname" value="OutboundLoanRa"/>
+ <property name="rar.pkg" value="examples/integration/out_loan_ra"/>
+ <property name="connector.pack.dir" value="${src.dir}/examples/integration/out_loan_ra"/>
+ <property name="connector.connection.pool.name" value="OutboundLoanRaPool"/>
+ <property name="connector.connection.pool.jndiname" value="OutboundLoanJNDIName"/>
+ <property name="connector.connectiondefinition" value="javax.resource.cci.ConnectionFactory"/>
+
+
+ <!-- Include common.xml -->
+ &include;
+
+ <property name="assemble.dir" value="${assemble.ejbjar}"/>
+ <property name="deploy.file" value="${ejbjar}"/>
+
+ <target name="jar" depends="compile_common, create_ejbjar_common"/>
+ <target name="ear" depends="jar,create_ear_common"/>
+
+ <target name="clean_all" depends="clean_common, clean_ejbjar_common, clean_clientjar_common, clean_jnijar_common, clean_rar_common"/>
+
+ <!-- Targets pertaining to Connector -->
+ <target name="jnijar" depends="compile_jni_common,create_jnijar_common"/>
+ <target name="rar" depends="compile_connector_common,create_rar_common"/>
+ <target name="deploy_connector" depends="deploy_connector_common, deploy-connector-resource_common"/>
+ <target name="undeploy_connector" depends="undeploy_connector_resource_common, undeploy_connector_common"/>
+</project>
\ No newline at end of file diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRates.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRates.java new file mode 100644 index 0000000..39efddd --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRates.java @@ -0,0 +1,9 @@ +package examples.integration.loanratesejb;
+
+public interface LoanRates{
+
+ public float getHomeEquityRate();
+}
+
+
+
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesBean.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesBean.java new file mode 100644 index 0000000..f01f25e --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesBean.java @@ -0,0 +1,46 @@ +package examples.integration.loanratesejb;
+
+import javax.resource.cci.*;
+
+import javax.ejb.Stateless;
+import javax.ejb.Remote;
+import javax.ejb.TransactionManagement;
+import javax.ejb.TransactionManagementType;
+import javax.annotation.*;
+
+@Stateless
+@Remote(LoanRates.class)
+@TransactionManagement(TransactionManagementType.BEAN)
+public class LoanRatesBean implements LoanRates{
+
+ @Resource (name="OutboundLoanJNDIName")
+ public javax.resource.cci.ConnectionFactory connFactory;
+
+ public float getHomeEquityRate() {
+ float retVal=0;
+
+ System.out.println("LoanRatesBean.getHomeEquityRate() called");
+
+ try {
+ javax.resource.cci.Connection myCon = connFactory.getConnection();
+ javax.resource.cci.Interaction interaction = myCon.createInteraction();
+ javax.resource.cci.MappedRecord recordIn = connFactory.getRecordFactory().createMappedRecord("");
+
+ recordIn.put("HomeEquityRate","");
+
+ javax.resource.cci.MappedRecord recordOut =
+ (javax.resource.cci.MappedRecord)interaction.execute(null, (javax.resource.cci.Record)recordIn);
+
+ myCon.close();
+
+ Object result = recordOut.get("HomeEquityRate");
+ retVal = ((Float)result).floatValue();
+
+ } catch(Exception e) {
+
+ e.printStackTrace();
+ }
+
+ return retVal;
+ }
+}
\ No newline at end of file diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesClient.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesClient.java new file mode 100644 index 0000000..8a10952 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/integration/loanratesejb/LoanRatesClient.java @@ -0,0 +1,18 @@ +package examples.integration.loanratesejb;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Hashtable;
+import javax.naming.*;
+
+public class LoanRatesClient {
+
+ public static void main(String[] args) throws Exception{
+
+ Context ctx = new InitialContext();
+
+ LoanRates loanRates = (LoanRates) ctx.lookup("examples.integration.loanratesejb.LoanRates");
+
+ System.out.println("getHomeEquityRate() returned: " + loanRates.getHomeEquityRate() + ". Take a look at application server log or console for messages from LoanRatesEJB and OutboundLoanRA.");
+ }
+}
\ 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/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 diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/JavaLoanApp.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/JavaLoanApp.java new file mode 100644 index 0000000..4a23e0d --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/JavaLoanApp.java @@ -0,0 +1,20 @@ +package examples.jni;
+
+public class JavaLoanApp
+{
+
+ public JavaLoanApp(String libPath) {
+
+ System.load(libPath);
+ }
+
+ /* Use this function to unit test whether the library is being loaded properly */
+ /*
+ public static void main(String args[])
+ {
+ JavaLoanApp jla = new JavaLoanApp("c:\\LoanApp.dll");
+ System.out.println ("Here is the output from the JNI call: " + jla.getHomeEquityLoanRate());
+ }*/
+
+ public native float getHomeEquityLoanRate();
+}
\ No newline at end of file diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/BuildLog.htm b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/BuildLog.htm new file mode 100644 index 0000000..86c5e67 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/BuildLog.htm @@ -0,0 +1,52 @@ +<html>
+<head>
+<META HTTP-EQUIV="Content-Type" content="text/html; charset=Windows-1252">
+</head>
+<body>
+<pre>
+<table width=100% bgcolor=#CFCFE5><tr> <td> <font face=arial size=+3>
+Build Log
+</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>
+<h3>------- Build started: Project: LoanApp, Configuration: Debug|Win32 -------
+</h3>
+</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
+Command Lines
+</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>Creating temporary file "c:\temp\3eCode\Integration\src\examples\jni\LoanApp\Debug\RSP000001.rsp" with contents
+[
+/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_USRDLL" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /Zc:wchar_t /Yu"stdafx.h" /Fp"Debug/LoanApp.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP /I "C:\Sun\J2SDKEE1.4\jdk\include"
+/I "C:\Sun\J2SDKEE1.4\jdk\include\win32"
+.\LoanApp.cpp
+]
+Creating command line "cl.exe @c:\temp\3eCode\Integration\src\examples\jni\LoanApp\Debug\RSP000001.rsp /nologo"
+Creating temporary file "c:\temp\3eCode\Integration\src\examples\jni\LoanApp\Debug\RSP000002.rsp" with contents
+[
+/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_USRDLL" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /Zc:wchar_t /Yc"stdafx.h" /Fp"Debug/LoanApp.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP /I "C:\Sun\J2SDKEE1.4\jdk\include"
+/I "C:\Sun\J2SDKEE1.4\jdk\include\win32"
+.\stdafx.cpp
+]
+Creating command line "cl.exe @c:\temp\3eCode\Integration\src\examples\jni\LoanApp\Debug\RSP000002.rsp /nologo"
+Creating command line "rc.exe /d "_DEBUG" /d "_AFXDLL" /l 0x409 /I "Debug" /fo"Debug/LoanApp.res" .\LoanApp.rc"
+Creating temporary file "c:\temp\3eCode\Integration\src\examples\jni\LoanApp\Debug\RSP000003.rsp" with contents
+[
+/OUT:"Debug/LoanApp.dll" /INCREMENTAL /NOLOGO /DLL /DEF:".\LoanApp.def" /DEBUG /PDB:"Debug/LoanApp.pdb" /SUBSYSTEM:WINDOWS /IMPLIB:"Debug/LoanApp.lib" /MACHINE:X86
+.\Debug\LoanApp.obj
+.\Debug\stdafx.obj
+.\Debug\LoanApp.res
+]
+Creating command line "link.exe @c:\temp\3eCode\Integration\src\examples\jni\LoanApp\Debug\RSP000003.rsp"
+</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
+Output Window
+</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>Compiling...
+stdafx.cpp
+Compiling...
+LoanApp.cpp
+c:\temp\3eCode\Integration\src\examples\jni\LoanApp\LoanApp.h(33) : warning C4305: 'return' : truncation from 'double' to 'jfloat'
+Compiling resources...
+Linking...
+ Creating library Debug/LoanApp.lib and object Debug/LoanApp.exp
+</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
+Results
+</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>
+Build log was saved at "file://c:\temp\3eCode\Integration\src\examples\jni\LoanApp\Debug\BuildLog.htm"
+LoanApp - 0 error(s), 1 warning(s)</pre></table><table width=100% height=20 bgcolor=#CFCFE5><tr><td><font face=arial size=+2>
+</font></table></body></html>
\ No newline at end of file diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.dll b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.dll Binary files differnew file mode 100644 index 0000000..a288419 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.dll diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.exp b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.exp Binary files differnew file mode 100644 index 0000000..d4ffd8d --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.exp diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.ilk b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.ilk Binary files differnew file mode 100644 index 0000000..a87dd3b --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.ilk diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.lib b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.lib Binary files differnew file mode 100644 index 0000000..774cb22 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.lib diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.obj b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.obj Binary files differnew file mode 100644 index 0000000..b6f3a3f --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.obj diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.pch b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.pch Binary files differnew file mode 100644 index 0000000..8da2235 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.pch diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.pdb b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.pdb Binary files differnew file mode 100644 index 0000000..715d9d6 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.pdb diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.res b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.res Binary files differnew file mode 100644 index 0000000..cefd6e4 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/LoanApp.res diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/stdafx.obj b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/stdafx.obj Binary files differnew file mode 100644 index 0000000..2c8bca3 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/stdafx.obj diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/vc70.idb b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/vc70.idb Binary files differnew file mode 100644 index 0000000..afd4952 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/vc70.idb diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/vc70.pdb b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/vc70.pdb Binary files differnew file mode 100644 index 0000000..e390469 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Debug/vc70.pdb diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.cpp b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.cpp new file mode 100644 index 0000000..fc447b2 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.cpp @@ -0,0 +1,65 @@ +// LoanApp.cpp : Defines the initialization routines for the DLL.
+//
+
+#include "stdafx.h"
+#include "LoanApp.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+//
+// Note!
+//
+// If this DLL is dynamically linked against the MFC
+// DLLs, any functions exported from this DLL which
+// call into MFC must have the AFX_MANAGE_STATE macro
+// added at the very beginning of the function.
+//
+// For example:
+//
+// extern "C" BOOL PASCAL EXPORT ExportedFunction()
+// {
+// AFX_MANAGE_STATE(AfxGetStaticModuleState());
+// // normal function body here
+// }
+//
+// It is very important that this macro appear in each
+// function, prior to any calls into MFC. This means that
+// it must appear as the first statement within the
+// function, even before any object variable declarations
+// as their constructors may generate calls into the MFC
+// DLL.
+//
+// Please see MFC Technical Notes 33 and 58 for additional
+// details.
+//
+
+// CLoanAppApp
+
+BEGIN_MESSAGE_MAP(CLoanAppApp, CWinApp)
+END_MESSAGE_MAP()
+
+
+// CLoanAppApp construction
+
+CLoanAppApp::CLoanAppApp()
+{
+ // TODO: add construction code here,
+ // Place all significant initialization in InitInstance
+}
+
+
+// The one and only CLoanAppApp object
+
+CLoanAppApp theApp;
+
+
+// CLoanAppApp initialization
+
+BOOL CLoanAppApp::InitInstance()
+{
+ CWinApp::InitInstance();
+
+ return TRUE;
+}
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.def b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.def new file mode 100644 index 0000000..382f22e --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.def @@ -0,0 +1,6 @@ +; LoanApp.def : Declares the module parameters for the DLL.
+
+LIBRARY "LoanApp"
+
+EXPORTS
+ ; Explicit exports can go here
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.h b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.h new file mode 100644 index 0000000..db9c166 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.h @@ -0,0 +1,34 @@ +// LoanApp.h : main header file for the LoanApp DLL
+//
+
+#pragma once
+
+#ifndef __AFXWIN_H__
+ #error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h" // main symbols
+
+
+// CLoanAppApp
+// See LoanApp.cpp for the implementation of this class
+//
+
+#include "examples_jni_JavaLoanApp.h"
+
+class CLoanAppApp : public CWinApp
+{
+public:
+ CLoanAppApp();
+
+// Overrides
+public:
+ virtual BOOL InitInstance();
+
+ DECLARE_MESSAGE_MAP()
+};
+
+JNIEXPORT jfloat JNICALL Java_examples_jni_JavaLoanApp_getHomeEquityLoanRate(JNIEnv *, jobject)
+{
+ return 5.64;
+}
\ No newline at end of file diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.ncb b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.ncb Binary files differnew file mode 100644 index 0000000..f3c2323 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.ncb diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.rc b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.rc new file mode 100644 index 0000000..c6f0a3b --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.rc @@ -0,0 +1,115 @@ +// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+ "#define _AFX_NO_OLE_RESOURCES\r\n"
+ "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+ "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+ "\r\n"
+ "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+ "LANGUAGE 9, 1\r\n"
+ "#pragma code_page(1252)\r\n"
+ "#include ""res\\LoanApp.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
+ "#include ""afxres.rc"" // Standard components\r\n"
+ "#endif\r\n"
+ "\0"
+END
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // APSTUDIO_INVOKED
+
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+LANGUAGE 9, 1
+#pragma code_page(1252)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904e4"
+ BEGIN
+ VALUE "CompanyName", "TODO: <Company name>"
+ VALUE "FileDescription", "TODO: <File description>"
+ VALUE "FileVersion", "1.0.0.1"
+ VALUE "InternalName", "LoanApp.dll"
+ VALUE "LegalCopyright", "TODO: (c) <Company name>. All rights reserved."
+ VALUE "OriginalFilename","LoanApp.dll"
+ VALUE "ProductName", "TODO: <Product name>"
+ VALUE "ProductVersion", "1.0.0.1"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 1252
+ END
+END
+
+#endif
+#ifndef APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#include "res\\LoanApp.rc2" // non-Microsoft Visual C++ edited resources
+#include "afxres.rc" // Standard components
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.sln b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.sln new file mode 100644 index 0000000..19e9621 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LoanApp", "LoanApp.vcproj", "{7D0EA7E6-4A2E-4BA9-ACAC-1DFD08836FCA}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {7D0EA7E6-4A2E-4BA9-ACAC-1DFD08836FCA}.Debug.ActiveCfg = Debug|Win32
+ {7D0EA7E6-4A2E-4BA9-ACAC-1DFD08836FCA}.Debug.Build.0 = Debug|Win32
+ {7D0EA7E6-4A2E-4BA9-ACAC-1DFD08836FCA}.Release.ActiveCfg = Release|Win32
+ {7D0EA7E6-4A2E-4BA9-ACAC-1DFD08836FCA}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.suo b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.suo Binary files differnew file mode 100644 index 0000000..c036b6e --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.suo diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.vcproj b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.vcproj new file mode 100644 index 0000000..b9de1bd --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/LoanApp.vcproj @@ -0,0 +1,187 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="LoanApp"
+ ProjectGUID="{7D0EA7E6-4A2E-4BA9-ACAC-1DFD08836FCA}"
+ Keyword="MFCDLLProj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="2"
+ UseOfMFC="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/I "C:\Sun\J2SDKEE1.4\jdk\include"
+/I "C:\Sun\J2SDKEE1.4\jdk\include\win32""
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ UsePrecompiledHeader="3"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/LoanApp.dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile=".\LoanApp.def"
+ GenerateDebugInformation="TRUE"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/LoanApp.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="FALSE"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="2"
+ UseOfMFC="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ UsePrecompiledHeader="3"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/LoanApp.dll"
+ LinkIncremental="1"
+ ModuleDefinitionFile=".\LoanApp.def"
+ GenerateDebugInformation="TRUE"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(OutDir)/LoanApp.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="FALSE"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath=".\LoanApp.cpp">
+ </File>
+ <File
+ RelativePath=".\LoanApp.def">
+ </File>
+ <File
+ RelativePath=".\stdafx.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"/>
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ <File
+ RelativePath=".\LoanApp.h">
+ </File>
+ <File
+ RelativePath=".\Resource.h">
+ </File>
+ <File
+ RelativePath=".\stdafx.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+ <File
+ RelativePath=".\LoanApp.rc">
+ </File>
+ <File
+ RelativePath=".\res\LoanApp.rc2">
+ </File>
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/ReadMe.txt b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/ReadMe.txt new file mode 100644 index 0000000..54d2076 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/ReadMe.txt @@ -0,0 +1,59 @@ +========================================================================
+ MICROSOFT FOUNDATION CLASS LIBRARY : LoanApp Project Overview
+========================================================================
+
+
+AppWizard has created this LoanApp DLL for you. This DLL not only
+demonstrates the basics of using the Microsoft Foundation classes but
+is also a starting point for writing your DLL.
+
+This file contains a summary of what you will find in each of the files that
+make up your LoanApp DLL.
+
+LoanApp.vcproj
+ This is the main project file for VC++ projects generated using an Application Wizard.
+ It contains information about the version of Visual C++ that generated the file, and
+ information about the platforms, configurations, and project features selected with the
+ Application Wizard.
+
+LoanApp.h
+ This is the main header file for the DLL. It declares the
+ CLoanAppApp class.
+
+LoanApp.cpp
+ This is the main DLL source file. It contains the class CLoanAppApp.
+LoanApp.rc
+ This is a listing of all of the Microsoft Windows resources that the
+ program uses. It includes the icons, bitmaps, and cursors that are stored
+ in the RES subdirectory. This file can be directly edited in Microsoft
+ Visual C++.
+
+res\LoanApp.rc2
+ This file contains resources that are not edited by Microsoft
+ Visual C++. You should place all resources not editable by
+ the resource editor in this file.
+
+LoanApp.def
+ This file contains information about the DLL that must be
+ provided to run with Microsoft Windows. It defines parameters
+ such as the name and description of the DLL. It also exports
+ functions from the DLL.
+
+/////////////////////////////////////////////////////////////////////////////
+Other standard files:
+
+StdAfx.h, StdAfx.cpp
+ These files are used to build a precompiled header (PCH) file
+ named LoanApp.pch and a precompiled types file named StdAfx.obj.
+
+Resource.h
+ This is the standard header file, which defines new resource IDs.
+ Microsoft Visual C++ reads and updates this file.
+
+/////////////////////////////////////////////////////////////////////////////
+Other notes:
+
+AppWizard uses "TODO:" to indicate parts of the source code you
+should add to or customize.
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Resource.h b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Resource.h new file mode 100644 index 0000000..4f1e958 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/Resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by LoanApp.RC
+//
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+
+#define _APS_NEXT_RESOURCE_VALUE 1000
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 1000
+#define _APS_NEXT_COMMAND_VALUE 32771
+#endif
+#endif
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/examples_jni_JavaLoanApp.h b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/examples_jni_JavaLoanApp.h new file mode 100644 index 0000000..5fa7ae1 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/examples_jni_JavaLoanApp.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include <jni.h>
+/* Header for class examples_jni_JavaLoanApp */ + +#ifndef _Included_examples_jni_JavaLoanApp +#define _Included_examples_jni_JavaLoanApp
+#ifdef __cplusplus +extern "C" { +#endif
+/*
+ * Class: examples_jni_JavaLoanApp
+ * Method: getHomeEquityLoanRate
+ * Signature: ()F
+ */
+JNIEXPORT jfloat JNICALL Java_examples_jni_JavaLoanApp_getHomeEquityLoanRate
+ (JNIEnv *, jobject); +
+#ifdef __cplusplus +} +#endif
+#endif
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/res/LoanApp.rc2 b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/res/LoanApp.rc2 new file mode 100644 index 0000000..dba29d8 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/res/LoanApp.rc2 @@ -0,0 +1,13 @@ +//
+// LoanApp.RC2 - resources Microsoft Visual C++ does not edit directly
+//
+
+#ifdef APSTUDIO_INVOKED
+#error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Add manually edited resources here...
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/stdafx.cpp b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/stdafx.cpp new file mode 100644 index 0000000..637e68b --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/stdafx.cpp @@ -0,0 +1,7 @@ +// stdafx.cpp : source file that includes just the standard includes
+// LoanApp.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/stdafx.h b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/stdafx.h new file mode 100644 index 0000000..38a65bb --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/LoanApp/stdafx.h @@ -0,0 +1,52 @@ +// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+
+#pragma once
+
+#ifndef VC_EXTRALEAN
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+#endif
+
+// Modify the following defines if you have to target a platform prior to the ones specified below.
+// Refer to MSDN for the latest info on corresponding values for different platforms.
+#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later.
+#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
+#endif
+
+#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
+#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 2000 or later.
+#endif
+
+#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
+#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
+#endif
+
+#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later.
+#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later.
+#endif
+
+#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
+
+#include <afxwin.h> // MFC core and standard components
+#include <afxext.h> // MFC extensions
+
+#ifndef _AFX_NO_OLE_SUPPORT
+#include <afxole.h> // MFC OLE classes
+#include <afxodlgs.h> // MFC OLE dialog classes
+#include <afxdisp.h> // MFC Automation classes
+#endif // _AFX_NO_OLE_SUPPORT
+
+#ifndef _AFX_NO_DB_SUPPORT
+#include <afxdb.h> // MFC ODBC database classes
+#endif // _AFX_NO_DB_SUPPORT
+
+#ifndef _AFX_NO_DAO_SUPPORT
+#include <afxdao.h> // MFC DAO database classes
+#endif // _AFX_NO_DAO_SUPPORT
+
+#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h> // MFC support for Windows Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/nativelib/LoanApp.dll b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/nativelib/LoanApp.dll Binary files differnew file mode 100644 index 0000000..a288419 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/jni/nativelib/LoanApp.dll diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/Hello.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/Hello.java new file mode 100644 index 0000000..fa4648b --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/Hello.java @@ -0,0 +1,13 @@ +package examples.session.stateless;
+
+/**
+ * This is the Hello business interface.
+ */
+
+public interface Hello {
+
+ /**
+ * @return a greeting to the client.
+ */
+ public String hello();
+}
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/HelloBean.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/HelloBean.java new file mode 100644 index 0000000..10e6baf --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/HelloBean.java @@ -0,0 +1,16 @@ +package examples.session.stateless;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+/**
+ * Demonstration stateless session bean.
+ */
+@Stateless
+@Remote(Hello.class)
+public class HelloBean implements Hello {
+ public String hello() {
+ System.out.println("hello()");
+ return "Hello, World!";
+ }
+}
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/HelloClient.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/HelloClient.java new file mode 100644 index 0000000..9becd53 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/HelloClient.java @@ -0,0 +1,59 @@ +package examples.session.stateless;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Hashtable;
+
+// The following import should be removed.
+
+import examples.session.stateless.*;
+import javax.naming.*;
+
+/**
+ * This class is an example of client code which invokes
+ * methods on a simple, remote stateless session bean.
+ */
+public class HelloClient {
+
+ public static void main(String[] args) throws Exception {
+ /*
+ * Obtain the JNDI initial context.
+ *
+ * The initial context is a starting point for
+ * connecting to a JNDI tree. We choose our JNDI
+ * driver, the network location of the server, etc
+ * by passing in the environment properties.
+ */
+
+ System.out.println("about to create initialcontext");
+
+ Hashtable env = new Hashtable();
+ env.put("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory");
+ env.put("java.naming.factory.url.pkgs","com.sun.enterprise.naming");
+ env.put("java.naming.provider.url","localhost:3700");
+ Context ctx = new InitialContext();
+
+ //System.out.println ("Trying to get the name of this context: " + ctx.getNameInNamespace());
+
+ System.out.println("Got initial context ... yeah ");
+
+ /*
+ * Get a reference to a bean instance, looked up by class name
+ */
+ NamingEnumeration ne = ctx.list("");
+ System.out.println("Got list... ");
+ while(ne.hasMore())
+ {
+ NameClassPair nc = (NameClassPair)ne.next();
+ System.out.println("Entry is ... "+nc.getName()+" -- "+nc.getClassName());
+ }
+
+ Hello hello = (Hello) ctx.lookup("examples.session.stateless.Hello");
+
+ /*
+ * Call the hello() method on the bean.
+ * We then print the result to the screen.
+ */
+ System.out.println(hello.hello());
+ }
+}
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/HelloClient.java.original b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/HelloClient.java.original new file mode 100644 index 0000000..f90a759 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/HelloClient.java.original @@ -0,0 +1,41 @@ +package examples.session.stateless;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+/**
+ * This class is an example of client code which invokes
+ * methods on a simple, remote stateless session bean.
+ */
+public class HelloClient {
+
+ public static void main(String[] args) throws Exception {
+ /*
+ * Obtain the JNDI initial context.
+ *
+ * The initial context is a starting point for
+ * connecting to a JNDI tree. We choose our JNDI
+ * driver, the network location of the server, etc
+ * by passing in the environment properties.
+ */
+
+ System.out.println("about to create initialcontext");
+ //Context ctx = new InitialContext(System.getProperties());
+ Context ctx = new InitialContext();
+
+ //System.out.println ("Trying to get the name of this context: " + ctx.getNameInNamespace());
+
+ System.out.println("Got initial context ... yeah ");
+
+ /*
+ * Get a reference to a bean instance, looked up by class name
+ */
+ Hello hello = (Hello) ctx.lookup("HelloBean");
+
+ /*
+ * Call the hello() method on the bean.
+ * We then print the result to the screen.
+ */
+ System.out.println(hello.hello());
+ }
+}
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/META-INF/ejb-jar.xml b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/META-INF/ejb-jar.xml new file mode 100644 index 0000000..9503e74 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/META-INF/ejb-jar.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8" ?>
+ <ejb-jar>
+ <enterprise-beans>
+ </enterprise-beans>
+</ejb-jar>
\ No newline at end of file diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/Readme.txt b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/Readme.txt new file mode 100644 index 0000000..a35bbb5 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/Readme.txt @@ -0,0 +1,13 @@ +1) asant jar
+
+2) asant deploy_common
+
+3) asant base_clientjar_common
+
+4) Turn off the firewall right before running the client (for Glassfish)
+
+asant run_client
+
+5) asant undeploy_common
+
+6) asant clean_all
\ No newline at end of file diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/build.xml b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/build.xml new file mode 100644 index 0000000..7fbd159 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/session/stateless/build.xml @@ -0,0 +1,30 @@ +<?xml version="1.0"?>
+<!DOCTYPE project [ <!ENTITY include SYSTEM "../../../../etc/common.xml"> ]>
+
+<project name="ejb3-examples-session-stateless" default="jar"
+ basedir="../../../..">
+
+ <!-- basic settings -->
+ <property name="src.dir" value="${basedir}/src"/>
+ <property name="build.dir" value="${basedir}/build"/>
+ <property name="build.classes.dir" value="${build.dir}/classes"/>
+ <property name="appname" value="StatelessSession"/>
+ <property name="client.class" value="examples.session.stateless.HelloClient"/>
+ <property name="app.pkg" value="examples/session/stateless"/>
+ <property name="package" value="${app.pkg}"/>
+ <property name="pack.dir" value="${src.dir}/${app.pkg}"/>
+ <property name="jar.pkg" value="examples/session/stateless"/>
+
+
+ <!-- Include common.xml -->
+ &include;
+
+ <property name="assemble.dir" value="${assemble.ejbjar}"/>
+ <property name="deploy.file" value="${ejbjar}"/>
+
+ <target name="jar" depends="compile_common, create_ejbjar_common"/>
+ <target name="ear" depends="jar,create_ear_common"/>
+
+ <target name="clean_all" depends="clean_common, clean_ejbjar_common, clean_clientjar_common"/>
+</project>
+
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/CleanDayLimitOrders.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/CleanDayLimitOrders.java new file mode 100644 index 0000000..55df678 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/CleanDayLimitOrders.java @@ -0,0 +1,13 @@ +package examples.timer;
+
+import javax.ejb.Remote;
+import javax.ejb.Timer;
+
+
+/**
+ * This is the business interface for CleanDayLimitOrders enterprise bean.
+ */
+@Remote
+public interface CleanDayLimitOrders {
+ public void cleanPeriodicallyDayLimitOrders();
+}
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/CleanDayLimitOrdersBean.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/CleanDayLimitOrdersBean.java new file mode 100644 index 0000000..1f90550 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/CleanDayLimitOrdersBean.java @@ -0,0 +1,67 @@ +package examples.timer;
+
+import javax.ejb.*;
+import javax.annotation.Resource;
+
+import java.util.Calendar;
+import java.util.TimeZone;
+import java.util.SimpleTimeZone;
+import java.util.GregorianCalendar;
+import java.util.Date;
+
+@Stateless
+public class CleanDayLimitOrdersBean implements CleanDayLimitOrders {
+
+ @Resource private SessionContext ctx;
+
+ public void cleanPeriodicallyDayLimitOrders()
+ {
+ // Get hold of the eastern time zone assuming that the securities are being
+ // traded on NYSE and NASDAQ exchanges.
+ String[] timezoneIDs = TimeZone.getAvailableIDs (-5 * 60 * 60 * 1000);
+
+ SimpleTimeZone est = new SimpleTimeZone (-5 * 60 * 60 * 1000, timezoneIDs[0]);
+
+ // Provide the rules for start and end days of daylight savings time.
+ est.setStartRule (Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
+ est.setEndRule (Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
+
+ // Get hold of a calendar instance for the eastern time zone.
+ Calendar cal = new GregorianCalendar(est);
+
+ // Set the calendar to the current time.
+ cal.setTime (new Date ());
+
+ // Calculate the difference between now and market close i.e. 4 PM Eastern.
+ int hourofday = cal.get (cal.HOUR_OF_DAY);
+ int minuteofhour = cal.get (cal.MINUTE);
+
+ // If this method is invoked after the market close, then set the timer expiration
+ // immediately i.e. start=0. Otherwise, calculate the milliseconds that needs
+ // to elapse until first timer expiration.
+ long start = 0;
+ if (hourofday < 16)
+ {
+ int hourdiff = 16 - hourofday - 1;
+ int mindiff = 60 - minuteofhour;
+
+ start = (hourdiff * 60 * 60 * 1000) + (mindiff * 60 * 1000);
+ }
+
+ // Finally, get hold of the timer service instance from EJBContext object and create the
+ // recurrent expiration timer.
+ TimerService timerService = ctx.getTimerService();
+ Timer timer = timerService.createTimer(start, 86400000, null);
+
+ System.out.println("CleanDayLimitOrdersBean: Timer created to first expire after " + start + " milliseconds.");
+ }
+
+ @Timeout
+ public void handleTimeout(Timer timer)
+ {
+ System.out.println("CleanDayLimitOrdersBean: handleTimeout called.");
+
+ // Put here the code for cleaning the database of day limit orders that have
+ // not been executed.
+ }
+}
\ No newline at end of file diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/CleanDayLimitOrdersClient.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/CleanDayLimitOrdersClient.java new file mode 100644 index 0000000..749de86 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/CleanDayLimitOrdersClient.java @@ -0,0 +1,19 @@ +package examples.timer;
+
+import javax.ejb.EJB;
+
+public class CleanDayLimitOrdersClient {
+ @EJB
+ private static CleanDayLimitOrders cleanDayLimitOrders;
+
+ public static void main(String[] args) {
+ try {
+ cleanDayLimitOrders.cleanPeriodicallyDayLimitOrders();
+
+ System.out.println ("cleanPeriodicallyDayLimitOrders() returned successfully. Take a look at the application server log or console for messages from bean.");
+ } catch (Exception ex) {
+ System.err.println("Caught an unexpected exception!");
+ ex.printStackTrace();
+ }
+ }
+}
\ No newline at end of file diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/META-INF/application-client.xml b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/META-INF/application-client.xml new file mode 100644 index 0000000..7e232d8 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/META-INF/application-client.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<application-client xmlns='http://java.sun.com/xml/ns/javaee'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xsi:schemaLocation='http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application-client_5.xsd'
+ version="5">
+ <display-name>CleanDayLimitOrdersClient</display-name>
+</application-client>
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/META-INF/application.xml b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/META-INF/application.xml new file mode 100644 index 0000000..8fc0433 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/META-INF/application.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<application version="5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd">
+ <display-name>CleanDayLimitOrdersApp</display-name>
+ <module>
+ <ejb>CleanDayLimitOrdersEjb.jar</ejb>
+ </module>
+ <module>
+ <java>CleanDayLimitOrdersClient.jar</java>
+ </module>
+</application>
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/META-INF/ejb-jar.xml b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/META-INF/ejb-jar.xml new file mode 100644 index 0000000..a358d5a --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/META-INF/ejb-jar.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" full="false" version="3.0" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
+ <enterprise-beans>
+ <session>
+ <display-name>CleanDayLimitOrdersBean</display-name>
+ <ejb-name>CleanDayLimitOrdersBean</ejb-name>
+ <business-remote>examples.timer.CleanDayLimitOrders</business-remote>
+ <ejb-class>examples.timer.CleanDayLimitOrdersBean</ejb-class>
+ <session-type>Stateless</session-type>
+ <timeout-method>
+ <method-name>handleTimeout</method-name>
+ <method-params>
+ <method-param>javax.ejb.Timer</method-param>
+ </method-params>
+ </timeout-method>
+ <transaction-type>Container</transaction-type>
+ <security-identity>
+ <use-caller-identity/>
+ </security-identity>
+ </session>
+ </enterprise-beans>
+</ejb-jar>
\ No newline at end of file diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/Readme.txt b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/Readme.txt new file mode 100644 index 0000000..6e5d1aa --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/Readme.txt @@ -0,0 +1,15 @@ +1) asant jar
+
+2) asant app_clientjar_common
+
+3) asant create_ear_common_with_clientjar
+
+4) asant deploy_common
+
+5) Turn off the firewall right before running the client (for Glassfish)
+
+6) asant run_client_in_appcontainer
+
+5) asant undeploy_common
+
+6) asant clean_all
\ No newline at end of file diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/build.xml b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/build.xml new file mode 100644 index 0000000..7030d4a --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Rima Examples/src/examples/timer/build.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?>
+<!DOCTYPE project [ <!ENTITY include SYSTEM "../../../etc/common.xml"> ]>
+
+<project name="ejb3-examples-session-stateless" default="jar"
+ basedir="../../..">
+
+ <!-- basic settings -->
+ <property name="src.dir" value="${basedir}/src"/>
+ <property name="build.dir" value="${basedir}/build"/>
+ <property name="build.classes.dir" value="${build.dir}/classes"/>
+ <property name="appname" value="CleanDayLimitOrders"/>
+ <property name="client.class" value="examples.timer.CleanDayLimitOrdersClient"/>
+ <property name="app.pkg" value="examples/timer"/>
+ <property name="package" value="${app.pkg}"/>
+ <property name="pack.dir" value="${src.dir}/${app.pkg}"/>
+ <property name="jar.pkg" value="examples/timer"/>
+
+
+ <!-- Include common.xml -->
+ &include;
+
+ <property name="assemble.dir" value="${assemble.ear}"/>
+ <property name="deploy.file" value="${ear}"/>
+
+ <target name="jar" depends="compile_common, create_ejbjar_common"/>
+ <target name="ear" depends="jar,create_ear_common"/>
+
+ <target name="clean_all" depends="clean_common, clean_ejbjar_common, clean_clientjar_common"/>
+</project>
\ No newline at end of file |
