* 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
* 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.
makeObjectis called whenever a new instance is needed.
activateObjectis invoked on every instance that has been
passivatedbefore it is
borrowedfrom the pool.
validateObjectis invoked on
activatedinstances to make sure they can be
borrowedfrom the pool.
validateObjectmay also be used to test an instance being
returnedto the pool before it is
passivated. It will only be invoked on an activated instance.
passivateObjectis invoked on every instance when it is returned to the pool.
destroyObjectis invoked on every instance when it is being "dropped" from the pool (whether due to the response from
validateObject, or for reasons specific to the pool implementation.) There is no guarantee that the instance being destroyed will be considered active, passive or in a generally consistent state.
must be thread-safe. The only promise
makes is that the same instance of an object will not
be passed to more than one method of a
at a time.
<> the type of objects held in this pool
activated. They will not be activated before being served by the pool.
java.lang.Exceptionif there is a problem creating a new instance, this will be propagated to the code requesting an object.
It is important for implementations of this method to be aware
that there is no guarantee about what state
will be in and the implementation should be prepared to handle
Also, an implementation must take in to consideration that instances lost to the garbage collector may never be destroyed.
objthe instance to be destroyed
java.lang.Exceptionshould be avoided as it may be swallowed by the pool implementation.