public void returnInvocationHandler ( MessageEndpointBase endpoint , boolean reuse ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "MEF.returnInvocationHandler" ) ; // Use pool only if one was created. if ( ivInvocationHandlerPool != null ) // d423445.1 { if ( reuse ) { MessageEndpointBase . reset ( endpoint ) ; // F73236 PooledObject removed, call reset() directly ivInvocationHandlerPool . put ( endpoint ) ; } //f743-7046 start // Notify any thread, but only 1 thread since release // only occurred on one MessageEndpoint, that is blocked // in createEndpoint method waiting for a release method // to be called on some MessageEndpoint proxy. synchronized ( ivStateLock ) { // d643869 // According to the JCA 1.5 spec section 12.5 the proxy // instance can be pooled and reused by the same resource adapter. // The proxy instance is not freed here and the count is // not decremented. The discard method handles freeing // proxy instances that are pooled and decrementing the count. // --ivNumberOfMessageEndpointsCreated; ivStateLock . notify ( ) ; } //f743-7046 end } // d643869 // Decrement the ivNumberOfMessageEndpointsCreated and null the proxy // because the MessageEndpointHandler was not returned to the pool // and will be garbage collected by the JVM if ( ivInvocationHandlerPool == null || ! reuse ) { synchronized ( ivStateLock ) { -- ivNumberOfMessageEndpointsCreated ; //endpointBase.ivProxy = null; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "MEF.returnInvocationHandler" ) ; // d643869 }
LI2110 . 56 - rewrote method to use new reuse parameter .