[jboss-cvs] JBossAS SVN: r79722 - in projects/metadata/trunk/src/main/java/org/jboss/metadata: process/processor/ejb/jboss and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Oct 20 00:00:24 EDT 2008


Author: ALRubinger
Date: 2008-10-20 00:00:24 -0400 (Mon, 20 Oct 2008)
New Revision: 79722

Modified:
   projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBoss50Creator.java
   projects/metadata/trunk/src/main/java/org/jboss/metadata/process/processor/ejb/jboss/SetDefaultLocalBusinessInterfaceProcessor.java
Log:
[JBMETA-131] Postpone a fix until dependency of JBMETA-132 is complete

Modified: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBoss50Creator.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBoss50Creator.java	2008-10-20 01:43:29 UTC (rev 79721)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBoss50Creator.java	2008-10-20 04:00:24 UTC (rev 79722)
@@ -116,7 +116,7 @@
       ProcessorChain<JBoss50MetaData> chain = new JBossMetaDataProcessorChain<JBoss50MetaData>();
 
       // Implicit local business interface (JBMETA-40, JBMETA-122, EJBTHREE-1062)
-      chain.addProcessor(new SetDefaultLocalBusinessInterfaceProcessor(this.classLoader));
+      chain.addProcessor(SetDefaultLocalBusinessInterfaceProcessor.INSTANCE);
       // Validation Processor
       chain.addProcessor(JBoss50MetaDataValidatorChainProcessor.INSTANCE);
 

Modified: projects/metadata/trunk/src/main/java/org/jboss/metadata/process/processor/ejb/jboss/SetDefaultLocalBusinessInterfaceProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/process/processor/ejb/jboss/SetDefaultLocalBusinessInterfaceProcessor.java	2008-10-20 01:43:29 UTC (rev 79721)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/process/processor/ejb/jboss/SetDefaultLocalBusinessInterfaceProcessor.java	2008-10-20 04:00:24 UTC (rev 79722)
@@ -54,32 +54,9 @@
 
    private static final Logger log = Logger.getLogger(SetDefaultLocalBusinessInterfaceProcessor.class);
 
-   // --------------------------------------------------------------------------------||
-   // Instance Members ---------------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
+   public static final SetDefaultLocalBusinessInterfaceProcessor INSTANCE = new SetDefaultLocalBusinessInterfaceProcessor();
 
-   /**
-    * The classloader to use in obtaining Classes from 
-    * specified metadata; required to check supertypes
-    */
-   private ClassLoader classLoader;
-
    // --------------------------------------------------------------------------------||
-   // Constructor --------------------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   /**
-    * Sole Constructor
-    * 
-    * @param The ClassLoader with visibility to classes specified in
-    * the metadata to be processed
-    */
-   public SetDefaultLocalBusinessInterfaceProcessor(ClassLoader classLoader)
-   {
-      this.setClassLoader(classLoader);
-   }
-
-   // --------------------------------------------------------------------------------||
    // Required Implementations -------------------------------------------------------||
    // --------------------------------------------------------------------------------||
 
@@ -107,18 +84,26 @@
          // Cast
          JBossSessionBeanMetaData smd = (JBossSessionBeanMetaData) ejb;
 
+         /*
+          * Maintainer's note:
+          * 
+          * This processing check must be executed within the TCL
+          * for the deployment it's checking.  ie. The classes 
+          * specified in the metadata must be visible to the TCL
+          */
+
          // Load the EJB Implementation Class
          String ejbImplementationClassName = smd.getEjbClass();
+         ClassLoader tcl = Thread.currentThread().getContextClassLoader();
          Class<?> ejbImplementationClass = null;
-         ClassLoader cl = this.getClassLoader();
          try
          {
-            ejbImplementationClass = Class.forName(ejbImplementationClassName, false, cl);
+            ejbImplementationClass = Class.forName(ejbImplementationClassName, false, tcl);
          }
          catch (ClassNotFoundException e)
          {
-            throw new ProcessingException(this + "Could not load EJB Implementation Class " + ejbImplementationClass
-                  + " from specified ClassLoader " + cl);
+            throw new ProcessingException(this
+                  + " must be run on metadata while the deployment's ClassLoader is the Thread Context ClassLoader");
          }
 
          // If there are already local business interfaces specified
@@ -153,18 +138,4 @@
 
    }
 
-   // --------------------------------------------------------------------------------||
-   // Accessors / Mutators -----------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   public ClassLoader getClassLoader()
-   {
-      return classLoader;
-   }
-
-   protected void setClassLoader(ClassLoader classLoader)
-   {
-      this.classLoader = classLoader;
-   }
-
 }




More information about the jboss-cvs-commits mailing list