You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2010/03/14 23:51:45 UTC
svn commit: r922993 - in
/openwebbeans/trunk/webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat:
ContextLifecycleListener.java TomcatAnnotProcessor.java
Author: gerdogdu
Date: Sun Mar 14 22:51:45 2010
New Revision: 922993
URL: http://svn.apache.org/viewvc?rev=922993&view=rev
Log:
Update for TCK
Added:
openwebbeans/trunk/webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat/TomcatAnnotProcessor.java (with props)
Modified:
openwebbeans/trunk/webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat/ContextLifecycleListener.java
Modified: openwebbeans/trunk/webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat/ContextLifecycleListener.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat/ContextLifecycleListener.java?rev=922993&r1=922992&r2=922993&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat/ContextLifecycleListener.java (original)
+++ openwebbeans/trunk/webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat/ContextLifecycleListener.java Sun Mar 14 22:51:45 2010
@@ -17,6 +17,7 @@
*/
package org.apache.webbeans.web.tomcat;
+import org.apache.AnnotationProcessor;
import org.apache.catalina.Container;
import org.apache.catalina.ContainerEvent;
import org.apache.catalina.ContainerListener;
@@ -94,7 +95,7 @@ public class ContextLifecycleListener im
}
context.addApplicationListener(TomcatSecurityListener.class.getName());
- context.addInstanceListener(TomcatInstanceListener.class.getName());
+ //context.addInstanceListener(TomcatInstanceListener.class.getName());
}
}
}
@@ -142,6 +143,9 @@ public class ContextLifecycleListener im
if(listener.getClass().getName().equals("org.apache.webbeans.servlet.WebBeansConfigurationListener"))
{
+ AnnotationProcessor processor = context.getAnnotationProcessor();
+ context.setAnnotationProcessor(new TomcatAnnotProcessor(context.getLoader().getClassLoader(),processor));
+
ContextAccessController.setReadOnly(context.getNamingContextListener().getName());
URL url = context.getServletContext().getResource("/WEB-INF/beans.xml");
Added: openwebbeans/trunk/webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat/TomcatAnnotProcessor.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat/TomcatAnnotProcessor.java?rev=922993&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat/TomcatAnnotProcessor.java (added)
+++ openwebbeans/trunk/webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat/TomcatAnnotProcessor.java Sun Mar 14 22:51:45 2010
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.web.tomcat;
+
+import java.lang.reflect.InvocationTargetException;
+
+import javax.naming.NamingException;
+
+import org.apache.AnnotationProcessor;
+
+public class TomcatAnnotProcessor implements AnnotationProcessor
+{
+ private AnnotationProcessor processor;
+
+ private ClassLoader loader;
+
+ public TomcatAnnotProcessor(ClassLoader loader, AnnotationProcessor processor)
+ {
+ this.processor = processor;
+ this.loader = loader;
+ }
+
+ @Override
+ public void postConstruct(Object obj) throws IllegalAccessException, InvocationTargetException
+ {
+ processor.postConstruct(obj);
+ }
+
+ @Override
+ public void preDestroy(Object obj) throws IllegalAccessException, InvocationTargetException
+ {
+ processor.preDestroy(obj);
+ }
+
+ @Override
+ public void processAnnotations(Object obj) throws IllegalAccessException, InvocationTargetException, NamingException
+ {
+ processor.processAnnotations(obj);
+ try
+ {
+ TomcatUtil.inject(obj, loader);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+}
Propchange: openwebbeans/trunk/webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat/TomcatAnnotProcessor.java
------------------------------------------------------------------------------
svn:eol-style = native