Update of /cvsroot/xdoclet/xdoclet/modules/jboss/src/xdoclet/modules/jboss/ejb
In directory sc8-pr-cvs1:/tmp/cvs-serv12648/src/xdoclet/modules/jboss/ejb

Modified Files:
        JBossRelationTagsHandler.java 
Log Message:
- added ability to specify <read-ahead> elements within the <ejb-relationship-role> 
element of an <ejb-relation>
- two new tags: @jboss.relation-read-ahead and @jboss.target-relation-read-ahead
  - similar to how @jboss.relation and @jboss.target-relation work
  - @jboss.relation-read-ahead specifies the read-ahead for the source and 
@jboss.target-relation-read-ahead specifies the blind side read-ahead


Index: JBossRelationTagsHandler.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/modules/jboss/src/xdoclet/modules/jboss/ejb/JBossRelationTagsHandler.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** JBossRelationTagsHandler.java       23 Aug 2002 14:15:07 -0000      1.7
--- JBossRelationTagsHandler.java       13 Dec 2002 20:56:39 -0000      1.8
***************
*** 74,77 ****
--- 74,119 ----
      }
  
+     public void ifLeftHasReadAhead(String template) throws XDocletException
+     {
+         if (readAheadStrategy(true) != null) {
+             generate(template);
+         }
+     }
+ 
+     public void ifRightHasReadAhead(String template) throws XDocletException
+     {
+         if (readAheadStrategy(false) != null) {
+             generate(template);
+         }
+     }
+ 
+     public void ifLeftHasReadAheadPageSize(String template) throws XDocletException
+     {
+         if (readAheadPageSize(true) != null) {
+             generate(template);
+         }
+     }
+ 
+     public void ifRightHasReadAheadPageSize(String template) throws XDocletException
+     {
+         if (readAheadPageSize(false) != null) {
+             generate(template);
+         }
+     }
+ 
+     public void ifLeftHasReadAheadEagerLoadGroup(String template) throws 
+XDocletException
+     {
+         if (readAheadEagerLoadGroup(true) != null) {
+             generate(template);
+         }
+     }
+ 
+     public void ifRightHasReadAheadEagerLoadGroup(String template) throws 
+XDocletException
+     {
+         if (readAheadEagerLoadGroup(false) != null) {
+             generate(template);
+         }
+     }
+ 
      /**
       * Describe what the method does
***************
*** 164,167 ****
--- 206,239 ----
      }
  
+     public String leftReadAheadStrategy() throws XDocletException
+     {
+         return readAheadStrategy(true);
+     }
+ 
+     public String rightReadAheadStrategy() throws XDocletException
+     {
+         return readAheadStrategy(false);
+     }
+ 
+     public String leftReadAheadPageSize() throws XDocletException
+     {
+         return readAheadPageSize(true);
+     }
+ 
+     public String rightReadAheadPageSize() throws XDocletException
+     {
+         return readAheadPageSize(false);
+     }
+ 
+     public String leftReadAheadEagerLoadGroup() throws XDocletException
+     {
+         return readAheadEagerLoadGroup(true);
+     }
+ 
+     public String rightReadAheadEagerLoadGroup() throws XDocletException
+     {
+         return readAheadEagerLoadGroup(false);
+     }
+ 
      public void ifIsRelationTableMapping(String template) throws XDocletException
      {
***************
*** 246,249 ****
--- 318,381 ----
          else
              return methodB.getDoc().getTagAttributeValue("jboss.target-relation", 
"fk-constraint");
+     }
+ 
+     private String readAheadStrategy(boolean left)
+     {
+         XMethod methodA = null;
+         XMethod methodB = null;
+ 
+         if (left) {
+             methodA = currentRelation.getLeftMethod();
+             methodB = currentRelation.getRightMethod();
+         }
+         else {
+             methodA = currentRelation.getRightMethod();
+             methodB = currentRelation.getLeftMethod();
+         }
+ 
+         if (methodA != null)
+             return 
+methodA.getDoc().getTagAttributeValue("jboss.relation-read-ahead", "strategy");
+         else
+             return 
+methodB.getDoc().getTagAttributeValue("jboss.target-relation-read-ahead", "strategy");
+     }
+ 
+     private String readAheadPageSize(boolean left)
+     {
+         XMethod methodA = null;
+         XMethod methodB = null;
+ 
+         if (left) {
+             methodA = currentRelation.getLeftMethod();
+             methodB = currentRelation.getRightMethod();
+         }
+         else {
+             methodA = currentRelation.getRightMethod();
+             methodB = currentRelation.getLeftMethod();
+         }
+ 
+         if (methodA != null)
+             return 
+methodA.getDoc().getTagAttributeValue("jboss.relation-read-ahead", "page-size");
+         else
+             return 
+methodB.getDoc().getTagAttributeValue("jboss.target-relation-read-ahead", 
+"page-size");
+     }
+ 
+     private String readAheadEagerLoadGroup(boolean left)
+     {
+         XMethod methodA = null;
+         XMethod methodB = null;
+ 
+         if (left) {
+             methodA = currentRelation.getLeftMethod();
+             methodB = currentRelation.getRightMethod();
+         }
+         else {
+             methodA = currentRelation.getRightMethod();
+             methodB = currentRelation.getLeftMethod();
+         }
+ 
+         if (methodA != null)
+             return 
+methodA.getDoc().getTagAttributeValue("jboss.relation-read-ahead", 
+"eager-load-group");
+         else
+             return 
+methodB.getDoc().getTagAttributeValue("jboss.target-relation-read-ahead", 
+"eager-load-group");
      }
  



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to