Bug 140916 - API omission for ModuleFactoryDelegate
Summary: API omission for ModuleFactoryDelegate
Status: CLOSED DUPLICATE of bug 150181
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: wst.server (show other bugs)
Version: 1.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Tim deBoer CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2006-05-09 15:36 EDT by Rob Stryker CLA
Modified: 2006-11-21 14:49 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Stryker CLA 2006-05-09 15:36:43 EDT
ModuleFactoryDelegate lacks an API mechanism to allow the subclass to initialize properly. ModuleDelegate contains a mechanism, but ModuleFactoryDelegate does not.

ModuleDelegate example:
 
	public final void initialize(IModule newModule) {
		this.module = newModule;
		initialize();
	}

	/**
	 * Initializes this module delegate. This method gives delegates a chance
	 * to do their own initialization.
	 * <p>
	 * This method is called by the server core framework.
	 * Clients should never call this method.
	 * </p>
	 */
	public void initialize() {
		// do nothing
	}



The initialization of a ModuleFactoryDelegate does not behave similarly.
	final void initialize(ModuleFactory newFactory, IProgressMonitor monitor) {
		factory = newFactory;
	}


The designation of package-private and final indicate this to be intentional, but it seems to be a horrible oversight.
Comment 1 Tim deBoer CLA 2006-05-09 15:59:45 EDT
API, so unfortunately will have to defer to post 1.5.
Comment 2 Rob Stryker CLA 2006-05-10 19:32:03 EDT
I don't think the following change would break any API or binary compatability:

In the ModuleFactoryDelegate class, Change:

        final void initialize(ModuleFactory newFactory, IProgressMonitor
monitor) {
                factory = newFactory;
        }


To:


        final void initialize(ModuleFactory newFactory, IProgressMonitor
monitor) {
                factory = newFactory;
                initialize();
        }

        public void initialize() {
                // do nothing
        }


If I'm wrong please don't hesitate to correct me. Such a change would be beneficial to any extension implementer who requires a factory be set for their initialization routine. 
Comment 3 Tim deBoer CLA 2006-07-20 10:12:36 EDT
Fix will be dropped along with the fix to 150181.

*** This bug has been marked as a duplicate of 150181 ***
Comment 4 Tim deBoer CLA 2006-11-21 14:49:32 EST
Closing old bugs.