Update of 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-ejb/src/main/java/org/xdoclet/plugin/ejb/entity
In directory 
sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30382/plugin-ejb/src/main/java/org/xdoclet/plugin/ejb/entity

Modified Files:
        ValueObjectPlugin.java 
Log Message:
Lazy load beanResolver & relationManager to ensure all TagLibraries are 
registered beforehand

Index: ValueObjectPlugin.java
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-ejb/src/main/java/org/xdoclet/plugin/ejb/entity/ValueObjectPlugin.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ValueObjectPlugin.java      12 Jun 2006 06:52:18 -0000      1.4
--- ValueObjectPlugin.java      12 Jun 2006 13:47:25 -0000      1.5
***************
*** 88,96 ****
       * Resolver of beans by name
       */
!     private final EjbBeanResolver beanResolver;
      /**
       * Relation manager
       */
!     private final RelationManager relationManager;
  
      /** Cache for value object resolver */
--- 88,97 ----
       * Resolver of beans by name
       */
!     private EjbBeanResolver beanResolver;
! 
      /**
       * Relation manager
       */
!     private RelationManager relationManager;
  
      /** Cache for value object resolver */
***************
*** 116,121 ****
          setFilereplace("ValueObject");
          super.setMultioutput(true);
-         beanResolver = ejbUtils.createEjbBeanResolver(getOriginalMetadata());
-         relationManager = 
ejbUtils.createRelationManager(getOriginalMetadata());
  
          //try {
--- 117,120 ----
***************
*** 1092,1096 ****
                              // it's treatment as such, or should be ignored
                              // Maybe just check if is a 
EjbUtils.METADATA_METHOD_RELATION_FIELD
!                             Relation relation = 
relationManager.getRelationFor(method, javaClass);
  
                              if ((relation != null) ||
--- 1091,1095 ----
                              // it's treatment as such, or should be ignored
                              // Maybe just check if is a 
EjbUtils.METADATA_METHOD_RELATION_FIELD
!                             Relation relation = 
getRelationManager().getRelationFor(method, javaClass);
  
                              if ((relation != null) ||
***************
*** 1124,1128 ****
  
                                          String relationEjbName = 
relation.getRightEJBName();
!                                         relationEjb = 
beanResolver.findEjbByName(relationEjbName);
                                          collectionType = 
relation.getLeftMethod().getReturns();
                                      } else {
--- 1123,1127 ----
  
                                          String relationEjbName = 
relation.getRightEJBName();
!                                         relationEjb = 
getBeanResolver().findEjbByName(relationEjbName);
                                          collectionType = 
relation.getLeftMethod().getReturns();
                                      } else {
***************
*** 1510,1512 ****
--- 1509,1534 ----
          }
      }
+ 
+     /**
+      * Returns the beanResolver, lazily loaded to allow all plugins to 
register
+      * their tags before the beanResolver is created for the first time.
+      */
+     public final EjbBeanResolver getBeanResolver() {
+         if (beanResolver == null) {
+             beanResolver = 
ejbUtils.createEjbBeanResolver(getOriginalMetadata());
+         }
+         return beanResolver;
+     }
+ 
+     /**
+      * Returns the relationManager, lazily loaded to allow all plugins to 
register
+      * their tags before the relationManager is created for the first time.
+      */
+     public final RelationManager getRelationManager() {
+         if (relationManager == null) {
+             relationManager = 
ejbUtils.createRelationManager(getOriginalMetadata());
+         }
+         return relationManager;
+     }
+ 
  }



_______________________________________________
xdoclet-plugins-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-commits

Reply via email to