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 103872

Summary: Introduce a method to run an action when a metadata model becomes ready
Product: javaee Reporter: Andrei Badea <abadea>
Component: CodeAssignee: Andrei Badea <abadea>
Status: RESOLVED FIXED    
Severity: blocker CC: apireviews, pcw
Priority: P2 Keywords: API, API_REVIEW_FAST
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 95534    
Attachments: Proposed change

Description Andrei Badea 2007-05-13 20:28:12 UTC
Because most known implementations of metadata models delegate to the Java
infrastructure, a method such as must be introduced to allow a client to run an
action on the model when the Java classpath scan has finished. The method is the
equivalent of the JavaSource.runWhenScanFinished() introduced in issue 101787.
Comment 1 Andrei Badea 2007-05-13 20:29:56 UTC
Created attachment 42348 [details]
Proposed change
Comment 2 Andrei Badea 2007-05-13 20:52:49 UTC
Please review. The change is incompatible, but the API hasn't been released yet,
all known implementors are in the NetBeans Java EE team and it is extremely
unlikely the change would break anyone.

I would especially like to get a review of the exception handling of the
runReadActionWhenRead() method. Should it immediately rethrow exceptions in the
action when executing the action synchronously (as suggested in the diff) or
should it throw the exception as an ExecutionException when get() is called on
the Future result? The latter is perhaps nicer for clients (doesn't need to
check for a runtime exception twice -- for both runReadActionWhenRead() and
Future.get()). But then if the client doesn't call Future.get() the exception
will be just swallowed. But then again the exception can be swallowed anyway
(when the action is run asynchronously and the client doesn't call
Future.get()). And I guess the former is needed because unchecked exceptions
need to pass through when the action is called synchronously.
Comment 3 Jaroslav Tulach 2007-05-15 06:07:43 UTC
incompatible changes before release are ok. please make sure your functional 
contract is tested and continuous build succeeds.
Comment 4 Andrei Badea 2007-05-20 23:49:42 UTC
If there are no more comments I will commit on Tuesday.
Comment 5 Andrei Badea 2007-05-22 21:18:07 UTC
Integrated.

Checking in j2ee/metadata/apichanges.xml;
/cvs/j2ee/metadata/apichanges.xml,v  <--  apichanges.xml
new revision: 1.2; previous revision: 1.1
done
Checking in j2ee/metadata/manifest.mf;
/cvs/j2ee/metadata/manifest.mf,v  <--  manifest.mf
new revision: 1.7; previous revision: 1.6
done
Checking in
j2ee/metadata/src/org/netbeans/modules/j2ee/metadata/model/api/MetadataModel.java;
/cvs/j2ee/metadata/src/org/netbeans/modules/j2ee/metadata/model/api/MetadataModel.java,v
 <--  MetadataModel.java
new revision: 1.3; previous revision: 1.2
done
Checking in
j2ee/metadata/src/org/netbeans/modules/j2ee/metadata/model/spi/MetadataModelImplementation.java;
/cvs/j2ee/metadata/src/org/netbeans/modules/j2ee/metadata/model/spi/MetadataModelImplementation.java,v
 <--  MetadataModelImplementation.java
new revision: 1.3; previous revision: 1.2
done
Checking in
j2ee/metadata/test/unit/src/org/netbeans/modules/j2ee/metadata/model/api/MetadataModelCompatibilityTest.java;
/cvs/j2ee/metadata/test/unit/src/org/netbeans/modules/j2ee/metadata/model/api/MetadataModelCompatibilityTest.java,v
 <--  MetadataModelCompatibilityTest.java
new revision: 1.3; previous revision: 1.2
done
Checking in
j2ee/metadata/test/unit/src/org/netbeans/modules/j2ee/metadata/model/api/SimpleMetadataModelImpl.java;
/cvs/j2ee/metadata/test/unit/src/org/netbeans/modules/j2ee/metadata/model/api/SimpleMetadataModelImpl.java,v
 <--  SimpleMetadataModelImpl.java
new revision: 1.3; previous revision: 1.2
done
Checking in
j2ee/metadata/test/unit/src/org/netbeans/modules/j2ee/metadata/model/spi/MetadataModelFactoryTest.java;
/cvs/j2ee/metadata/test/unit/src/org/netbeans/modules/j2ee/metadata/model/spi/MetadataModelFactoryTest.java,v
 <--  MetadataModelFactoryTest.java
new revision: 1.3; previous revision: 1.2
done