[webbeans-commits] Webbeans SVN: r2333 - in extensions/trunk/tomcat: build and 4 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Tue Apr 7 12:40:59 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-04-07 12:40:59 -0400 (Tue, 07 Apr 2009)
New Revision: 2333

Removed:
   extensions/trunk/tomcat/build/.classpath
   extensions/trunk/tomcat/build/.project
   extensions/trunk/tomcat/build/.settings/
   extensions/trunk/tomcat/support/src/main/java/org/jboss/webbeans/environment/servlet/
Modified:
   extensions/trunk/tomcat/build/
   extensions/trunk/tomcat/int/pom.xml
   extensions/trunk/tomcat/pom.xml
   extensions/trunk/tomcat/support/pom.xml
   extensions/trunk/tomcat/support/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java
Log:
WBX-14


Property changes on: extensions/trunk/tomcat/build
___________________________________________________________________
Name: svn:ignore
   + 
target
.classpath
.settings
.project


Deleted: extensions/trunk/tomcat/build/.classpath
===================================================================
--- extensions/trunk/tomcat/build/.classpath	2009-04-07 16:36:21 UTC (rev 2332)
+++ extensions/trunk/tomcat/build/.classpath	2009-04-07 16:40:59 UTC (rev 2333)
@@ -1,37 +0,0 @@
-<classpath>
-  <classpathentry kind="output" path="target/classes"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-  <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/annotations-api/6.0.18/annotations-api-6.0.18.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/catalina/6.0.18/catalina-6.0.18.jar"/>
-  <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.8.1.GA/javassist-3.8.1.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.8.1.GA/javassist-3.8.1.GA-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/webbeans/jsr299-api/1.0.0-SNAPSHOT/jsr299-api-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/webbeans/jsr299-api/1.0.0-SNAPSHOT/jsr299-api-1.0.0-SNAPSHOT-sources.jar">
-    <attributes>
-      <attribute value="jar:file:/Users/pmuir/.m2/repository/org/jboss/webbeans/jsr299-api/1.0.0-SNAPSHOT/jsr299-api-1.0.0-SNAPSHOT-javadoc.jar!/" name="javadoc_location"/>
-    </attributes>
-  </classpathentry>
-  <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/juli/6.0.18/juli-6.0.18.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/servlet-api/6.0.18/servlet-api-6.0.18.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/webbeans/webbeans-api/1.0.0-SNAPSHOT/webbeans-api-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/webbeans/webbeans-api/1.0.0-SNAPSHOT/webbeans-api-1.0.0-SNAPSHOT-sources.jar">
-    <attributes>
-      <attribute value="jar:file:/Users/pmuir/.m2/repository/org/jboss/webbeans/webbeans-api/1.0.0-SNAPSHOT/webbeans-api-1.0.0-SNAPSHOT-javadoc.jar!/" name="javadoc_location"/>
-    </attributes>
-  </classpathentry>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/webbeans/webbeans-core/1.0.0-SNAPSHOT/webbeans-core-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/webbeans/webbeans-core/1.0.0-SNAPSHOT/webbeans-core-1.0.0-SNAPSHOT-sources.jar">
-    <attributes>
-      <attribute value="jar:file:/Users/pmuir/.m2/repository/org/jboss/webbeans/webbeans-core/1.0.0-SNAPSHOT/webbeans-core-1.0.0-SNAPSHOT-javadoc.jar!/" name="javadoc_location"/>
-    </attributes>
-  </classpathentry>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/webbeans/webbeans-logging/1.0.0-SNAPSHOT/webbeans-logging-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/webbeans/webbeans-logging/1.0.0-SNAPSHOT/webbeans-logging-1.0.0-SNAPSHOT-sources.jar">
-    <attributes>
-      <attribute value="jar:file:/Users/pmuir/.m2/repository/org/jboss/webbeans/webbeans-logging/1.0.0-SNAPSHOT/webbeans-logging-1.0.0-SNAPSHOT-javadoc.jar!/" name="javadoc_location"/>
-    </attributes>
-  </classpathentry>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/webbeans/webbeans-spi/1.0.0-SNAPSHOT/webbeans-spi-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/webbeans/webbeans-spi/1.0.0-SNAPSHOT/webbeans-spi-1.0.0-SNAPSHOT-sources.jar">
-    <attributes>
-      <attribute value="jar:file:/Users/pmuir/.m2/repository/org/jboss/webbeans/webbeans-spi/1.0.0-SNAPSHOT/webbeans-spi-1.0.0-SNAPSHOT-javadoc.jar!/" name="javadoc_location"/>
-    </attributes>
-  </classpathentry>
-  <classpathentry kind="src" path="/webbeans-tomcat-int"/>
-  <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/>
-</classpath>
\ No newline at end of file

Deleted: extensions/trunk/tomcat/build/.project
===================================================================
--- extensions/trunk/tomcat/build/.project	2009-04-07 16:36:21 UTC (rev 2332)
+++ extensions/trunk/tomcat/build/.project	2009-04-07 16:40:59 UTC (rev 2333)
@@ -1,15 +0,0 @@
-<projectDescription>
-  <name>webbeans-tomcat</name>
-  <comment>Support for Web Beans on Tomcat</comment>
-  <projects>
-    <project>webbeans-tomcat-int</project>
-  </projects>
-  <buildSpec>
-    <buildCommand>
-      <name>org.eclipse.jdt.core.javabuilder</name>
-    </buildCommand>
-  </buildSpec>
-  <natures>
-    <nature>org.eclipse.jdt.core.javanature</nature>
-  </natures>
-</projectDescription>
\ No newline at end of file

