From jbossweb-commits at lists.jboss.org Mon Sep 10 15:17:32 2007 Content-Type: multipart/mixed; boundary="===============9197534011243302541==" MIME-Version: 1.0 From: jbossweb-commits at lists.jboss.org To: jbossweb-commits at lists.jboss.org Subject: [jbossweb-commits] JBossWeb SVN: r275 - in trunk/java/org/apache: catalina/core and 1 other directory. Date: Mon, 10 Sep 2007 15:17:32 -0400 Message-ID: --===============9197534011243302541== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: remy.maucherat(a)jboss.com Date: 2007-09-10 15:17:32 -0400 (Mon, 10 Sep 2007) New Revision: 275 Added: trunk/java/org/apache/AnnotationProcessor.java Modified: trunk/java/org/apache/catalina/core/StandardContext.java Log: - For compatibility with Tomcat 6.0.x, add = AnnotationProcessor interface and facade implementation. Added: trunk/java/org/apache/AnnotationProcessor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/java/org/apache/AnnotationProcessor.java = (rev 0) +++ trunk/java/org/apache/AnnotationProcessor.java 2007-09-10 19:17:32 UTC = (rev 275) @@ -0,0 +1,38 @@ +/* + * 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; + +import java.lang.reflect.InvocationTargetException; + +import javax.naming.NamingException; + +/** + * Comment + * + * @author Bill Burke + * @version $Revision: 467222 $ + * @deprecated Replaced by InstanceManager which provides a subset of the = capabilities + */ +public interface AnnotationProcessor { + public void postConstruct(Object instance) + throws IllegalAccessException, InvocationTargetException; + public void preDestroy(Object instance) + throws IllegalAccessException, InvocationTargetException; + public void processAnnotations(Object instance) + throws IllegalAccessException, InvocationTargetException, NamingEx= ception; +} Modified: trunk/java/org/apache/catalina/core/StandardContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/java/org/apache/catalina/core/StandardContext.java 2007-09-10 14:= 50:39 UTC (rev 274) +++ trunk/java/org/apache/catalina/core/StandardContext.java 2007-09-10 19:= 17:32 UTC (rev 275) @@ -27,6 +27,7 @@ import java.io.InputStreamReader; import java.io.ObjectOutputStream; import java.io.Serializable; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashMap; import java.util.Hashtable; @@ -61,6 +62,7 @@ import javax.servlet.http.HttpSessionAttributeListener; import javax.servlet.http.HttpSessionListener; = +import org.apache.AnnotationProcessor; import org.apache.InstanceManager; import org.apache.catalina.Container; import org.apache.catalina.ContainerListener; @@ -187,6 +189,12 @@ */ private String hostName; = + = + /** + * Dummy annotation processor. + */ + private AnnotationProcessor annotationProcessor =3D new DummyAnnotatio= nProcessor(); + = = /** * The antiJARLocking flag for this Context. @@ -4321,6 +4329,7 @@ // Binding thread oldCCL =3D bindThread(); = + // Annotation processor setup if (ok ) { if (instanceManager =3D=3D null) { javax.naming.Context context =3D null; @@ -4335,6 +4344,7 @@ } else { getServletContext().setAttribute(InstanceManager.class.get= Name(), instanceManager); } + getServletContext().setAttribute(AnnotationProcessor.class.get= Name(), annotationProcessor); } = try { @@ -5684,5 +5694,33 @@ public boolean isStatisticsProvider() { return false; } + = + // ----------------------------------------------- DummyAnnotationProc= essor Inner Class + = + = + protected class DummyAnnotationProcessor implements AnnotationProcesso= r { + + @Override + public void postConstruct(Object instance) + throws IllegalAccessException, InvocationTargetException { + // Do nothing + } + + @Override + public void preDestroy(Object instance) throws IllegalAccessExcept= ion, + InvocationTargetException { + getInstanceManager().destroyInstance(instance); + } + + @Override + public void processAnnotations(Object instance) + throws IllegalAccessException, InvocationTargetException, + NamingException { + getInstanceManager().newInstance(instance); + } + = + } + = + = } --===============9197534011243302541==--