[JBoss JIRA] (TEIIDDES-1518) Declare the TeiidServer ExecutionAdmin field private and remote its getter method
by Paul Richardson (JIRA)
Paul Richardson created TEIIDDES-1518:
-----------------------------------------
Summary: Declare the TeiidServer ExecutionAdmin field private and remote its getter method
Key: TEIIDDES-1518
URL: https://issues.jboss.org/browse/TEIIDDES-1518
Project: Teiid Designer
Issue Type: Bug
Components: Teiid Integration
Affects Versions: 8.1
Reporter: Paul Richardson
Assignee: Paul Richardson
Fix For: 8.1
The TeiidServer.getAdmin() method serves to allow code access to the business part of the server, ie. deploying, creating data sources. However, the method itself has the 'if (admin == null) create' pattern, which can cause a connection to occur even if other code explicitly disconnected or never wanted a connection.
This issue has been exacerbated by the parent IServer needing to be connected to as well in the UI to indicate that the server is available. Using getAdmin() in background services like the PreviewManager has given rise to the server being connected but the UI saying it is not connected. This is just wrong.
The getAdmin() method also has the potential to return null and is thus a source of NullPointer exceptions throughout the code.
Better to hide the admin connection and instead invite other code to ask the TeiidServer a question and use a callback to exec whatever custom applicable code. That way,
* admin can remain hidden
* the TeiidServer is always available so no NPEs
* if disconnected then the callback will be notified and react accordingly.
This will further server to limit dependencies on teiid client jars and move towards a service architecture where multiple versions of teiid can be installed.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira