Bug 119682 - Add shouldPublish() and shouldRestart() to API
Summary: Add shouldPublish() and shouldRestart() to API
Status: CLOSED FIXED
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: wst.server (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 2.0 M3   Edit
Assignee: Tim deBoer CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2005-12-07 12:11 EST by Kathy Chan CLA
Modified: 2017-10-11 17:00 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kathy Chan CLA 2005-12-07 12:11:31 EST
Driver:  RC1

After a Web module has been added to the Tomcat 5.0 server, if other classes are added to the Web module, when we called 

   server.getServerPublishState()

IServer.PUBLISH_STATE_NONE is returned even though the new classes had not been "published" to the .metadata/org.eclipse.wst.server.core temporary publish area.

See bug 119140 for more history for this bug.
Comment 1 Tim deBoer CLA 2005-12-07 21:58:58 EST
I think we've had some miscommunication - getServerPublishState() is spec'd to only return a difference when server-level resources have changed, e.g. the server configuration. There are corresponding getModulePublishState(IModule[]) methods to check whether a specific module needs to be published. You can't tell whether a publish needs to be kicked off unless you've checked all of these.

The quick fix is for you to change:
  server.getServerPublishState();
to:
  ((Server) server).shouldPublish();

Yes, you'll get a warning because this is not on the public API. This method checks all of the getXyzPublishState() methods to determine if a publish is required. I can easily add it to the public API for 1.5.
Comment 2 Kathy Chan CLA 2006-01-18 17:12:22 EST
Since Tim also pointed out that we should be calling:

   shouldRestart = ((Server)server).shouldRestart();

instead of,

   shouldRestart = server.getServerRestartState();  

we also need shouldRestart (currently internal) to be in the public API as well.  	
Comment 3 Kathy Chan CLA 2006-01-27 10:13:23 EST
Updating summary to "Add shouldPublish() and shouldRestart() to API"
Comment 4 Tim deBoer CLA 2006-11-20 15:31:32 EST
API added and released to 2.0 stream.
Comment 5 Kathy Chan CLA 2006-11-21 10:51:06 EST
Tim, what are the new APIs to use?
Comment 6 Tim deBoer CLA 2006-11-21 11:23:57 EST
The methods are still called shouldPublish() and shouldRestart(). They've just been promoted to IServer.
Comment 7 John Lanuti CLA 2007-04-03 12:16:55 EDT
Closing as fixed since M3.  If this was closed in error, please reopen.
Comment 8 Eclipse Genie CLA 2017-10-11 16:07:08 EDT
New Gerrit change created: https://git.eclipse.org/r/108030
Comment 9 Eclipse Genie CLA 2017-10-11 16:07:09 EDT
New Gerrit change created: https://git.eclipse.org/r/108029
Comment 10 Eclipse Genie CLA 2017-10-11 16:50:19 EDT
New Gerrit change created: https://git.eclipse.org/r/109666