I cannot seem to get control when the client application connects to Teiid to use my VDB.
I have created a resource adapter that contains classes that subclass: BasicManagedConnectionFactory, BasicConnectionFactory, and BasicConnection. They also use the WrappedConnectionFactory and WrappedConnection classes.
The ra.xml file specifies my ManagedConnectionFactory (subclass of BasicManagedConnectionFactory), WrappedConnectionFactory, and WrappedConnection. My ManagedConnectionFactory class returns my ConnectionFactory wrapped in a WrappedConnectionFactory when its createConnectionFactory method is invoked. When the WrappedConnectionFactory object is asked for a connection object it goes through the normal JBoss ConnectionManager processing that gets to the BasicManagedConnectionFactory which creates a BasicManagedConnection object that asks my ConnectionFactory object for a connection. My connection factory object creates a Connection object of my connection type when getConnection() is invoked. My connection object gets wrapped up in a WrappedConnection by BasicManagedConnection and that is passed around by Teiid.
I have an XXX-ds.xml file that defines the data source and properties that get stored in my ManagedConnectionFactory object. I have a XXX-vdb.xml file that references the JNDI name in the XXX-ds.xml file. All the properties and configuration parameters are set into the appropriate objects.
A ManagedConnectionFactory and ConnectionFactory are created for each JNDI name in the XXX-ds.xml file when it deploys. Which happens before any translators are deployed or VDB are activated. This is earlier than I would expect.
I get an ExecutionFactory object for each model in the VDB when it is deployed into a active state.
At no time during this processing is there a valid Subject, nor would I expect there to be since the client app has not yet connected.
When a client app connects to Teiid to access my VDB, I do not see any activity in my LoginModule or the creation of any connection objects (managed or plain).
I fact I don't see anything happening in my code until my ExecutionFactory is called to get a connection to process the SELECT statement the client sent to Teiid. I would expect to see something happen when the initial connection is made by the client app.
WHAT am I doing wrong?