com.metamatrix.jdbc
Class EmbeddedConnectionFactoryImpl

java.lang.Object
  extended by com.metamatrix.jdbc.EmbeddedConnectionFactoryImpl
All Implemented Interfaces:
EmbeddedConnectionFactory

public class EmbeddedConnectionFactoryImpl
extends java.lang.Object
implements EmbeddedConnectionFactory

A factory class which creates the connections to the embedded DQP instance. This is also responsible for initializing the DQP if the DQP instance is not already alive.


Constructor Summary
EmbeddedConnectionFactoryImpl()
           
 
Method Summary
 java.sql.Connection createConnection(java.util.Properties props)
          Create a Connection to the DQP.
 ApplicationService findService(java.lang.String type)
           
 org.teiid.dqp.internal.process.DQPCore getDQP()
           
 java.util.Properties getProperties()
           
 long getStartTime()
           
 void initialize(java.net.URL bootstrapURL, java.util.Properties props)
          When the DQP is restarted using the admin API, it only shuts it down, it gets restarted when the next time connection is made, however this factory may be holding on to a previous transport handler, so we need to check if the DQP is still alive and create a new one if necessary.
 boolean isAlive()
           
 void shutdown()
          A shutdown could happen when somebody calls stop/restart on DQP or in normal course of process, we may have just closed the last connection in both cases we want to handle the situation of graceful/proper shutdown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedConnectionFactoryImpl

public EmbeddedConnectionFactoryImpl()
Method Detail

createConnection

public java.sql.Connection createConnection(java.util.Properties props)
                                     throws java.sql.SQLException
Description copied from interface: EmbeddedConnectionFactory
Create a Connection to the DQP. This will load a DQP instance if one is not present

Specified by:
createConnection in interface EmbeddedConnectionFactory
Returns:
Connection to DQP
Throws:
java.sql.SQLException
See Also:
com.metamatrix.jdbc.EmbeddedConnectionFactory#createConnection()

initialize

public void initialize(java.net.URL bootstrapURL,
                       java.util.Properties props)
                throws java.sql.SQLException
When the DQP is restarted using the admin API, it only shuts it down, it gets restarted when the next time connection is made, however this factory may be holding on to a previous transport handler, so we need to check if the DQP is still alive and create a new one if necessary.

Specified by:
initialize in interface EmbeddedConnectionFactory
Parameters:
props -
Throws:
ApplicationInitializationException
java.sql.SQLException
Since:
4.3

isAlive

public boolean isAlive()

getStartTime

public long getStartTime()

getProperties

public java.util.Properties getProperties()

getDQP

public org.teiid.dqp.internal.process.DQPCore getDQP()

findService

public ApplicationService findService(java.lang.String type)

shutdown

public void shutdown()
              throws java.sql.SQLException
A shutdown could happen when somebody calls stop/restart on DQP or in normal course of process, we may have just closed the last connection in both cases we want to handle the situation of graceful/proper shutdown.

Specified by:
shutdown in interface EmbeddedConnectionFactory
Throws:
java.sql.SQLException
See Also:
EmbeddedConnectionFactory.shutdown()


Copyright © 2009. All Rights Reserved.