org.cementj.pool
Interface Resource


public interface Resource

Interface for generic resource implementations.

Copyright: Delta Vortex Technologies, 2003.


Method Summary
 void initialize(java.util.Properties props)
          Initialize Resource.
 boolean isValid()
          Tests validity of Resource.
 void terminate()
          Terminate Resource.
 

Method Detail

initialize

void initialize(java.util.Properties props)
                throws ResourceException
Initialize Resource. This method is called after a resource is instantiated.

The properties are intended to be anything the resource might need to function properly. For example, pooled JDBC connections need to know the driver name, connection URL, userid and password.

Parameters:
Resource - Creation Properties
Throws:
ResourceException

terminate

void terminate()
               throws ResourceException
Terminate Resource. Any termination logic should be implemented here.

For example, pooled JDBC connections need to issue a close().

Throws:
ResourceException

isValid

boolean isValid()
                throws ResourceException
Tests validity of Resource. This is necessary so that invalid resources can be disposed of and aren't doled out to your application.

Returns:
True if resource is valid and usable, false if not.
Throws:
ResourceException


Copyright © 2003 Delta Vortex Technologies, Inc. All Rights Reserved.