1 package org.apache.commons.ognl; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import java.util.List; 23 24 /** 25 * @deprecated evaluation-pooling now relies on the jvm garbage collection 26 */ 27 public final class EvaluationPool 28 { 29 public EvaluationPool() 30 { 31 this( 0 ); 32 } 33 34 /* 35 * @deprecated evaluation-pool now relies on the jvm garbage collection 36 * therefore providing an initialSize is unnecessary 37 */ 38 public EvaluationPool( int initialSize ) 39 { 40 super(); 41 // do not init object pooling 42 } 43 44 /** 45 * Returns an Evaluation that contains the node, source and whether it is a set operation. If there are no 46 * Evaluation objects in the pool one is created and returned. 47 */ 48 public Evaluation create( SimpleNode node, Object source ) 49 { 50 return create( node, source, false ); 51 } 52 53 /** 54 * Returns an Evaluation that contains the node, source and whether it 55 * is a set operation. 56 */ 57 public Evaluation create( SimpleNode node, Object source, boolean setOperation ) 58 { 59 // synchronization is removed as we do not rely anymore on the in-house object pooling 60 return new Evaluation( node, source, setOperation ); 61 } 62 63 /** 64 * Recycles an Evaluation 65 * 66 * @deprecated object-pooling now relies on the jvm garbage collection 67 */ 68 public void recycle( Evaluation value ) 69 { 70 // no need of recycling, we rely on the garbage collection efficiency 71 } 72 73 /** 74 * Recycles an of Evaluation and all of it's siblings 75 * and children. 76 * 77 * @deprecated object-pooling now relies on the jvm garbage collection 78 */ 79 public void recycleAll( Evaluation value ) 80 { 81 // no need of recycling, we rely on the garbage collection efficiency 82 } 83 84 /** 85 * Recycles a List of Evaluation objects 86 * 87 * @deprecated object-pooling now relies on the jvm garbage collection 88 */ 89 public void recycleAll( List value ) 90 { 91 // no need of recycling, we rely on the garbage collection efficiency 92 } 93 94 /** 95 * Returns the number of items in the pool 96 * 97 * @deprecated object-pooling now relies on the jvm garbage collection 98 */ 99 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