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.

Bug 74329 - API for listening on metadata changes
Summary: API for listening on metadata changes
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2006-04-03 17:16 UTC by Andrei Badea
Modified: 2006-04-09 19:22 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
The db/dbapi module (45.89 KB, text/plain)
2006-04-03 17:16 UTC, Andrei Badea
Details
The changes in the db module (8.36 KB, text/plain)
2006-04-03 17:17 UTC, Andrei Badea
Details
Javadoc of db/dbapi (41.43 KB, application/x-compressed)
2006-04-03 17:18 UTC, Andrei Badea
Details
Commit log (6.51 KB, text/plain)
2006-04-09 19:21 UTC, Andrei Badea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2006-04-03 17:16:10 UTC
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.
Comment 1 Andrei Badea 2006-04-03 17:16:43 UTC
Created attachment 29560 [details]
The db/dbapi module
Comment 2 Andrei Badea 2006-04-03 17:17:12 UTC
Created attachment 29561 [details]
The changes in the db module
Comment 3 Andrei Badea 2006-04-03 17:18:42 UTC
Created attachment 29562 [details]
Javadoc of db/dbapi
Comment 4 Andrei Badea 2006-04-07 10:02:11 UTC
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.
Comment 5 Jaroslav Tulach 2006-04-07 10:12:40 UTC
Looks like the cleanest possible solution. Go on.
Comment 6 Andrei Badea 2006-04-09 19:21:43 UTC
Created attachment 29717 [details]
Commit log
Comment 7 Andrei Badea 2006-04-09 19:22:54 UTC
Integrated.