Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 248264 - Need "null" providers for all services
Summary: Need "null" providers for all services
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: RDT (show other bugs)
Version: 2.1M3   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: 2.1M5   Edit
Assignee: Chris Recoskie CLA
QA Contact: Greg Watson CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-23 09:31 EDT by Chris Recoskie CLA
Modified: 2008-10-02 11:43 EDT (History)
2 users (show)

See Also:


Attachments
proposed patch (25.96 KB, patch)
2008-09-25 17:29 EDT, Vivian Kong CLA
no flags Details | Diff
updated patch (28.16 KB, patch)
2008-09-26 16:22 EDT, Vivian Kong CLA
recoskie: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Recoskie CLA 2008-09-23 09:31:27 EDT
We need to have "null" providers that essentially do a no-op when they are called. An important use case will be to allow people to configure say the build service, but not have indexing services.  Right now you have to configure all the services to proceed in the wizard (which is the correct behaviour), but there's no way to specify that you want a service to not do anything.
Comment 1 Mike Kucera CLA 2008-09-23 10:10:48 EDT
From a UI perspective it would be simpler to have "Not Configured" mean that the null service should be used. 

It seems like an unnecessary extra step to require the user to specify that they don't want a service to do anything, perhaps that should just be the default.
Comment 2 Mike Kucera CLA 2008-09-23 10:15:39 EDT
We should consider using a single Dynamic Proxy to implement the null services. It would require less code than having to explicitly write all the null services. It should be very easy to create a Dynamic Proxy that does nothing and implements all the service interfaces.

More info:
http://java.sun.com/j2se/1.3/docs/guide/reflection/proxy.html
Comment 3 Vivian Kong CLA 2008-09-25 17:29:42 EDT
Created attachment 113531 [details]
proposed patch

Patch adds null service providers for build and indexing.  Also made some changes in the service model widget:
- when no service provider is set then the default will be the null provider
- when null provider is selected, there's no need to configure it so the configure button is disabled
Comment 4 Chris Recoskie CLA 2008-09-26 12:45:47 EDT
I'm trying out the patch.  I have an existing project, for which I've previously configured the services for a remote machine.  If I go into the project properties and set the indexing service to the null provider, index operations are still going through via the old provider.  Something is not quite right.
Comment 5 Vivian Kong CLA 2008-09-26 16:22:50 EDT
Created attachment 113627 [details]
updated patch

We used to only have 1 service provider for each service and now we have two.  Need to set the new configuration to the active one.
Comment 6 Chris Recoskie CLA 2008-10-02 09:27:00 EDT
I am reworking this patch.  Using the null indexing provider causes NPEs in the indexing job.  We don't want NPEs, what we want is operations that do nothing.
Comment 7 Chris Recoskie CLA 2008-10-02 11:42:00 EDT
Fixed on HEAD, using Vivian's patch as a basis, with some additional modifications.