Skip to main content
summaryrefslogtreecommitdiffstats
blob: 64cf94665ee9460688de7d863531e445c8658842 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**********************************************************************
 * Copyright (c) 2004 IBM Corporation and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 *
 * Contributors:
 *    IBM - Initial API and implementation
 **********************************************************************/
package org.eclipse.wst.server.core;

import org.eclipse.wst.server.core.model.IModule;
/**
 * Interface providing privileged access for setting the state of 
 * a server instance.
 * <p>
 * Objects of this type are passed to IServerDelegate.initialize.
 * </p>
 * <p>
 * [issue: This is pure SPI. Should be in org.eclipse.wst.server.core.model package.]
 * </p>
 * <p>
 * [issue: This API is vulnerable to abuse. Any client with an IServer
 * can cast it to an IServerState and call these methods. A more secure
 * way to achieve the same thing is to have IServerState provide an extra
 * getServer() method rather than extend IServer. That way, casting an
 * IServer is not an option.]
 * </p>
 * <p>This interface is not intended to be implemented by clients.</p>
 * <p>
 * <it>Caveat: The server core API is still in an early form, and is
 * likely to change significantly before the initial release.</it>
 * </p>
 * 
 * @see org.eclipse.wst.server.core.model.IServerDelegate#initialize(IServerState)
 * @since 1.0
 */
public interface IServerState extends IServer {
	
	/**
	 * Sets the current state of this server.
	 * <p>
	 * [issue: byte is rarely used in Java. Use int instead.]
	 * </p>
	 *
	 * @param state one of the server state (<code>SERVER_XXX</code>)
	 * constants declared on {@link IServer}
	 * @see IServer#getServerState()
	 */
	public void setServerState(byte state);

	/**
	 * Sets the server restart state.
	 *
	 * @param state boolean
	 */
	public void setRestartNeeded(boolean state);

	/**
	 * Sets the configuration sync state.
	 *
	 * @param state byte
	 */
	public void setConfigurationSyncState(byte state);

	/**
	 * Hook to fire an event when a module state changes.
	 * 
	 * @param module
	 * @param state
	 */
	public void updateModuleState(IModule module);
}

Back to the top