Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333762 - HTTPLaunchable should accept a provider and not a URL
Summary: HTTPLaunchable should accept a provider and not a URL
Status: RESOLVED FIXED
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: wst.server (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Angel Vera CLA
QA Contact: Angel Vera CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-07 11:40 EST by Angel Vera CLA
Modified: 2017-10-11 16:57 EDT (History)
0 users

See Also:


Attachments
v1.0 (3.79 KB, patch)
2011-01-07 14:08 EST, Angel Vera CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Angel Vera CLA 2011-01-07 11:40:30 EST
For Run on Server scenarios, adopters that use HTTPLaunchable are required to calculate the URL much earlier than what is needed. 

In other words, LaunchableAdapterDelegateonly contains one method that requires to return the launchable Object for the moduleArtifact. If adopters decide to use the HTTPLaunchable as the object being returned, they are forced to have to calculate the complete URL to be launched by the browser during the LaunchableAdapterDelegate.getLaunchable, which is called very early during the Run On Server path. 

A better way of doing things, is to allow to calculate the URL at the precise moment is required during the browser.openURL. 

The new support needs to be backward compatible so that adopters are not forced to move to the delay URL calculation.
Comment 1 Angel Vera CLA 2011-01-07 14:08:40 EST
Created attachment 186299 [details]
v1.0
Comment 2 Angel Vera CLA 2011-01-07 14:14:45 EST
With the new code adopters do not need to change their current code, but it would be preferable that they do. 

To delay the calculation of the URL to be launched in the browser, adopters would need to create a class that implements IURLProvider2, create a constructor that accept the required objects (e.g. Server and IModuleArtifact) and then provide an implementation to getLaunchableURL() so that it can correctly open a browser in the correct URL. 

We didn't want to make IURLProvider2 context specific to the Run On Server scenario in case we can use the interface in a different place.
Comment 3 Angel Vera CLA 2011-01-07 14:49:14 EST
Changes committed to 32M
Comment 4 Angel Vera CLA 2011-01-07 14:51:47 EST
changes released to 32M
Comment 5 Angel Vera CLA 2011-01-07 15:06:50 EST
changes committed to HEAD
Comment 6 Angel Vera CLA 2011-01-07 15:11:32 EST
changes released to HEAD
Comment 7 Eclipse Genie CLA 2017-10-11 16:35:27 EDT
New Gerrit change created: https://git.eclipse.org/r/109011
Comment 8 Eclipse Genie CLA 2017-10-11 16:35:28 EDT
New Gerrit change created: https://git.eclipse.org/r/109012
Comment 9 Eclipse Genie CLA 2017-10-11 16:53:59 EDT
New Gerrit change created: https://git.eclipse.org/r/109837