This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I would like to ask for a review of the following inter-cluster friend API. The code completion for Java Persistence API annotations (in the j2ee/persistence module) displays database metadata (information about the database structure, such as the list of tables or columns). The code completion needs to refresh its metadata cache when the metadata change due to user activity in the Database Explorer (e.g. adding a table or a column). The Database Explorer (db module in the ide cluster) needs to provide an API allowing the code completion to listen on these changes. This API should not be public, as it will be replaced by the database metadata model in a future version. Since the db module already provides a public API, the API cannot be friend either. In order to avoid an inter-cluster implementation dependency between j2ee/persistence and db, I propose the introduction of a db/dbapi module in the ide cluster, providing the friend API for j2ee/persistence and having an implementation dependency on the db module. The db module provides a DbMetaDataListener interface whose methods it invokes when the metadata change. A single implementation of this interface is registered by the db/dbapi module in the default lookup. The db/dbapi module provides a MetaDataListener interface, implementations of which the j2ee/persistence module (or other clients if needed) register in a folder in the a folder in the system file system. The implementation of the DbMetaDataListener in db/dbapi passes the metadata change events received from db to the registered MetaDataListener-s. The target milestone is NetBeans 5.5. The change is compatible, so I request a fast-track review.
Created attachment 29560 [details] The db/dbapi module
Created attachment 29561 [details] The changes in the db module
Created attachment 29562 [details] Javadoc of db/dbapi
Since based on the comments (or the lack thereof) it looks this issue is non-controversial, I would like to commit it over the weekend. Thank you for the review.
Looks like the cleanest possible solution. Go on.
Created attachment 29717 [details] Commit log
Integrated.