Java tutorial
/** * EventArrayPoolableObjectFactory.java * * Cytobank (TM) is server and client software for web-based management, analysis, * and sharing of flow cytometry data. * * Copyright (C) 2009 Cytobank, Inc. All rights reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Cytobank, Inc. * 659 Oak Grove Avenue #205 * Menlo Park, CA 94025 * * http://www.cytobank.org */ package org.cytobank.fcs_files.events; import org.apache.commons.pool.PoolableObjectFactory; public class EventArrayPoolableObjectFactory implements PoolableObjectFactory<Object> { protected int eventArraySize; public EventArrayPoolableObjectFactory(int eventArraySize) { this.eventArraySize = eventArraySize; } @Override public void activateObject(Object arg0) throws Exception { } @Override public void destroyObject(Object arg0) throws Exception { // TODO Auto-generated method stub } @Override public Object makeObject() throws Exception { return new double[eventArraySize]; } @Override public void passivateObject(Object arg0) throws Exception { } @Override public boolean validateObject(Object arg0) { return arg0 != null; } }