|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.wst.server.core.model.ServerBehaviourDelegate
public abstract class ServerBehaviourDelegate
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.
Server delegates may keep state in instance fields, but that state is transient and will not be persisted across workbench sessions.
This abstract class is intended to be extended only by clients
to extend the serverTypes
extension point.
IServer
,
IServerWorkingCopy
Field Summary | |
---|---|
static int |
ADDED
Publish kind constant (value 1) for added resources. |
static int |
CHANGED
Publish kind constant (value 2) for changed resources. |
static int |
NO_CHANGE
Publish kind constant (value 0) for no change. |
static int |
REMOVED
Publish kind constant (value 3) for removed resources. |
Constructor Summary | |
---|---|
ServerBehaviourDelegate()
Delegates must have a public 0-arg constructor. |
Method Summary | |
---|---|
boolean |
canControlModule(IModule[] module)
Returns whether the given module can be restarted. |
void |
dispose()
Disposes of this server delegate. |
IServer |
getServer()
Returns the server that this server delegate corresponds to. |
void |
handleResourceChange()
Called when resources change within the workspace. |
org.eclipse.core.runtime.IStatus |
publish(int kind,
org.eclipse.core.runtime.IProgressMonitor monitor)
Publish to the server. |
void |
restart(java.lang.String launchMode)
Restart this server. |
void |
restartModule(IModule[] module,
org.eclipse.core.runtime.IProgressMonitor monitor)
Restarts the given module on the server. |
void |
setupLaunchConfiguration(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy workingCopy,
org.eclipse.core.runtime.IProgressMonitor monitor)
Configure the given launch configuration to start this server. |
void |
startModule(IModule[] module,
org.eclipse.core.runtime.IProgressMonitor monitor)
Starts the given module on the server. |
abstract void |
stop(boolean force)
Shuts down and stops this server. |
void |
stopModule(IModule[] module,
org.eclipse.core.runtime.IProgressMonitor monitor)
Stops the given module on the server. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NO_CHANGE
publishModule(int, int, IModule[], IProgressMonitor)
,
Constant Field Valuespublic static final int ADDED
publishModule(int, int, IModule[], IProgressMonitor)
,
Constant Field Valuespublic static final int CHANGED
publishModule(int, int, IModule[], IProgressMonitor)
,
Constant Field Valuespublic static final int REMOVED
publishModule(int, int, IModule[], IProgressMonitor)
,
Constant Field ValuesConstructor Detail |
---|
public ServerBehaviourDelegate()
Method Detail |
---|
public final IServer getServer()
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 void setupLaunchConfiguration(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy workingCopy, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
workingCopy
- a launch configuration working copymonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
org.eclipse.core.runtime.CoreException
- if there is an error setting up the configurationpublic void restart(java.lang.String launchMode) throws org.eclipse.core.runtime.CoreException
launchMode
- the mode to restart in, one of the mode constants
defined by ILaunchManager
org.eclipse.core.runtime.CoreException
- if there was a problem restartingpublic boolean canControlModule(IModule[] module)
[issue: It's unclear whether this operations is guaranteed to be fast or whether it could involve communication with any actual server. If it is not fast, the method should take a progress monitor.]
module
- the module
true
if the given module can be
restarted, and false
otherwisepublic void startModule(IModule[] module, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
IServer.startModule(IModule[], IServer.IOperationListener)
for further details.
The implementation should update the module sync state and fire an event for the module.
This method will throw an exception if the module does not exist on the server.
[issue: Since this method is ascynchronous, is there any need for the progress monitor?]
module
- the module to be startedmonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
org.eclipse.core.runtime.CoreException
- if an error occurs while trying to restart the modulepublic void stopModule(IModule[] module, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
IServer.stopModule(IModule[], IServer.IOperationListener)
for further details.
The implementation should update the module sync state and fire an event for the module.
This method will throw an exception if the module does not exist on the server.
[issue: Since this method is ascynchronous, is there any need for the progress monitor?]
module
- the module to be stoppedmonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
org.eclipse.core.runtime.CoreException
- if an error occurs while trying to restart the modulepublic void restartModule(IModule[] module, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
IServer.restartModule(IModule[], IServer.IOperationListener)
for further details.
The implementation should update the module sync state and fire an event for the module.
This method will throw an exception if the module does not exist on the server.
[issue: Since this method is ascynchronous, is there any need for the progress monitor?]
module
- the module to be stoppedmonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
org.eclipse.core.runtime.CoreException
- if an error occurs while trying to restart the modulepublic abstract void stop(boolean force)
If force is false
, it will attempt to stop the server
normally/gracefully. If force is true
, then the server
process will be terminated any way that it can.
[issue: There is no way to communicate failure to the client. Given that this operation can go awry, there probably should be a mechanism that allows failing asynch operations to be diagnosed.]
force
- true
to kill the server, or false
to stop normallypublic org.eclipse.core.runtime.IStatus publish(int kind, org.eclipse.core.runtime.IProgressMonitor monitor)
kind
- the publish kindmonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
public void handleResourceChange()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |