Esri Geoportal Server
1.0

com.esri.gpt.framework.sql
Class ConnectionBroker

java.lang.Object
  extended by com.esri.gpt.framework.sql.ConnectionBroker

public final class ConnectionBroker
extends Object

Primary interface for accessing JDBC connection resources.

This class is intended for use by a single request execution thread.


Constructor Summary
ConnectionBroker()
          Default constructor.
ConnectionBroker(DatabaseReferences databaseReferences)
          Construct based upon a configured collection of DatabaseReferences.
 
Method Summary
 void closeAll()
          Closes all ManagedConnections.
 void closeConnection(ManagedConnection managedConnection)
          Closes a ManagedConnection.
 ManagedConnection returnConnection(String referenceTag)
          Returns the ManagedConnection associated with a supplied connection tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionBroker

public ConnectionBroker()
Default constructor.


ConnectionBroker

public ConnectionBroker(DatabaseReferences databaseReferences)
Construct based upon a configured collection of DatabaseReferences.

Parameters:
databaseReferences - the DatabaseReferences associated with the configuration
Method Detail

closeAll

public void closeAll()
Closes all ManagedConnections.
The underlying JDBC connections are closed.


closeConnection

public void closeConnection(ManagedConnection managedConnection)
Closes a ManagedConnection.
The underlying JDBC connection is closed.

Parameters:
managedConnection - the ManagedConnection to close

returnConnection

public ManagedConnection returnConnection(String referenceTag)
                                   throws SQLException
Returns the ManagedConnection associated with a supplied connection tag.

If a ManagedConnection has already been established for the tag, it will be returned. Otherwise an new ManagedConnection will be established based upon the underlying DatabaseReference associated with the supplied tag.

Parameters:
referenceTag - the tag associated with the database reference (can be null for default connection)
Returns:
the associated ManagedConnection
Throws:
SQLException - if an SQL exception occurs while establishing the connection

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.