|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.wst.server.core.model.ServerDelegate
public abstract class ServerDelegate
A server delegate provides the implementation for various
generic and server-type-specific operations for a specific type of server.
A server delegate is specified by the
class
attribute of a serverTypes
extension.
When the server instance needs to be given a delegate, the delegate class
specified for the server type is instantiated with a 0-argument constructor
and primed with delegate.initialize(((IServerState)server)
,
which it is expected to hang on to. Later, when
delegate.dispose()
is called as the server instance is
being discarded, the delegate is expected to let go of the server instance.
ServerDelegate supports an open-ended set of attribute-value pairs. All state stored in this manner will be saved when the server working copy is saved, and persisted across workbench sessions. Server delegates may keep state in instance fields, but that state is transient and will not be persisted across workbench sessions. To save state across workbench sessions, it must be persisted using the attributes.
This abstract class is intended to be extended only by clients
to extend the serverTypes
extension point.
IServer
,
IServerWorkingCopy
Constructor Summary | |
---|---|
ServerDelegate()
Delegates must have a public 0-arg constructor. |
Method Summary | |
---|---|
abstract IStatus |
canModifyModules(IModule[] add,
IModule[] remove)
Returns whether the specified module modifications could be made to this server at this time. |
void |
configurationChanged()
This method is called whenever the server configuration folder has changed. |
void |
dispose()
Disposes of this server delegate. |
abstract IModule[] |
getChildModules(IModule[] module)
Returns the child module(s) of this module. |
abstract IModule[] |
getRootModules(IModule module)
Returns the parent module(s) of this module. |
IServer |
getServer()
Returns the server that this server delegate corresponds to. |
ServerPort[] |
getServerPorts()
Returns an array of ServerPorts that this server has. |
IServerWorkingCopy |
getServerWorkingCopy()
Returns the server working copy that this server delegate corresponds to. |
void |
importConfiguration(IRuntime runtime,
IProgressMonitor monitor)
Deprecated. should use importRuntimeConfiguration (which can throw a CoreException) instead |
void |
importRuntimeConfiguration(IRuntime runtime,
IProgressMonitor monitor)
This method is called to import the server configuration from the given runtime. |
abstract void |
modifyModules(IModule[] add,
IModule[] remove,
IProgressMonitor monitor)
Modifies the list of modules associated with the server. |
void |
saveConfiguration(IProgressMonitor monitor)
This method is called whenever the server configuration should be saved. |
void |
setDefaults(IProgressMonitor monitor)
Initializes this server with default values. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServerDelegate()
Method Detail |
---|
public final IServer getServer()
public final IServerWorkingCopy getServerWorkingCopy()
public void dispose()
This method is called by the web server core framework. Clients should never call this method.
Implementations are expected to let go of the delegate's reference to the server, deregister listeners, etc.
public abstract IStatus canModifyModules(IModule[] add, IModule[] remove)
IServerAttributes.canModifyModules(IModule[], IModule[], IProgressMonitor)
for further details.
This method is called by the web server core framework in response to
a call to IServer.canModifyModules
. It should return quickly
without connection to the server. Clients should never call this method.
add
- a possibly-empty list of modules to addremove
- a possibly-empty list of modules to remove
IStatus.OK
if the modules
can be modified, otherwise a status object indicating why they can'tIServerAttributes.canModifyModules(IModule[], IModule[], IProgressMonitor)
public abstract IModule[] getChildModules(IModule[] module)
This method should only return the direct children. To obtain the full tree of modules if they are multiple levels deep, this method may be recursively called on the children.
module
- a module
IServerAttributes.getChildModules(IModule[], IProgressMonitor)
public abstract IModule[] getRootModules(IModule module) throws CoreException
If the module type is not supported, this method will return null or an empty array. If the type is normally supported but there is a configuration problem or missing parent, etc., this method will fire a CoreException that may then be presented to the user.
If it does return valid parent(s), this method will always return the topmost parent module(s), even if there are a few levels (a heirarchy) of modules.
[issue: should the parameter be IModule[]?]
module
- a module
CoreException
- if anything went wrongIServerAttributes.getRootModules(IModule, IProgressMonitor)
public ServerPort[] getServerPorts()
public void setDefaults(IProgressMonitor monitor)
monitor
- a progress monitor, or null
if progress
reporting and cancellation are not desiredpublic abstract void modifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor) throws CoreException
IServerWorkingCopy.modifyModules(IModule[], IModule[], IProgressMonitor)
for further details.
This method is called by the web server core framework,
in response to a call to IServerWorkingCopy.modifyModules
.
Clients should never call this method.
This method is called to update the server configuration (if any) or update the delegates internal state. Note that the actual list of modules is stored on the server and can be accessed at any time using server.getModules(). getModules() will not be updated until after this method successfully returns.
This method will not communicate with the server. After saving, publish() can be used to sync up with the server.
add
- a possibly-empty list of modules to addremove
- a possibly-empty list of modules to removemonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
CoreException
- if the changes are not allowed or could not
be processedpublic void importConfiguration(IRuntime runtime, IProgressMonitor monitor)
runtime
- a server runtimemonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desiredpublic void importRuntimeConfiguration(IRuntime runtime, IProgressMonitor monitor) throws CoreException
runtime
- a server runtimemonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
CoreException
- if there is any problem importing the configuration
from the runtimepublic void saveConfiguration(IProgressMonitor monitor) throws CoreException
monitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
CoreException
- if there was a problem savingpublic void configurationChanged()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |