*/
public void remove( ResourceKey key )
throws ResourceException
{
Resource resource = null;
Lock lock = getLock(key);
try
{
lock.acquire( );
}
catch ( InterruptedException ie )
{
throw new ResourceException( ie );
}
try
{
resource = get( key );
try
{
resource.destroy( );
}
catch ( RuntimeException re )
{
throw new ResourceException( MSG.getMessage( Keys.FAILED_TO_DESTROY_RESOURCE, resource, re ));
}
m_resources.remove( getLookupKey(key) );
LOG.debug( MSG.getMessage( Keys.REMOVED_RESOURCE_WITH_KEY, resource.getClass( ).getName( ) ,String.valueOf(key) ));
if ( m_cache != null )
{
m_cache.remove( resource );
}
}