You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ma...@apache.org on 2018/04/09 20:21:13 UTC

[archiva-redback-components-spring-utils] 26/47: not anymore needed classes

This is an automated email from the ASF dual-hosted git repository.

martin_s pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/archiva-redback-components-spring-utils.git

commit 6e9b90411e52e1202da922b2986918abed841a60
Author: Olivier Lamy <ol...@apache.org>
AuthorDate: Sat Jan 5 23:48:37 2013 +0000

    not anymore needed classes
    
    git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-components/trunk@1429429 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |   4 +-
 .../springutils/CachingByTypeBeanFactory.java      | 134 ---------------------
 .../springutils/CachingWebApplicationContext.java  |  35 ------
 3 files changed, 2 insertions(+), 171 deletions(-)

diff --git a/pom.xml b/pom.xml
index c6b9648..14aa5f9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -149,12 +149,12 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-javadoc-plugin</artifactId>
-        <configuration>
+        <configuration combine.self="append">
           <additionnalDependencies>
             <additionnalDependency>
               <groupId>javax.servlet</groupId>
               <artifactId>servlet-api</artifactId>
-              <version>2.4</version>
+              <version>2.5</version>
             </additionnalDependency>
           </additionnalDependencies>
         </configuration>
diff --git a/src/main/java/org/apache/archiva/redback/components/springutils/CachingByTypeBeanFactory.java b/src/main/java/org/apache/archiva/redback/components/springutils/CachingByTypeBeanFactory.java
deleted file mode 100755
index 7da01d9..0000000
--- a/src/main/java/org/apache/archiva/redback/components/springutils/CachingByTypeBeanFactory.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package org.apache.archiva.redback.components.springutils;
-
-/*
- * 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.
- */
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.support.DefaultListableBeanFactory;
-
-import java.util.Arrays;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * see http://jawspeak.com/2010/11/28/spring-slow-autowiring-by-type-getbeannamesfortype-fix-10x-speed-boost-3600ms-to/
- *
- * @author Olivier Lamy
- */
-public class CachingByTypeBeanFactory
-    extends DefaultListableBeanFactory
-{
-
-    private Logger log = LoggerFactory.getLogger( CachingByTypeBeanFactory.class );
-
-    ConcurrentHashMap<TypeKey, String[]> cachedBeanNamesForType = new ConcurrentHashMap<TypeKey, String[]>();
-
-    /**
-     * @see org.springframework.beans.factory.support.DefaultListableBeanFactory#getBeanNamesForType(java.lang.Class)
-     */
-    @Override
-    public String[] getBeanNamesForType( @SuppressWarnings ( "rawtypes" ) Class type )
-    {
-        return getBeanNamesForType( type, true, true );
-    }
-
-    @Override
-    public String[] getBeanNamesForType( @SuppressWarnings ( "rawtypes" ) Class type, boolean includeNonSingletons,
-                                         boolean allowEagerInit )
-    {
-        TypeKey typeKey = new TypeKey( type, includeNonSingletons, allowEagerInit );
-        if ( cachedBeanNamesForType.containsKey( typeKey ) )
-        {
-            log.debug( "will retrieve from cache: {}", typeKey );
-            return cachedBeanNamesForType.get( typeKey );
-        }
-        String[] value = super.getBeanNamesForType( type, includeNonSingletons, allowEagerInit );
-        // using this pattern as we prevent building a List
-
-        log.debug( "will add to cache: {} : {}", typeKey, Arrays.asList( value ) );
-
-        cachedBeanNamesForType.putIfAbsent( typeKey, value );
-        return value;
-    }
-
-    // This is the input parameters, which we memoize.
-    // We conservatively cache based on the possible parameters passed in. Assuming that state does not change within the
-    // super.getBeanamesForType() call between subsequent requests.
-    static class TypeKey
-    {
-        Class<?> type;
-
-        boolean includeNonSingletons;
-
-        boolean allowEagerInit;
-
-        TypeKey( Class<?> type, boolean includeNonSingletons, boolean allowEagerInit )
-        {
-            this.type = type;
-            this.includeNonSingletons = includeNonSingletons;
-            this.allowEagerInit = allowEagerInit;
-        }
-
-        @Override
-        public String toString()
-        {
-            return "TypeKey{" + type + " " + includeNonSingletons + " " + allowEagerInit + "}";
-        }
-
-        @Override
-        public boolean equals( Object o )
-        {
-            if ( this == o )
-            {
-                return true;
-            }
-            if ( o == null || getClass() != o.getClass() )
-            {
-                return false;
-            }
-
-            TypeKey typeKey = (TypeKey) o;
-
-            if ( allowEagerInit != typeKey.allowEagerInit )
-            {
-                return false;
-            }
-            if ( includeNonSingletons != typeKey.includeNonSingletons )
-            {
-                return false;
-            }
-            if ( type != null ? !type.equals( typeKey.type ) : typeKey.type != null )
-            {
-                return false;
-            }
-
-            return true;
-        }
-
-        @Override
-        public int hashCode()
-        {
-            int result = type != null ? type.hashCode() : 0;
-            result = 31 * result + ( includeNonSingletons ? 1 : 0 );
-            result = 31 * result + ( allowEagerInit ? 1 : 0 );
-            return result;
-        }
-    }
-
-}
diff --git a/src/main/java/org/apache/archiva/redback/components/springutils/CachingWebApplicationContext.java b/src/main/java/org/apache/archiva/redback/components/springutils/CachingWebApplicationContext.java
deleted file mode 100755
index eed4559..0000000
--- a/src/main/java/org/apache/archiva/redback/components/springutils/CachingWebApplicationContext.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.apache.archiva.redback.components.springutils;
-
-/*
- * 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.
- */
-import org.springframework.beans.factory.support.DefaultListableBeanFactory;
-import org.springframework.web.context.support.XmlWebApplicationContext;
-
-/**
- * @author Olivier Lamy
- */
-public class CachingWebApplicationContext
-    extends XmlWebApplicationContext
-{
-    @Override
-    protected DefaultListableBeanFactory createBeanFactory()
-    {
-        return new CachingByTypeBeanFactory();
-    }
-}

-- 
To stop receiving notification emails like this one, please contact
martin_s@apache.org.