001 package org.apache.commons.ognl; 002 003 /* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022 import java.util.List; 023 024 /** 025 * @deprecated evaluation-pooling now relies on the jvm garbage collection 026 */ 027 public final class EvaluationPool 028 { 029 public EvaluationPool() 030 { 031 this( 0 ); 032 } 033 034 /* 035 * @deprecated evaluation-pool now relies on the jvm garbage collection 036 * therefore providing an initialSize is unnecessary 037 */ 038 public EvaluationPool( int initialSize ) 039 { 040 super(); 041 // do not init object pooling 042 } 043 044 /** 045 * Returns an Evaluation that contains the node, source and whether it is a set operation. If there are no 046 * Evaluation objects in the pool one is created and returned. 047 */ 048 public Evaluation create( SimpleNode node, Object source ) 049 { 050 return create( node, source, false ); 051 } 052 053 /** 054 * Returns an Evaluation that contains the node, source and whether it 055 * is a set operation. 056 */ 057 public Evaluation create( SimpleNode node, Object source, boolean setOperation ) 058 { 059 // synchronization is removed as we do not rely anymore on the in-house object pooling 060 return new Evaluation( node, source, setOperation ); 061 } 062 063 /** 064 * Recycles an Evaluation 065 * 066 * @deprecated object-pooling now relies on the jvm garbage collection 067 */ 068 public void recycle( Evaluation value ) 069 { 070 // no need of recycling, we rely on the garbage collection efficiency 071 } 072 073 /** 074 * Recycles an of Evaluation and all of it's siblings 075 * and children. 076 * 077 * @deprecated object-pooling now relies on the jvm garbage collection 078 */ 079 public void recycleAll( Evaluation value ) 080 { 081 // no need of recycling, we rely on the garbage collection efficiency 082 } 083 084 /** 085 * Recycles a List of Evaluation objects 086 * 087 * @deprecated object-pooling now relies on the jvm garbage collection 088 */ 089 public void recycleAll( List value ) 090 { 091 // no need of recycling, we rely on the garbage collection efficiency 092 } 093 094 /** 095 * Returns the number of items in the pool 096 * 097 * @deprecated object-pooling now relies on the jvm garbage collection 098 */ 099 public int getSize() 100 { 101 return 0; 102 } 103 104 /** 105 * Returns the number of items this pool has created since 106 * it's construction. 107 * 108 * @deprecated object-pooling now relies on the jvm garbage collection 109 */ 110 public int getCreatedCount() 111 { 112 return 0; 113 } 114 115 /** 116 * Returns the number of items this pool has recovered from 117 * the pool since its construction. 118 * 119 * @deprecated object-pooling now relies on the jvm garbage collection 120 */ 121 public int getRecoveredCount() 122 { 123 return 0; 124 } 125 126 /** 127 * Returns the number of items this pool has recycled since 128 * it's construction. 129 * 130 * @deprecated object-pooling now relies on the jvm garbage collection 131 */ 132 public int getRecycledCount() 133 { 134 return 0; 135 } 136 } 137