From: markt Date: Sat, 22 Nov 2008 11:19:43 +0000 (+0000) Subject: Remove deprecated code. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3130be60fed410fb65de0b8cd32bdac9521574c8;p=tomcat7.0 Remove deprecated code. Some code made private rather than removed based on code comments. Calls to deprecated methods changed to use appropriate replacements. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@719835 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/digester/RulesBase.java b/java/org/apache/tomcat/util/digester/RulesBase.java index dd2375757..b9c4471a8 100644 --- a/java/org/apache/tomcat/util/digester/RulesBase.java +++ b/java/org/apache/tomcat/util/digester/RulesBase.java @@ -188,24 +188,6 @@ public class RulesBase implements Rules { * in the order originally registered through the add() * method. * - * @param pattern Nesting pattern to be matched - * - * @deprecated Call match(namespaceURI,pattern) instead. - */ - public List match(String pattern) { - - return (match(null, pattern)); - - } - - - /** - * Return a List of all registered Rule instances that match the specified - * nesting pattern, or a zero-length List if there are no matches. If more - * than one Rule instance matches, they must be returned - * in the order originally registered through the add() - * method. - * * @param namespaceURI Namespace URI for which to select matching rules, * or null to match regardless of namespace URI * @param pattern Nesting pattern to be matched diff --git a/java/org/apache/tomcat/util/http/ServerCookie.java b/java/org/apache/tomcat/util/http/ServerCookie.java index 6309561d7..e3a1595e3 100644 --- a/java/org/apache/tomcat/util/http/ServerCookie.java +++ b/java/org/apache/tomcat/util/http/ServerCookie.java @@ -211,26 +211,6 @@ public class ServerCookie implements Serializable { return true; } - /** - * @deprecated - Not used - */ - public static boolean checkName( String name ) { - if (!isToken(name) - || name.equalsIgnoreCase("Comment") // rfc2019 - || name.equalsIgnoreCase("Discard") // rfc2965 - || name.equalsIgnoreCase("Domain") // rfc2019 - || name.equalsIgnoreCase("Expires") // Netscape - || name.equalsIgnoreCase("Max-Age") // rfc2019 - || name.equalsIgnoreCase("Path") // rfc2019 - || name.equalsIgnoreCase("Secure") // rfc2019 - || name.equalsIgnoreCase("Version") // rfc2019 - // TODO remaining RFC2965 attributes - ) { - return false; - } - return true; - } - // -------------------- Cookie parsing tools @@ -344,21 +324,6 @@ public class ServerCookie implements Serializable { headerBuf.append(buf); } - /** - * @deprecated - Not used - */ - @Deprecated - public static void maybeQuote (int version, StringBuffer buf,String value) { - // special case - a \n or \r shouldn't happen in any case - if (isToken(value)) { - buf.append(value); - } else { - buf.append('"'); - buf.append(escapeDoubleQuotes(value,0,value.length())); - buf.append('"'); - } - } - public static boolean alreadyQuoted (String value) { if (value==null || value.length()==0) return false; return (value.charAt(0)=='\"' && value.charAt(value.length()-1)=='\"'); diff --git a/java/org/apache/tomcat/util/modeler/BaseNotificationBroadcaster.java b/java/org/apache/tomcat/util/modeler/BaseNotificationBroadcaster.java index 860e630c1..2cf3ad20e 100644 --- a/java/org/apache/tomcat/util/modeler/BaseNotificationBroadcaster.java +++ b/java/org/apache/tomcat/util/modeler/BaseNotificationBroadcaster.java @@ -224,7 +224,7 @@ public class BaseNotificationBroadcaster implements NotificationBroadcaster { private synchronized void registerNotifications( FixedNotificationFilter filter ) { String names[]=filter.getNames(); - Registry reg=Registry.getRegistry(); + Registry reg=Registry.getRegistry(null, null); for( int i=0; iMBeanServer instance. - * - * @since 1.0 - * @deprecated Use the instance method - */ - public static MBeanServer getServer() { - return Registry.getRegistry().getMBeanServer(); - } - - /** - * Set the MBeanServer to be utilized for our - * registered management beans. - * - * @param mbeanServer The new MBeanServer instance - * @since 1.0 - * @deprecated Use the instance method - */ - public static void setServer(MBeanServer mbeanServer) { - Registry.getRegistry().setMBeanServer(mbeanServer); - } - - /** - * Load the registry from the XML input found in the specified input - * stream. - * - * @param stream InputStream containing the registry configuration - * information - * - * @exception Exception if any parsing or processing error occurs - * @deprecated use normal class method instead - * @since 1.0 - */ - public static void loadRegistry(InputStream stream) throws Exception { - Registry registry = getRegistry(); - registry.loadMetadata(stream); - } - - /** Get a "singelton" registry, or one per thread if setUseContextLoader - * was called - * - * @deprecated Not enough info - use the method that takes CL and domain - * @since 1.0 - */ - public synchronized static Registry getRegistry() { - return getRegistry(null, null); - } - // -------------------- Helpers -------------------- /** Get the type of an attribute of the object, from the metadata. @@ -846,16 +795,15 @@ public class Registry implements RegistryMBean, MBeanRegistration { return; } - /**Experimental. Will become private, some code may still use it - * + /** * @param sourceType * @param source * @param param * @throws Exception - * @deprecated + */ - public void loadDescriptors(String sourceType, Object source, String param) - throws Exception { + private void loadDescriptors(String sourceType, Object source, + String param) throws Exception { load(sourceType, source, param); } @@ -974,21 +922,6 @@ public class Registry implements RegistryMBean, MBeanRegistration { loadDescriptors("MbeansDescriptorsDigesterSource", source, null ); } - /** @deprecated - may still be used in code using pre-1.1 builds - */ - public void registerComponent(Object bean, String domain, String type, - String name) - throws Exception - { - StringBuffer sb=new StringBuffer(); - sb.append( domain ).append(":"); - sb.append( name ); - String nameStr=sb.toString(); - ObjectName oname=new ObjectName( nameStr ); - registerComponent(bean, oname, type ); - } - - // should be removed public void unregisterComponent( String domain, String name ) { @@ -1002,19 +935,4 @@ public class Registry implements RegistryMBean, MBeanRegistration { } } - - /** - * Load the registry from a cached .ser file. This is typically 2-3 times - * faster than parsing the XML. - * - * @param source Source to be used to load. Can be an InputStream or URL. - * - * @exception Exception if any parsing or processing error occurs - * @deprecated Loaded automatically or using a File or Url ending in .ser - */ - public void loadCachedDescriptors( Object source ) - throws Exception - { - loadDescriptors("MbeansDescriptorsSerSource", source, null ); - } } diff --git a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDOMSource.java b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDOMSource.java index f108d9f30..6429e76ae 100644 --- a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDOMSource.java +++ b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDOMSource.java @@ -80,7 +80,7 @@ public class MbeansDescriptorsDOMSource extends ModelerSource } public void execute() throws Exception { - if( registry==null ) registry=Registry.getRegistry(); + if( registry==null ) registry=Registry.getRegistry(null, null); try { InputStream stream=(InputStream)source; diff --git a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java index 94ed10fbe..b1813ca05 100644 --- a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java +++ b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java @@ -77,7 +77,7 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource } public void execute() throws Exception { - if( registry==null ) registry=Registry.getRegistry(); + if( registry==null ) registry=Registry.getRegistry(null, null); try { ManagedBean managed = createManagedBean(registry, null, (Class)source, type); diff --git a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java index 53a302f31..10a73f834 100644 --- a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java +++ b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java @@ -70,7 +70,7 @@ public class MbeansDescriptorsSerSource extends ModelerSource } public void execute() throws Exception { - if( registry==null ) registry=Registry.getRegistry(); + if( registry==null ) registry=Registry.getRegistry(null, null); long t1=System.currentTimeMillis(); try { InputStream stream=null; diff --git a/java/org/apache/tomcat/util/modeler/modules/MbeansSource.java b/java/org/apache/tomcat/util/modeler/modules/MbeansSource.java index 7362006b1..c95e52dd5 100644 --- a/java/org/apache/tomcat/util/modeler/modules/MbeansSource.java +++ b/java/org/apache/tomcat/util/modeler/modules/MbeansSource.java @@ -123,7 +123,7 @@ public class MbeansSource extends ModelerSource implements MbeansSourceMBean public void init() throws Exception { if( mbeans==null) execute(); - if( registry==null ) registry=Registry.getRegistry(); + if( registry==null ) registry=Registry.getRegistry(null, null); registry.invoke(mbeans, "init", false); } @@ -137,7 +137,7 @@ public class MbeansSource extends ModelerSource implements MbeansSourceMBean } public void execute() throws Exception { - if( registry==null ) registry=Registry.getRegistry(); + if( registry==null ) registry=Registry.getRegistry(null, null); try { InputStream stream=getInputStream(); long t1=System.currentTimeMillis(); @@ -160,7 +160,8 @@ public class MbeansSource extends ModelerSource implements MbeansSourceMBean firstMbeanN=descriptorsN; } - MBeanServer server = Registry.getServer(); + MBeanServer server = + Registry.getRegistry(null, null).getMBeanServer(); // XXX Not very clean... Just a workaround if( ! loaderLoaded ) { diff --git a/java/org/apache/tomcat/util/net/TcpConnectionHandler.java b/java/org/apache/tomcat/util/net/TcpConnectionHandler.java index b9096d4ca..686d55f0d 100644 --- a/java/org/apache/tomcat/util/net/TcpConnectionHandler.java +++ b/java/org/apache/tomcat/util/net/TcpConnectionHandler.java @@ -28,22 +28,6 @@ package org.apache.tomcat.util.net; */ public interface TcpConnectionHandler { - /** Add informations about the a "controler" object - * specific to the server. In tomcat it will be a - * ContextManager. - * @deprecated This has nothing to do with TcpHandling, - * was used as a workaround - */ - public void setServer(Object manager); - - - /** Used to pass config informations to the handler. - * - * @deprecated This has nothing to do with Tcp, - * was used as a workaround. - */ - public void setAttribute(String name, Object value ); - /** Called before the call to processConnection. * If the thread is reused, init() should be called once per thread. * diff --git a/java/org/apache/tomcat/util/threads/ThreadPool.java b/java/org/apache/tomcat/util/threads/ThreadPool.java index 899005fa1..e11810c69 100644 --- a/java/org/apache/tomcat/util/threads/ThreadPool.java +++ b/java/org/apache/tomcat/util/threads/ThreadPool.java @@ -525,12 +525,6 @@ public class ThreadPool { currentThreadCount = toOpen; } - /** @deprecated */ - void log( String s ) { - log.info(s); - //loghelper.flush(); - } - /** * Periodically execute an action - cleanup in this case */