com.metamatrix.common.pooling.api
Class ResourceHelper

java.lang.Object
  extended by com.metamatrix.common.pooling.api.ResourceHelper

public final class ResourceHelper
extends java.lang.Object


Constructor Summary
ResourceHelper()
           
 
Method Summary
static Resource getResource(java.util.Properties properties, java.lang.String userName)
          Returns a Resource from a resource pool based on the specified ResourcePool.RESOURCE_POOL property.
static Resource getResource(java.lang.String poolName, java.lang.String userName)
          Returns a Resource from the specified ResourcePool.RESOURCE_POOL based on the specified poolName.
static Resource getResourceFromPool(ResourceDescriptor descriptor, java.lang.String userName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceHelper

public ResourceHelper()
Method Detail

getResource

public static Resource getResource(java.util.Properties properties,
                                   java.lang.String userName)
                            throws ResourcePoolException
Returns a Resource from a resource pool based on the specified ResourcePool.RESOURCE_POOL property. If the requested pool does not exist, then a new pool will be created based on the given pool name. However, in order to create the new pool, the pool may expect certain properties to be passed in. Otherwise, an exception may be thrown when the resource is requested from the pool.

Parameters:
properties - that define the pool to obtain the connection from
userName - is the requestor of the connection
Throws:
ResourcePoolException - if an error occurs obtaining the connection

getResource

public static Resource getResource(java.lang.String poolName,
                                   java.lang.String userName)
                            throws ResourcePoolException
Returns a Resource from the specified ResourcePool.RESOURCE_POOL based on the specified poolName.

Parameters:
poolName - is the name of the pool to obtain the resource from
userName - is the requestor of the connection
Throws:
ResourcePoolException - if an error occurs obtaining the connection

getResourceFromPool

public static Resource getResourceFromPool(ResourceDescriptor descriptor,
                                           java.lang.String userName)
                                    throws ResourcePoolException
Throws:
ResourcePoolException


Copyright © 2009. All Rights Reserved.