| <html> |
| <head> |
| <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| <link rel="stylesheet" href="../../../..//default_style.css" type="text/css"> |
| <link rel="stylesheet" href="../../../..//webtools/wtp.css" type="text/css"> |
| <title>Server Tools API Changes</title> |
| </head> |
| <body> |
| <table width="100%" cellspacing="5" cellpadding="2" border="0"> |
| <tbody> |
| <tr> |
| <td width="60%" align="left"><font class="indextop">Server Tools API Changes</font> |
| <br> |
| <font class="indexsub">Server Tools API Changes</font></td><td width="40%"><img width="120" hspace="50" height="86" align="middle" src="../../../..//images/Idea.jpg"></td> |
| </tr> |
| </tbody> |
| </table> |
| <table width="100%" cellspacing="5" cellpadding="2" border="0"> |
| <col width="16"> |
| <col width="*"> |
| <tbody> |
| <tr> |
| <td valign="top" align="right"> </td><td valign="top"> |
| <p> |
| This document contains information on API changes that have been made to the WTP Server Tools API. |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" bgcolor="#0080c0" align="left" colspan="2"><b><font face="Arial,Helvetica" color="#ffffff">M1 Changes</font></b></td> |
| </tr> |
| <tr> |
| <td valign="top" align="right"> </td><td valign="top"> |
| <p> |
| Here are the Server Tools API changes that went into M1. |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" align="right"><img width="16" height="16" border="0" src="../../../..//images/Adarrow.gif"></td><td>Package renames:</td> |
| </tr> |
| <tr> |
| <td valign="top" align="right"> </td><td valign="top"> |
| <p> |
| 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.internet.monitor.core<br> |
| com.ibm.wtp.monitor.ui -> org.eclipse.wst.internet.monitor.ui<br> |
| com.ibm.wtp.webbrowser -> org.eclipse.wst.internet.webbrowser |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" bgcolor="#0080c0" align="left" colspan="2"><b><font face="Arial,Helvetica" color="#ffffff">M2 Changes</font></b></td> |
| </tr> |
| <tr> |
| <td valign="top" align="right"> </td><td valign="top"> |
| <p> |
| Here are the Server Tools API changes that went into M2. |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" align="right"> </td><td valign="top"> |
| <p> |
| |
| <table> |
| |
| <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. |
| <br> |
| *Update* The extension point has been renamed to publishTask, and the class is |
| PublishTaskDelegate. This single extension point can be used to return multiple |
| PublishOperations at the module or server level, which are executed during the |
| publish.</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td>IServerConfiguration, IServerConfigurationWorkingCopy, 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 additional interface</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> |
| |
| </table> |
| |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" bgcolor="#0080c0" align="left" colspan="2"><b><font face="Arial,Helvetica" color="#ffffff">M3 Changes</font></b></td> |
| </tr> |
| <tr> |
| <td valign="top" align="right"> </td><td valign="top"> |
| <p> |
| Here are the Server Tools API changes that went into M3. |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" align="right"> </td><td valign="top"> |
| <p> |
| |
| <table> |
| |
| <tr> |
| |
| <th>Change</th> |
| <th>Reason</th> |
| <th>Old Code</th> |
| <th>New Code</th> |
| |
| </tr> |
| |
| <tr> |
| |
| <td>Remove serverAction extension point</td> |
| <td>Duplicate function exists in Eclipse v3.0</td> |
| <td class="code"><extension point="org.eclipse.wst.server.ui.serverActions"><br> |
| <serverAction id="org.eclipse.wst.server.ui.projects"<br> |
| typeIds="org.eclipse.jst.*"<br> |
| label="%actionModifyModules"<br> |
| category="control"<br> |
| icon="icons/ctool16/wiz_modify_modules.gif"<br> |
| order="50"<br> |
| class="org.eclipse.wst.server.ui.internal.actions.AddRemoveModulesAction"/><br> |
| </extension></td> |
| <td class="code"><extension point="org.eclipse.ui.popupMenus"><br> |
| <objectContribution<br> |
| id="org.eclipse.wst.server.ui.popupMenu"<br> |
| objectClass="org.eclipse.wst.server.core.IServer"<br> |
| adaptable="true"><br> |
| <filter name="typeIds" value="org.eclipse.jst.*"/><br> |
| <action<br> |
| id="org.eclipse.wst.server.ui.action.modifyModules"<br> |
| label="%actionModifyModules"<br> |
| icon="icons/ctool16/wiz_modify_modules.gif"<br> |
| class="org.eclipse.wst.server.ui.internal.actions.ModifyModulesAction"><br> |
| </action><br> |
| </objectContribution><br> |
| </extension></td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td>Remove objectClass attribute from moduleArtifactAdapter extension point and switch to expressions</td> |
| <td>Removal of IModuleArtifactAdapter class</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td>IElement and IElementWorkingCopy removed</td> |
| <td>There was no point having common code between IRuntime and IServer, since they didn't really have |
| any common structure. Existing methods moved to correct location in IRuntime, IServer, and their working copies.</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td>IModuleEvent and IModuleFactoryEvent changed to ModuleEvent and ModuleFactoryEvent</td> |
| <td>Event classes are not typically interfaces, and there was no reason to abstract these two classes.</td> |
| <td class="code">IModuleEvent<br>IModuleFactoryEvent</td> |
| <td class="code">ModuleEvent<br>ModuleFactoryEvent</td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td>IServerPreferences removed</td> |
| <td>IServerPreferences was not required as API and was not being used by external plugins. To clean up API, |
| it is being removed from the first API version.</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td>ServerBehaviourDelegate.setLaunchDefaults() renamed</td> |
| <td>ServerBehaviourDelegate.setLaunchDefaults() was renamed to ServerBehaviourDelegate.setupLaunchConfiguration(). |
| It is now called on every launch instead of just the first time. This allows servers to update the launch |
| configuration before it is executed.</td> |
| <td class="code"></td> |
| <td class="code"></td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td>org.eclipse.jst.server.j2ee package renamed</td> |
| <td>Package renamed/moved to org.eclipse.jst.server.core since the name was redundant (already in jst).</td> |
| <td class="code">import org.eclipse.jst.server.j2ee.*;</td> |
| <td class="code">import org.eclipse.jst.server.core.*;</td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td></td> |
| <td></td> |
| <td class="code"></td> |
| <td class="code"></td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td></td> |
| <td></td> |
| <td class="code"></td> |
| <td class="code"></td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td></td> |
| <td></td> |
| <td class="code"></td> |
| <td class="code"></td> |
| |
| </tr> |
| |
| </table> |
| |
| </p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </body> |
| </html> |