| <html> |
| |
| <head> |
| <meta http-equiv="Content-Language" content="en-us"> |
| <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> |
| <link rel="stylesheet" href="http://www.eclipse.org/default_style.css" type="text/css"> |
| <title>Server Tools API Changes</title> |
| <style> |
| td { font-family: arial, helvetica, geneva; font-size: 9pt; vertical-align: top; } |
| td.code { font-family: "Courier New", Courier, mono; font-size: 7.75pt} |
| </style> |
| </head> |
| |
| <body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b"> |
| |
| <table border="0" cellpadding="2" cellspacing="5" width="100%"> |
| <tbody><tr> |
| <TD WIDTH=60%> |
| <P ALIGN=LEFT><B><FONT SIZE=6><FONT FACE="Verdana, Arial, Helvetica, sans-serif">Server Tools API Changes</FONT></FONT></B><BR> |
| <FONT SIZE=1><FONT FACE="Arial, Helvetica, sans-serif"><FONT COLOR="#8080ff">Information on Server Tools API Changes</FONT></FONT></FONT> |
| </P> |
| </TD> |
| <td rowspan="2" width="19%"><img src="http://www.eclipse.org/images/Idea.jpg" border="0" height="86" width="120"></td> |
| </tr> |
| </tbody></table> |
| |
| |
| <table border="0" cellpadding="2" cellspacing="5" width="100%"> |
| <tbody><tr> |
| <td colspan="2" align="left" bgcolor="#0080c0" valign="top"><b><font color="#ffffff" face="Arial,Helvetica">M1 Changes</font></b></td> |
| </tr></tbody> |
| </table> |
| |
| This document contains information on the Server Tools API changes that have gone |
| into M1. |
| |
| <p/> |
| |
| <table border=1 cellspacing="0"> |
| <tr> |
| <th>Change</th> |
| <th>Reason</th> |
| <th>Old Code</th> |
| <th>New Code</th> |
| </tr> |
| <tr> |
| <td>Package renames:<br/> |
| com.ibm.wtp.server.core -> org.eclipse.wst.server.core<br/> |
| com.ibm.wtp.server.ui -> org.eclipse.wst.server.ui<br/> |
| com.ibm.wtp.server.util -> org.eclipse.wst.server.util<br/> |
| com.ibm.wtp.server.java.core -> org.eclipse.jst.server.core<br/> |
| com.ibm.wtp.server.java.ui -> org.eclipse.jst.server.ui<br/> |
| com.ibm.wtp.server.tomcat.core -> org.eclipse.jst.server.tomcat.core<br/> |
| com.ibm.wtp.server.tomcat.ui -> org.eclipse.jst.server.tomcat.ui<br/> |
| com.ibm.wtp.monitor.core -> org.eclipse.wst.monitor.core<br/> |
| com.ibm.wtp.monitor.ui -> org.eclipse.wst.monitor.ui<br/> |
| com.ibm.wtp.webbrowser -> org.eclipse.wst.webbrowser</td> |
| <td>Renaming for open source</td> |
| <td></td> |
| <td></td> |
| </tr> |
| <tr> |
| <td></td> |
| <td></td> |
| <td></td> |
| <td></td> |
| </tr> |
| </table> |
| |
| |
| <table border="0" cellpadding="2" cellspacing="5" width="100%"> |
| <tbody><tr> |
| <td colspan="2" align="left" bgcolor="#0080c0" valign="top"><b><font color="#ffffff" face="Arial,Helvetica">M2 Changes</font></b></td> |
| </tr></tbody> |
| </table> |
| |
| This document contains information on the Server Tools API changes that have gone into M2. |
| |
| <p/> |
| |
| <table border=1 cellspacing="0"> |
| <tr> |
| <th>Change</th> |
| <th>Reason</th> |
| <th>Old Code</th> |
| <th>New Code</th> |
| </tr> |
| <tr> |
| <td>All java.util.Lists returned from methods have been changed to arrays of the corresponding |
| content type.</td> |
| <td>Stronger typed return values are safer, and returning a copy of the list (instead of the list |
| itself) blocks against clients modifying internal data structures.</td> |
| <td class="code">List list = ServerCore.getRuntimeTypes();</td> |
| <td class="code">IRuntimeType[] rt = ServerCore.getRuntimeTypes();</td> |
| </tr> |
| <tr> |
| <td>IResourceManager has been removed. Most of it's methods have been moved to the ServerCore |
| class, with the remaining ones in ServerUtil.</td> |
| <td>There was no client benefit of the resource manager, and it was misnamed.</td> |
| <td class="code">ServerCore.getResourceManager().getServers();</td> |
| <td class="code">ServerCore.getServers();</td> |
| </tr> |
| <tr> |
| <td>All extension point interfaces have been changed to abstract classes, and the "I" removed |
| from the name.</td> |
| <td>Allows for future support and maintenance without breaking existing interfaces.</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| </tr> |
| <tr> |
| <td>Several interfaces were moved from the .core.model package to .core.</td> |
| <td>The .core.model package was meant for SPIs, not API. All API classes & interfaces will |
| be moved or remain in .core so that API users do not need to use the .core.model package.</td> |
| <td class="code">import org.eclipse.wst.server.code.model.IModule;</td> |
| <td class="code">import org.eclipse.wst.server.code.IModule;</td> |
| </tr> |
| <tr> |
| <td>IServerResourceListener renamed to IServerLifecycleListener. Several methods moved out to |
| new IRuntimeListener and IServerConfigurationListener interfaces.</td> |
| <td>"Resource" had to be removed from the name, and the interface contained methods for |
| runtimes and server configurations as well. They are split up so that API users do not |
| need to listen for all types of changes from a single interface.</td> |
| <td class="code">ServerCore.getResourceManager().addServerResourceListener(myListener);</td> |
| <td class="code">ServerCore.addRuntimeLifecycleListener(myListener);</td> |
| </tr> |
| <tr> |
| <td>Publishing interfaces completely rewritten & .core.resources package removed.</td> |
| <td>The publishing interface was outdated and written before the Eclipse team support, |
| ANT, or other recent publishing methods had been developed. The new API allows for |
| better support and for each server type to use it's own publishing mechanism.</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| </tr> |
| <tr> |
| <td>IRuntimeDelegate and IRuntimeWorkingCopyDelegate merged into a single RuntimeDelegate. |
| IServerDelegate and IServerWorkingCopyDelegate reworked into |
| ServerDelegate and ServerBehaviourDelegate.</td> |
| <td>Making clients provide two separate classes for the delegates was excessive, |
| unnecessary, and ended up with too many SPI classes. Only a single delegate class is |
| now required for these extension points.</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| </tr> |
| <tr> |
| <td>IRuntime.getDelegate(), IRuntime.getWorkingCopyDelegate() changed into IRuntime extending |
| IAdaptable. Similar for IServer and other delegates</td> |
| <td>IAdaptable is a common Eclipse mechanism, and allows for other extension as well. Clients |
| should still remember that calling this method may involve plugin loading, so it should |
| not be used in popup menus, etc.</td> |
| <td class="code">ITomcatRuntime tr = (ITomcatRuntime) runtime.getDelegate();</td> |
| <td class="code">ITomcatRuntime tr = (ITomcatRuntime) runtime.getAdapter(ITomcatRuntime.class);</td> |
| </tr> |
| <tr> |
| <td>IModuleType and IModuleKind interfaces merged.</td> |
| <td>IModuleKind was created late in the previous release cycle and couldn't be merged at the |
| time it was created.</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| </tr> |
| <tr> |
| <td>IServerTask changed and IModuleTask removed.</td> |
| <td>The existing interfaces had an ITask directly returned as a delegate, and only allowed a |
| single task per extension point. The new IServerTask allows the delegate to return multiple |
| tasks from a single extension point, and it is not itself a task.</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| </tr> |
| <tr> |
| <td>IServerConfiguration, IServerConfiguration, etc. removed</td> |
| <td>The server config was a relic and did not need to be a first class resource. ServerDelegates |
| are now directly responsible for maintaining the configuration.</td> |
| <td class="code"></td> |
| <td class="code">see Tomcat implementation</td> |
| </tr> |
| <tr> |
| <td>Various minor cleanup - methods renamed, parameters changed, etc.</td> |
| <td>Cleanup and future maintenance.</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| </tr> |
| <tr> |
| <td>IModuleObjectAdapter -> IModuleArtifactAdapter, IModuleObject -> IModuleArtifact</td> |
| <td>Object was too generic and didn't have any real meaning. Artifact represents what the |
| IModuleObject really represents - resources within a module</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| </tr> |
| <tr> |
| <td>getServerType(String id) -> findServerType(String id)</td> |
| <td>Lookup methods on ServerCore and ServerUtil renamed to be more accurate to what |
| they do.</td> |
| <td class="code">IServerType st = getServerType("com.x")</td> |
| <td class="code">IServerType st = findServerType("com.x")</td> |
| </tr> |
| <tr> |
| <td>Lots of methods & interfaces moved to internal packages</td> |
| <td>Need to trim down the exposed API to only what is required for ongoing maintenance. If |
| there is anything in an internal package that you were previously using, or plan to use |
| in the future, please contact me and we'll work out an API solution</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| </tr> |
| <tr> |
| <td>Publishing changes - several interfaces and the org.eclipse.wst.server.core.resource |
| package removed</td> |
| <td>The old publishing mechanism did not allow flexibility in publishing options (e.g. |
| ANT, Eclipse team support, or some other mechanism) and used an outdated publishing |
| manager framework.</td> |
| <td class="code"></td> |
| <td class="code">ServerDelegate.publishStart(); // Called to tell the server that publishing is starting. |
| Can be used to connect to a remote server, etc.<br/> |
| ServerDelegate.publishStart(); // Called once to allow the server to publish any "global" |
| resources or a server config<br/> |
| ServerDelegate.publishStart(); // Called for each module to give the server a chance |
| to publish using any method it wants<br/> |
| ServerDelegate.publishFinish(); // Called to disconnect from the server or cleanup</td> |
| </tr> |
| <tr> |
| <td>IMonitorableServer merged with IServer</td> |
| <td>No need for </td> |
| <td class="code">IServerDelegate delegate = server.getDelegate()<br/> |
| if (delegate instanceof IMonitorableServer) {<br/> |
| IMonitorableServer ms = (IMonitorableServer) delegate;<br/> |
| List ports = ms.getServerPorts();<br/> |
| }</td> |
| <td class="code">IServerPort[] ports = server.getServerPorts();</td> |
| </tr> |
| <tr> |
| <td>Working copy changes</td> |
| <td>Previously, references were kept to every working copy, and clients had to save() or |
| release() them in finally blocks or else the reference would be dangling (and possibly |
| blocking other changes) forever. This code was unsafe and caused problems if a client |
| tried to use a working copy after it had been saved or released. |
| Now, clients can create a working copy at any time, and references are not kept. On |
| save, a client can specify whether the working copy changes should be forced, or not |
| (in which case the save will fail if someone else has made changes to the object in |
| the meantime). If the changes do not need to be saved, clients can just drop the |
| reference to the working copy at any time. As before, working copies should not be |
| used for long periods of time since it increases the chances that another client has |
| made changes</td> |
| <td class="code">IServerWorkingCopy wc = IServer.getWorkingCopy();<br/> |
| // do something with wc<br/> |
| wc.save(); or wc.release();</td> |
| <td class="code">IServerWorkingCopy wc = IServer.createWorkingCopy();<br/> |
| // do something with wc<br/> |
| wc.save(); or lose reference</td> |
| </tr> |
| <tr> |
| <td>Change IServer.isRestartNeeded() to match other methods</td> |
| <td></td> |
| <td class="code">IServer.isRestartNeeded();</td> |
| <td class="code">IServer.getServerRestartState();</td> |
| </tr> |
| <tr> |
| <td></td> |
| <td></td> |
| <td class="code"></td> |
| <td class="code"></td> |
| </tr> |
| </table> |
| |
| </body> |
| </html> |