Modified: extensions/trunk/tomcat/int/pom.xml
===================================================================
--- extensions/trunk/tomcat/int/pom.xml	2009-04-07 16:36:21 UTC (rev 2332)
+++ extensions/trunk/tomcat/int/pom.xml	2009-04-07 16:40:59 UTC (rev 2333)
@@ -48,6 +48,13 @@
          <artifactId>catalina</artifactId>
          <version>6.0.18</version>
          <scope>provided</scope>
+         <optional>true</optional>
+         <exclusions>
+            <exclusion>
+               <groupId>org.apache.tomcat</groupId>
+               <artifactId>servlet-api</artifactId>
+            </exclusion>
+         </exclusions>
       </dependency>
    
    </dependencies>

Modified: extensions/trunk/tomcat/pom.xml
===================================================================
--- extensions/trunk/tomcat/pom.xml	2009-04-07 16:36:21 UTC (rev 2332)
+++ extensions/trunk/tomcat/pom.xml	2009-04-07 16:40:59 UTC (rev 2333)
@@ -16,6 +16,7 @@
    
    <modules>
       <module>int</module>
+      <module>support</module>
       <module>build</module>
    </modules>
 

Modified: extensions/trunk/tomcat/support/pom.xml
===================================================================
--- extensions/trunk/tomcat/support/pom.xml	2009-04-07 16:36:21 UTC (rev 2332)
+++ extensions/trunk/tomcat/support/pom.xml	2009-04-07 16:40:59 UTC (rev 2333)
@@ -7,7 +7,7 @@
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.jboss.webbeans.tomcat</groupId>
-   <artifactId>webbeans-tomcat-extras</artifactId>
+   <artifactId>webbeans-tomcat-support</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <name>Web Beans Tomcat Integration</name>
@@ -28,27 +28,22 @@
       </dependency>
    
       <dependency>
-         <groupId>org.jboss.webbeans</groupId>
-         <artifactId>webbeans-spi</artifactId>
-      </dependency>
-   
-      <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
          <scope>provided</scope>
       </dependency>
-      
-      <dependency>
-         <groupId>org.jboss.webbeans</groupId>
-         <artifactId>webbeans-logging</artifactId>
-      </dependency>
   
-           <dependency>
-      <groupId>org.apache.tomcat</groupId>
-      <artifactId>catalina</artifactId>
-      <version>6.0.18</version>
-    </dependency>
-      
+      <dependency>
+         <groupId>org.apache.tomcat</groupId>
+         <artifactId>catalina</artifactId>
+         <scope>provided</scope>
+         <exclusions>
+            <exclusion>
+               <groupId>org.apache.tomcat</groupId>
+               <artifactId>servlet-api</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>    
    
    </dependencies>
 

Modified: extensions/trunk/tomcat/support/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java
===================================================================
--- extensions/trunk/tomcat/support/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java	2009-04-07 16:36:21 UTC (rev 2332)
+++ extensions/trunk/tomcat/support/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java	2009-04-07 16:40:59 UTC (rev 2333)
@@ -13,32 +13,71 @@
 public class WebBeansLifecycleListener implements LifecycleListener
 {
    
+   private static final AnnotationProcessor DUMMY_PROCESSOR = new AnnotationProcessor()
+   {
+
+      public void postConstruct(Object arg0) throws IllegalAccessException, InvocationTargetException {}
+
+      public void preDestroy(Object arg0) throws IllegalAccessException, InvocationTargetException {}
+
+      public void processAnnotations(Object arg0) throws IllegalAccessException, InvocationTargetException, NamingException {}
+      
+   };
+   
    public void lifecycleEvent(LifecycleEvent event)
    {
       if (event.getType().equals("after_start") && event.getLifecycle() instanceof StandardContext)
       {
          StandardContext context = (StandardContext) event.getLifecycle();
          final ServletContext servletContext = context.getServletContext();
-         final AnnotationProcessor annotationProcessor = context.getAnnotationProcessor();
+         final AnnotationProcessor originalAnnotationProcessor = context.getAnnotationProcessor();
          context.setAnnotationProcessor(new ForwardingAnnotationProcessor()
          {
+            
+            private AnnotationProcessor processor;
 
             @Override
             protected AnnotationProcessor delegate()
             {
-               return annotationProcessor;
+               return originalAnnotationProcessor;
             }
             
             @Override
             public void processAnnotations(Object instance) throws IllegalAccessException, InvocationTargetException, NamingException
             {
                super.processAnnotations(instance);
-               Object o = servletContext.getAttribute("org.jboss.webbeans.environment.tomcat.WebBeansAnnotationProcessor");
-               if (o != null)
+               getProcessor().processAnnotations(instance);
+            }
+            
+            @Override
+            public void postConstruct(Object instance) throws IllegalAccessException, InvocationTargetException
+            {
+               super.postConstruct(instance);
+               getProcessor().postConstruct(instance);
+            }
+            
+            @Override
+            public void preDestroy(Object instance) throws IllegalAccessException, InvocationTargetException
+            {
+               super.preDestroy(instance);
+               getProcessor().preDestroy(instance);
+            }
+            
+            private AnnotationProcessor getProcessor()
+            {
+               if (processor == null)
                {
-                  AnnotationProcessor processor = (AnnotationProcessor) o;
-                  processor.processAnnotations(instance);
+                  Object o = servletContext.getAttribute("org.jboss.webbeans.environment.tomcat.WebBeansAnnotationProcessor");
+                  if (o instanceof AnnotationProcessor)
+                  {
+                     processor = (AnnotationProcessor) o;
+                  }
+                  else
+                  {
+                     return DUMMY_PROCESSOR;
+                  }
                }
+               return processor;
             }
             
          });




More information about the weld-commits mailing list