PooliT v2.0

org.ascentphase.poolit.handlers
Class InitialContextHandler

java.lang.Object
  extended byorg.ascentphase.poolit.handlers.BaseHandler
      extended byorg.ascentphase.poolit.handlers.InitialContextHandler
All Implemented Interfaces:
PoolHandler

public class InitialContextHandler
extends BaseHandler

Handler for InitialContext objects. InitialContext objects are good candidates to be pooled because the specifications state that the object is not synchronized against concurrent access. Either multiple threads provide proper locking to prevent concurrent access to one InitialContext, or each thread uses its own InitialContext. Pooling would allow multiple threads to use different InitialContext objects without incurring the overhead of creating one each time.

Author:
huyd

Constructor Summary
InitialContextHandler()
          Construct a handler to create InitialContext's with no initialization properties.
InitialContextHandler(java.util.Hashtable props)
          Construct a handler to create InitialContext's with the given properties.
 
Method Summary
 java.lang.Object create()
          Called by a Pooler to create a new object.
 void destroy(java.lang.Object o)
          Closes the InitialContext before being garbage-collected.
 
Methods inherited from class org.ascentphase.poolit.handlers.BaseHandler
verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitialContextHandler

public InitialContextHandler()
Construct a handler to create InitialContext's with no initialization properties.


InitialContextHandler

public InitialContextHandler(java.util.Hashtable props)
Construct a handler to create InitialContext's with the given properties.

Parameters:
props - initialization properties passed to InitialContext.
Method Detail

create

public java.lang.Object create()
                        throws CreateException
Description copied from interface: PoolHandler
Called by a Pooler to create a new object.

Specified by:
create in interface PoolHandler
Specified by:
create in class BaseHandler
Throws:
CreateException
See Also:
PoolHandler.create()

destroy

public void destroy(java.lang.Object o)
Closes the InitialContext before being garbage-collected.

Specified by:
destroy in interface PoolHandler
Overrides:
destroy in class BaseHandler
Parameters:
o - the InitialContext object to destroy.

PooliT v2.0

Copyright © 2005 Ascent Phase Corp.