geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hogst...@apache.org
Subject svn commit: r553607 - in /geronimo/daytrader/trunk/modules: ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/ ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/ ejb/src/main/resources/META-INF/ web/src/main/java/org/apache/g...
Date Thu, 05 Jul 2007 18:47:29 GMT
Author: hogstrom
Date: Thu Jul  5 11:47:28 2007
New Revision: 553607

URL: http://svn.apache.org/viewvc?view=rev&rev=553607
Log:
Multiple changes around naming for JMS resources.  This isn't complete but is deployable.

Modified:
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestBean.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/TestMDB.java
    geronimo/daytrader/trunk/modules/ejb/src/main/resources/META-INF/ejb-jar.xml
    geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2MDB.java
    geronimo/daytrader/trunk/modules/web/src/main/webapp/WEB-INF/web.xml

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java?view=diff&rev=553607&r1=553606&r2=553607
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java
(original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java
Thu Jul  5 11:47:28 2007
@@ -16,6 +16,7 @@
  */
 package org.apache.geronimo.samples.daytrader.ejb;
 
+import javax.annotation.Resource;
 import javax.ejb.*;
 import javax.jms.*;
 import javax.naming.*;
@@ -41,8 +42,13 @@
 	private LocalKeySequence keySequence;	
 	
 	private ConnectionFactory qConnFactory = null;
-	private Queue queue = null; 
+	
+	@Resource(name = "jms/TradeBrokerQueue") 
+	private Queue brokerQueue = null;
+	
 	private ConnectionFactory tConnFactory = null;
+	
+	@Resource(name = "jms/TradeStreamerTopic") 
 	private Topic streamerTopic = null; 
 
 	//Boolean to signify if the Order By clause is supported by the app server.
@@ -61,7 +67,7 @@
 		{
 			conn = qConnFactory.createConnection();                        
 			sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-			MessageProducer msgProducer = sess.createProducer(queue);
+			MessageProducer msgProducer = sess.createProducer(brokerQueue);
 			TextMessage   message = sess.createTextMessage();
 
 			message.setStringProperty("command", "neworder");
@@ -984,7 +990,7 @@
 
 			conn = qConnFactory.createConnection();                        
 			sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-			MessageProducer msgProducer = sess.createProducer(queue);
+			MessageProducer msgProducer = sess.createProducer(brokerQueue);
 			TextMessage   message = sess.createTextMessage();
 
 			String command= "ping";
@@ -1039,9 +1045,9 @@
 			try
 			{
 				qConnFactory = (ConnectionFactory) ic.lookup("java:comp/env/jms/QueueConnectionFactory");
-                 tConnFactory = (ConnectionFactory) ic.lookup("java:comp/env/jms/TopicConnectionFactory");
+                tConnFactory = (ConnectionFactory) ic.lookup("java:comp/env/jms/TopicConnectionFactory");
 				streamerTopic = (Topic) ic.lookup("java:comp/env/jms/TradeStreamerTopic");
-                 queue = (Queue) ic.lookup("java:comp/env/jms/TradeBrokerQueue");
+                brokerQueue = (Queue) ic.lookup("java:comp/env/jms/TradeBrokerQueue");
 			}
 			catch (Exception e)
 			{
@@ -1077,7 +1083,7 @@
 					"\n\t holdingHome="+ holdingHome+
 					"\n\t orderHome="+ orderHome+
 					"\n\t qConnFactory="+ qConnFactory+
-					"\n\t queue="+ queue+
+					"\n\t queue="+ brokerQueue+
 					"\n\t tConnFactory="+ tConnFactory+
 					"\n\t streamerTopic="+ streamerTopic;
 				Log.error(error);

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestBean.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestBean.java?view=diff&rev=553607&r1=553606&r2=553607
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestBean.java
(original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestBean.java
Thu Jul  5 11:47:28 2007
@@ -17,10 +17,10 @@
 @Stateless
 public class LocalSLMDBTestBean implements LocalSLMDBTestLocal, LocalSLMDBTestRemote {
    
-    @Resource(name = "jms/TradeBrokerQCF")
+    @Resource(name = "jms/QueueConnectionFactory")
     private ConnectionFactory queueConnectionFactory;
     
-    @Resource(name = "TradeBrokerQueue")
+    @Resource(name = "jms/TradeBrokerQueue")
     private Queue tradeBrokerQueue;
 
     /** Creates a new instance of LocalSLMDBTestBean */

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/TestMDB.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/TestMDB.java?view=diff&rev=553607&r1=553606&r2=553607
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/TestMDB.java
(original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/TestMDB.java
Thu Jul  5 11:47:28 2007
@@ -5,11 +5,11 @@
 import javax.jms.Message;
 import javax.jms.MessageListener;
 
-@MessageDriven(name = "TradeBrokerQueue", activationConfig =  {
-        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
-        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
-        @ActivationConfigProperty(propertyName = "destination", propertyValue = "TradeBrokerQueue")
-    })
+//@MessageDriven(name = "ejb/TestMDB", activationConfig =  {
+//        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
+//        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
+//        @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/TradeBrokerQueue")
+//    })
 public class TestMDB implements MessageListener {
     
     /** Creates a new instance of TradeTestMDB */

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/resources/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/resources/META-INF/ejb-jar.xml?view=diff&rev=553607&r1=553606&r2=553607
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/resources/META-INF/ejb-jar.xml (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/resources/META-INF/ejb-jar.xml Thu Jul 
5 11:47:28 2007
@@ -18,8 +18,46 @@
 <ejb-jar version="3.0"
     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/ejb-jar_3_0.xsd"> 
-    <display-name>TradeEJBs</display-name>
+    <display-name>DayTrader Enterprise Bean Definitions</display-name>
     <enterprise-beans>
+    <!--
+     **
+     **  S e s s i o n   B e a n   D e f i n i t i o n s
+     ** 
+     -->
+
+
+        <!-- 
+         **
+         **  K e y S e q u e n c e E J B
+         ** 
+         -->
+        <session>
+            <display-name>KeySequenceEJB</display-name>
+            <ejb-name>KeySequenceEJB</ejb-name>
+            <local-home>org.apache.geronimo.samples.daytrader.ejb.LocalKeySequenceHome</local-home>
+            <local>org.apache.geronimo.samples.daytrader.ejb.LocalKeySequence</local>
+            <ejb-class>org.apache.geronimo.samples.daytrader.ejb.KeySequenceBean</ejb-class>
+            <session-type>Stateless</session-type>
+            <transaction-type>Container</transaction-type>
+            <ejb-local-ref>
+                <ejb-ref-name>ejb/KeyGen</ejb-ref-name>
+                <ejb-ref-type>Entity</ejb-ref-type>
+                <local-home>org.apache.geronimo.samples.daytrader.ejb.LocalKeyGenHome</local-home>
+                <local>org.apache.geronimo.samples.daytrader.ejb.LocalKeyGen</local>
+                <ejb-link>KeyGenEJB</ejb-link>
+            </ejb-local-ref>
+            <security-identity>
+                <description/>
+                <use-caller-identity/>
+            </security-identity>
+        </session>
+
+        <!--
+          **
+          **  T r a d e E J B
+          ** 
+         -->
         <session>
             <description>Trade Session EJB manages all Trading services</description>
             <display-name>TradeEJB</display-name>
@@ -107,22 +145,29 @@
                 <res-sharing-scope>Shareable</res-sharing-scope>
             </resource-ref>
             <message-destination-ref>
+                <!--  JNDI Name -->
                 <message-destination-ref-name>jms/TradeBrokerQueue</message-destination-ref-name>
                 <message-destination-type>javax.jms.Queue</message-destination-type>
                 <message-destination-usage>Produces</message-destination-usage>
-                <message-destination-link>TradeBrokerQueue</message-destination-link>
+                <message-destination-link>jms/TradeBrokerQueue</message-destination-link>
             </message-destination-ref>
             <message-destination-ref>
                 <message-destination-ref-name>jms/TradeStreamerTopic</message-destination-ref-name>
                 <message-destination-type>javax.jms.Topic</message-destination-type>
                 <message-destination-usage>Produces</message-destination-usage>
-                <message-destination-link>TradeStreamerTopic</message-destination-link>
+                <message-destination-link>jms/TradeStreamerTopic</message-destination-link>
             </message-destination-ref>
             <security-identity>
                 <description/>
                 <use-caller-identity/>
             </security-identity>
         </session>
+
+        <!--
+          **
+          **  T r a d e J P A
+          ** 
+         -->
         <session>
             <description>Trade JPA Session EJB manages all Trading services</description>
             <display-name>TradeJPA</display-name>
@@ -163,13 +208,13 @@
                 <message-destination-ref-name>jms/TradeBrokerQueue</message-destination-ref-name>
                 <message-destination-type>javax.jms.Queue</message-destination-type>
                 <message-destination-usage>Produces</message-destination-usage>
-                <message-destination-link>TradeBrokerQueue</message-destination-link>
+                <message-destination-link>jms/TradeBrokerQueue</message-destination-link>
             </message-destination-ref>
             <message-destination-ref>
                 <message-destination-ref-name>jms/TradeStreamerTopic</message-destination-ref-name>
                 <message-destination-type>javax.jms.Topic</message-destination-type>
                 <message-destination-usage>Produces</message-destination-usage>
-                <message-destination-link>TradeStreamerTopic</message-destination-link>
+                <message-destination-link>jms/TradeStreamerTopic</message-destination-link>
             </message-destination-ref>
             <security-identity>
                 <description/>
@@ -181,6 +226,12 @@
                 <persistence-context-type>Transactional</persistence-context-type>
             </persistence-context-ref>
         </session>
+        
+        <!--
+          **
+          **  T r a d e J D B C
+          ** 
+         -->
         <session>
             <description>Trade JDBC Session EJB manages all Trading services</description>
             <display-name>TradeJDBC</display-name>
@@ -195,30 +246,58 @@
                 <use-caller-identity/>
             </security-identity>
         </session>
+
+    <!-- 
+     **
+     **     C o n t a i n e r   M a n a g e d   P e r s i s t e n c e   E J B s
+     **
+     -->
+
+        <!--
+          **
+          **  A c c o u n t E J B
+          ** 
+         -->
         <entity>
-            <display-name>HoldingEJB</display-name>
-            <ejb-name>HoldingEJB</ejb-name>
-            <local-home>org.apache.geronimo.samples.daytrader.ejb.LocalHoldingHome</local-home>
-            <local>org.apache.geronimo.samples.daytrader.ejb.LocalHolding</local>
-            <ejb-class>org.apache.geronimo.samples.daytrader.ejb.HoldingBean</ejb-class>
+            <display-name>AccountEJB</display-name>
+            <ejb-name>AccountEJB</ejb-name>
+            <local-home>org.apache.geronimo.samples.daytrader.ejb.LocalAccountHome</local-home>
+            <local>org.apache.geronimo.samples.daytrader.ejb.LocalAccount</local>
+            <ejb-class>org.apache.geronimo.samples.daytrader.ejb.AccountBean</ejb-class>
             <persistence-type>Container</persistence-type>
             <prim-key-class>java.lang.Integer</prim-key-class>
             <reentrant>false</reentrant>
             <cmp-version>2.x</cmp-version>
-            <abstract-schema-name>Holding</abstract-schema-name>
+            <abstract-schema-name>Account</abstract-schema-name>
             <cmp-field>
-                <field-name>purchasePrice</field-name>
+                <field-name>creationDate</field-name>
             </cmp-field>
             <cmp-field>
-                <field-name>holdingID</field-name>
+                <field-name>openBalance</field-name>
             </cmp-field>
             <cmp-field>
-                <field-name>quantity</field-name>
+                <field-name>logoutCount</field-name>
             </cmp-field>
             <cmp-field>
-                <field-name>purchaseDate</field-name>
+                <field-name>balance</field-name>
             </cmp-field>
-            <primkey-field>holdingID</primkey-field>
+            <cmp-field>
+                <field-name>accountID</field-name>
+            </cmp-field>
+            <cmp-field>
+                <field-name>lastLogin</field-name>
+            </cmp-field>
+            <cmp-field>
+                <field-name>loginCount</field-name>
+            </cmp-field>
+            <primkey-field>accountID</primkey-field>
+            <ejb-local-ref>
+                <ejb-ref-name>ejb/AccountProfile</ejb-ref-name>
+                <ejb-ref-type>Entity</ejb-ref-type>
+                <local-home>org.apache.geronimo.samples.daytrader.ejb.LocalAccountProfileHome</local-home>
+                <local>org.apache.geronimo.samples.daytrader.ejb.LocalAccountProfile</local>
+                <ejb-link>AccountProfileEJB</ejb-link>
+            </ejb-local-ref>
             <security-identity>
                 <description/>
                 <use-caller-identity/>
@@ -226,13 +305,13 @@
             <query>
                 <description/>
                 <query-method>
-                    <method-name>ejbSelectQuoteFromSymbol</method-name>
+                    <method-name>findByUserID</method-name>
                     <method-params>
                         <method-param>java.lang.String</method-param>
                     </method-params>
                 </query-method>
-                <result-type-mapping>Local</result-type-mapping>
-                <ejb-ql>SELECT OBJECT(q) from Quote q WHERE q.symbol = ?1</ejb-ql>
+                <ejb-ql>SELECT OBJECT(a) FROM Account a WHERE
+                    a.profile.userID = ?1</ejb-ql>
             </query>
             <query>
                 <description/>
@@ -240,32 +319,28 @@
                     <method-name>findAll</method-name>
                     <method-params/>
                 </query-method>
-                <result-type-mapping>Local</result-type-mapping>
-                <ejb-ql>SELECT OBJECT(h) from Holding h</ejb-ql>
+                <ejb-ql>SELECT OBJECT(a) FROM Account a</ejb-ql>
             </query>
             <query>
-                <description/>
                 <query-method>
-                    <method-name>findByUserID</method-name>
+                    <method-name>findByUserIDForUpdate</method-name>
                     <method-params>
                         <method-param>java.lang.String</method-param>
                     </method-params>
                 </query-method>
                 <result-type-mapping>Local</result-type-mapping>
-                <ejb-ql>SELECT OBJECT(h) FROM Holding h WHERE
-                    h.account.profile.userID  = ?1</ejb-ql>
+                <ejb-ql>SELECT OBJECT(a) FROM Account a WHERE
+                    a.profile.userID = ?1</ejb-ql>
             </query>
             <query>
-                <description/>
                 <query-method>
-                    <method-name>findByAccountID</method-name>
+                    <method-name>ejbSelectClosedOrders</method-name>
                     <method-params>
                         <method-param>java.lang.Integer</method-param>
                     </method-params>
                 </query-method>
-                <result-type-mapping>Local</result-type-mapping>
-                <ejb-ql>SELECT OBJECT(h) FROM Holding h WHERE
-                    h.account.accountID  = ?1</ejb-ql>
+                <ejb-ql>SELECT o.orderID FROM Orders o WHERE
+                    o.orderStatus = 'closed' AND o.account.accountID  = ?1</ejb-ql>
             </query>
             <query>
                 <query-method>
@@ -275,30 +350,15 @@
                     </method-params>
                 </query-method>
                 <result-type-mapping>Local</result-type-mapping>
-                <ejb-ql>SELECT OBJECT(h) FROM Holding h WHERE
-                    h.holdingID = ?1</ejb-ql>
+                <ejb-ql>SELECT OBJECT(a) FROM Account a where
+                    a.accountID = ?1</ejb-ql>
             </query>
         </entity>
-        <message-driven>
-            <display-name>TradeBrokerMDB</display-name>
-            <ejb-name>TradeBrokerMDB</ejb-name>
-            <ejb-class>org.apache.geronimo.samples.daytrader.ejb.TradeBrokerMDB</ejb-class>
-            <transaction-type>Container</transaction-type>
-            <message-destination-type>javax.jms.Queue</message-destination-type>
-            <message-destination-link>TradeBrokerQueue</message-destination-link>
-            <env-entry>
-                <env-entry-name>statInterval</env-entry-name>
-                <env-entry-type>java.lang.Integer</env-entry-type>
-                <env-entry-value>100</env-entry-value>
-            </env-entry>
-            <ejb-ref>
-                <ejb-ref-name>ejb/Trade</ejb-ref-name>
-                <ejb-ref-type>Session</ejb-ref-type>
-                <home>org.apache.geronimo.samples.daytrader.ejb.TradeHome</home>
-                <remote>org.apache.geronimo.samples.daytrader.ejb.Trade</remote>
-                <ejb-link>TradeEJB</ejb-link>
-            </ejb-ref>
-        </message-driven>
+
+        <!-- 
+         ** 
+         **  A c c o u n t P r o f i l e E J B
+         -->        
         <entity>
             <display-name>AccountProfileEJB</display-name>
             <ejb-name>AccountProfileEJB</ejb-name>
@@ -355,6 +415,102 @@
                     a.userID = ?1</ejb-ql>
             </query>
         </entity>
+        
+        <!--
+          **
+          **  H o l d i n g E J B
+          ** 
+         -->
+        <entity>
+            <display-name>HoldingEJB</display-name>
+            <ejb-name>HoldingEJB</ejb-name>
+            <local-home>org.apache.geronimo.samples.daytrader.ejb.LocalHoldingHome</local-home>
+            <local>org.apache.geronimo.samples.daytrader.ejb.LocalHolding</local>
+            <ejb-class>org.apache.geronimo.samples.daytrader.ejb.HoldingBean</ejb-class>
+            <persistence-type>Container</persistence-type>
+            <prim-key-class>java.lang.Integer</prim-key-class>
+            <reentrant>false</reentrant>
+            <cmp-version>2.x</cmp-version>
+            <abstract-schema-name>Holding</abstract-schema-name>
+            <cmp-field>
+                <field-name>purchasePrice</field-name>
+            </cmp-field>
+            <cmp-field>
+                <field-name>holdingID</field-name>
+            </cmp-field>
+            <cmp-field>
+                <field-name>quantity</field-name>
+            </cmp-field>
+            <cmp-field>
+                <field-name>purchaseDate</field-name>
+            </cmp-field>
+            <primkey-field>holdingID</primkey-field>
+            <security-identity>
+                <description/>
+                <use-caller-identity/>
+            </security-identity>
+            <query>
+                <description/>
+                <query-method>
+                    <method-name>ejbSelectQuoteFromSymbol</method-name>
+                    <method-params>
+                        <method-param>java.lang.String</method-param>
+                    </method-params>
+                </query-method>
+                <result-type-mapping>Local</result-type-mapping>
+                <ejb-ql>SELECT OBJECT(q) from Quote q WHERE q.symbol = ?1</ejb-ql>
+            </query>
+            <query>
+                <description/>
+                <query-method>
+                    <method-name>findAll</method-name>
+                    <method-params/>
+                </query-method>
+                <result-type-mapping>Local</result-type-mapping>
+                <ejb-ql>SELECT OBJECT(h) from Holding h</ejb-ql>
+            </query>
+            <query>
+                <description/>
+                <query-method>
+                    <method-name>findByUserID</method-name>
+                    <method-params>
+                        <method-param>java.lang.String</method-param>
+                    </method-params>
+                </query-method>
+                <result-type-mapping>Local</result-type-mapping>
+                <ejb-ql>SELECT OBJECT(h) FROM Holding h WHERE
+                    h.account.profile.userID  = ?1</ejb-ql>
+            </query>
+            <query>
+                <description/>
+                <query-method>
+                    <method-name>findByAccountID</method-name>
+                    <method-params>
+                        <method-param>java.lang.Integer</method-param>
+                    </method-params>
+                </query-method>
+                <result-type-mapping>Local</result-type-mapping>
+                <ejb-ql>SELECT OBJECT(h) FROM Holding h WHERE
+                    h.account.accountID  = ?1</ejb-ql>
+            </query>
+            <query>
+                <query-method>
+                    <method-name>findByPrimaryKeyForUpdate</method-name>
+                    <method-params>
+                        <method-param>java.lang.Integer</method-param>
+                    </method-params>
+                </query-method>
+                <result-type-mapping>Local</result-type-mapping>
+                <ejb-ql>SELECT OBJECT(h) FROM Holding h WHERE
+                    h.holdingID = ?1</ejb-ql>
+            </query>
+        </entity>
+        
+        <!--
+          **
+          **  Q u o t e E J B
+          ** 
+         -->
         <entity>
             <description>Stock price quotes including current, open, high, low, etc.</description>
             <display-name>QuoteEJB</display-name>
@@ -463,26 +619,12 @@
                 <ejb-ql>SELECT OBJECT(q) FROM Quote q where q.symbol = ?1</ejb-ql>
             </query>
         </entity>
-        <session>
-            <display-name>KeySequenceEJB</display-name>
-            <ejb-name>KeySequenceEJB</ejb-name>
-            <local-home>org.apache.geronimo.samples.daytrader.ejb.LocalKeySequenceHome</local-home>
-            <local>org.apache.geronimo.samples.daytrader.ejb.LocalKeySequence</local>
-            <ejb-class>org.apache.geronimo.samples.daytrader.ejb.KeySequenceBean</ejb-class>
-            <session-type>Stateless</session-type>
-            <transaction-type>Container</transaction-type>
-            <ejb-local-ref>
-                <ejb-ref-name>ejb/KeyGen</ejb-ref-name>
-                <ejb-ref-type>Entity</ejb-ref-type>
-                <local-home>org.apache.geronimo.samples.daytrader.ejb.LocalKeyGenHome</local-home>
-                <local>org.apache.geronimo.samples.daytrader.ejb.LocalKeyGen</local>
-                <ejb-link>KeyGenEJB</ejb-link>
-            </ejb-local-ref>
-            <security-identity>
-                <description/>
-                <use-caller-identity/>
-            </security-identity>
-        </session>
+
+        <!-- 
+         **
+         **  K e y G e n E J B
+         ** 
+         -->
         <entity>
             <display-name>KeyGenEJB</display-name>
             <ejb-name>KeyGenEJB</ejb-name>
@@ -517,102 +659,12 @@
                     kg.keyName = ?1</ejb-ql>
             </query>
         </entity>
-        <entity>
-            <display-name>AccountEJB</display-name>
-            <ejb-name>AccountEJB</ejb-name>
-            <local-home>org.apache.geronimo.samples.daytrader.ejb.LocalAccountHome</local-home>
-            <local>org.apache.geronimo.samples.daytrader.ejb.LocalAccount</local>
-            <ejb-class>org.apache.geronimo.samples.daytrader.ejb.AccountBean</ejb-class>
-            <persistence-type>Container</persistence-type>
-            <prim-key-class>java.lang.Integer</prim-key-class>
-            <reentrant>false</reentrant>
-            <cmp-version>2.x</cmp-version>
-            <abstract-schema-name>Account</abstract-schema-name>
-            <cmp-field>
-                <field-name>creationDate</field-name>
-            </cmp-field>
-            <cmp-field>
-                <field-name>openBalance</field-name>
-            </cmp-field>
-            <cmp-field>
-                <field-name>logoutCount</field-name>
-            </cmp-field>
-            <cmp-field>
-                <field-name>balance</field-name>
-            </cmp-field>
-            <cmp-field>
-                <field-name>accountID</field-name>
-            </cmp-field>
-            <cmp-field>
-                <field-name>lastLogin</field-name>
-            </cmp-field>
-            <cmp-field>
-                <field-name>loginCount</field-name>
-            </cmp-field>
-            <primkey-field>accountID</primkey-field>
-            <ejb-local-ref>
-                <ejb-ref-name>ejb/AccountProfile</ejb-ref-name>
-                <ejb-ref-type>Entity</ejb-ref-type>
-                <local-home>org.apache.geronimo.samples.daytrader.ejb.LocalAccountProfileHome</local-home>
-                <local>org.apache.geronimo.samples.daytrader.ejb.LocalAccountProfile</local>
-                <ejb-link>AccountProfileEJB</ejb-link>
-            </ejb-local-ref>
-            <security-identity>
-                <description/>
-                <use-caller-identity/>
-            </security-identity>
-            <query>
-                <description/>
-                <query-method>
-                    <method-name>findByUserID</method-name>
-                    <method-params>
-                        <method-param>java.lang.String</method-param>
-                    </method-params>
-                </query-method>
-                <ejb-ql>SELECT OBJECT(a) FROM Account a WHERE
-                    a.profile.userID = ?1</ejb-ql>
-            </query>
-            <query>
-                <description/>
-                <query-method>
-                    <method-name>findAll</method-name>
-                    <method-params/>
-                </query-method>
-                <ejb-ql>SELECT OBJECT(a) FROM Account a</ejb-ql>
-            </query>
-            <query>
-                <query-method>
-                    <method-name>findByUserIDForUpdate</method-name>
-                    <method-params>
-                        <method-param>java.lang.String</method-param>
-                    </method-params>
-                </query-method>
-                <result-type-mapping>Local</result-type-mapping>
-                <ejb-ql>SELECT OBJECT(a) FROM Account a WHERE
-                    a.profile.userID = ?1</ejb-ql>
-            </query>
-            <query>
-                <query-method>
-                    <method-name>ejbSelectClosedOrders</method-name>
-                    <method-params>
-                        <method-param>java.lang.Integer</method-param>
-                    </method-params>
-                </query-method>
-                <ejb-ql>SELECT o.orderID FROM Orders o WHERE
-                    o.orderStatus = 'closed' AND o.account.accountID  = ?1</ejb-ql>
-            </query>
-            <query>
-                <query-method>
-                    <method-name>findByPrimaryKeyForUpdate</method-name>
-                    <method-params>
-                        <method-param>java.lang.Integer</method-param>
-                    </method-params>
-                </query-method>
-                <result-type-mapping>Local</result-type-mapping>
-                <ejb-ql>SELECT OBJECT(a) FROM Account a where
-                    a.accountID = ?1</ejb-ql>
-            </query>
-        </entity>
+
+        <!--
+          **
+          **  O r d e r E J B
+          ** 
+         -->
         <entity>
             <display-name>OrderEJB</display-name>
             <ejb-name>OrderEJB</ejb-name>
@@ -710,12 +762,50 @@
                     o.account.profile.userID  = ?1</ejb-ql>
             </query>
         </entity>
+
+    <!-- 
+     **
+     **  M e s s a g e   D r i v e n   B e a n   D e f i n i t i o n s
+     **
+     -->
+
+        <!--
+          **
+          **  T r a d e B r o k e r M D B
+          ** 
+         -->
+        <message-driven>
+            <display-name>TradeBrokerMDB</display-name>
+            <ejb-name>TradeBrokerMDB</ejb-name>
+            <ejb-class>org.apache.geronimo.samples.daytrader.ejb.TradeBrokerMDB</ejb-class>
+            <transaction-type>Container</transaction-type>
+            <message-destination-type>javax.jms.Queue</message-destination-type>
+            <message-destination-link>jms/TradeBrokerQueue</message-destination-link>
+            <env-entry>
+                <env-entry-name>statInterval</env-entry-name>
+                <env-entry-type>java.lang.Integer</env-entry-type>
+                <env-entry-value>100</env-entry-value>
+            </env-entry>
+            <ejb-ref>
+                <ejb-ref-name>ejb/Trade</ejb-ref-name>
+                <ejb-ref-type>Session</ejb-ref-type>
+                <home>org.apache.geronimo.samples.daytrader.ejb.TradeHome</home>
+                <remote>org.apache.geronimo.samples.daytrader.ejb.Trade</remote>
+                <ejb-link>TradeEJB</ejb-link>
+            </ejb-ref>
+        </message-driven>
+
+        <!--
+          **
+          **  T r a d e S t r e a m e r M D B
+          ** 
+         -->
         <message-driven>
             <ejb-name>TradeStreamerMDB</ejb-name>
             <ejb-class>org.apache.geronimo.samples.daytrader.ejb.TradeStreamerMDB</ejb-class>
             <transaction-type>Container</transaction-type>
             <message-destination-type>javax.jms.Topic</message-destination-type>
-            <message-destination-link>TradeStreamerTopic</message-destination-link>
+            <message-destination-link>jms/TradeStreamerTopic</message-destination-link>
             <env-entry>
                 <env-entry-name>statInterval</env-entry-name>
                 <env-entry-type>java.lang.Integer</env-entry-type>
@@ -723,6 +813,12 @@
             </env-entry>
         </message-driven>
     </enterprise-beans>
+    
+    <!-- 
+      **
+      **  E J B    R e l a t i o n s h i p s
+      **
+     -->
     <relationships>
         <ejb-relation>
             <ejb-relation-name>Account-Orders</ejb-relation-name>
@@ -749,6 +845,7 @@
                 </cmr-field>
             </ejb-relationship-role>
         </ejb-relation>
+
         <ejb-relation>
             <ejb-relation-name>Account-AccountProfile</ejb-relation-name>
             <ejb-relationship-role>
@@ -773,6 +870,7 @@
                 </cmr-field>
             </ejb-relationship-role>
         </ejb-relation>
+
         <ejb-relation>
             <ejb-relation-name>Account-Holdings</ejb-relation-name>
             <ejb-relationship-role>
@@ -798,6 +896,7 @@
                 </cmr-field>
             </ejb-relationship-role>
         </ejb-relation>
+
         <ejb-relation>
             <ejb-relation-name>Quote-Holdings</ejb-relation-name>
             <ejb-relationship-role>
@@ -818,6 +917,7 @@
                 </relationship-role-source>
             </ejb-relationship-role>
         </ejb-relation>
+
         <ejb-relation>
             <ejb-relation-name>Quote-Orders</ejb-relation-name>
             <ejb-relationship-role>
@@ -843,6 +943,9 @@
                 </cmr-field>
             </ejb-relationship-role>
         </ejb-relation>
+
+
+
         <ejb-relation>
             <ejb-relation-name>Order-Holding</ejb-relation-name>
             <ejb-relationship-role>
@@ -865,6 +968,13 @@
             </ejb-relationship-role>
         </ejb-relation>
     </relationships>
+
+
+    <!-- 
+     **
+     **  A s s e m b l y   D e s c r i p t o r
+     **
+     -->
     <assembly-descriptor>
         <method-permission>
             <description>UncheckedPermission:+:Unchecked method permission</description>
@@ -906,6 +1016,27 @@
                 <method-name>*</method-name>
             </method>
         </method-permission>
+
+
+        <!--
+         ** 
+         ** C o n t a i n e r   T r a n s a c t i o n s
+         **
+         **  This section contains the transactional context for various methods of the 
+         **  EJBs deployed in this application.  They are described based on their type 
+         **  which are (in order) 
+         **
+         **    RequiresNew
+         **    NotSupported
+         **    Required
+         **
+         -->
+         
+         <!--
+          **
+          **  Requires New
+          ** 
+          -->
         <container-transaction>
             <method>
                 <ejb-name>TradeEJB</ejb-name>
@@ -1014,6 +1145,12 @@
         	</method>
             <trans-attribute>RequiresNew</trans-attribute>
         </container-transaction>
+         
+         <!--
+          **
+          **  Not Supported
+          ** 
+          -->
         <container-transaction>
             <method>
                 <ejb-name>TradeEJB</ejb-name>
@@ -1089,6 +1226,12 @@
         	</method>
             <trans-attribute>NotSupported</trans-attribute>
         </container-transaction>
+         
+         <!--
+          **
+          **  Required
+          ** 
+          -->
         <container-transaction>
             <method>
                 <ejb-name>AccountEJB</ejb-name>
@@ -1140,11 +1283,19 @@
         	</method>
             <trans-attribute>Required</trans-attribute>
         </container-transaction>
+
+        <!-- 
+         **
+         **  M e s s a g e   D e s t i n a t i o n s
+         **
+         -->
         <message-destination>
-            <message-destination-name>TradeBrokerQueue</message-destination-name>
+            <message-destination-name>jms/TradeBrokerQueue</message-destination-name>
         </message-destination>
+
         <message-destination>
-            <message-destination-name>TradeStreamerTopic</message-destination-name>
+            <message-destination-name>jms/TradeStreamerTopic</message-destination-name>
         </message-destination>
+
     </assembly-descriptor>
 </ejb-jar>

Modified: geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2MDB.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2MDB.java?view=diff&rev=553607&r1=553606&r2=553607
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2MDB.java
(original)
+++ geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2MDB.java
Thu Jul  5 11:47:28 2007
@@ -23,7 +23,7 @@
     @EJB
     private LocalSLMDBTestRemote mdbTestRemote;
     
-    @Resource(name="jms/TradeBrokerQCF")
+    @Resource(name = "jms/QueueConnectionFactory")
     private QueueConnectionFactory queueConnectionFactory;
     
     static String html1 = "<html><head><title>Servlet PingServlet2Session2MDB</title><LINK
href=\"prim.css\" rel=\"stylesheet\" type=\"text/css\" /></head><body><h1>Servlet
PingSLSessionLocal</h1>";

Modified: geronimo/daytrader/trunk/modules/web/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/webapp/WEB-INF/web.xml?view=diff&rev=553607&r1=553606&r2=553607
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/webapp/WEB-INF/web.xml (original)
+++ geronimo/daytrader/trunk/modules/web/src/main/webapp/WEB-INF/web.xml Thu Jul  5 11:47:28
2007
@@ -869,6 +869,7 @@
 		<ejb-link>AccountEJB</ejb-link>
 	</ejb-local-ref>
 	<message-destination-ref>
+	    <!--  This is the JNDI name of where the resource will appear -->
 		<message-destination-ref-name>
 			jms/TradeBrokerQueue
 		</message-destination-ref-name>
@@ -876,8 +877,9 @@
 			javax.jms.Queue
 		</message-destination-type>
 		<message-destination-usage>Produces</message-destination-usage>
+		<!--  Must match the message-destination defined later  -->
 		<message-destination-link>
-			dt-ejb.jar#TradeBrokerQueue
+			dt-ejb.jar#jms/TradeBrokerQueue
 		</message-destination-link>
 	</message-destination-ref>
 	<message-destination-ref>
@@ -889,7 +891,7 @@
 		</message-destination-type>
 		<message-destination-usage>Produces</message-destination-usage>
 		<message-destination-link>
-			dt-ejb.jar#TradeStreamerTopic
+			dt-ejb.jar#jms/TradeStreamerTopic
 		</message-destination-link>
 	</message-destination-ref>
 	<service-ref>



Mime
View raw message