org.eclipse.wst.server.core
Class ServerCore
java.lang.Object
org.eclipse.wst.server.core.ServerCore
-
public final class ServerCore
- extends java.lang.Object
Main class for server core API.
This class provides API to access most of the types in the server
framework, including server runtimes and servers.
The methods on this class are thread safe.
This class provides all its functionality through static members.
It is not intended to be subclassed or instantiated.
-
Since:
- 1.0
Methods inherited from class java.lang.Object
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
getProjectProperties
public static
IProjectProperties getProjectProperties(IProject project)
-
Deprecated. Project facet support should now be used instead of this API. @see
org.eclipse.wst.common.project.facet.core.IFacetedProject#getRuntime()
- Returns the preference information for the project. The project may not
be null.
-
-
Parameters:
-
project
- a project
-
Returns:
- the properties of the project
getRuntimeTypes
public static
IRuntimeType[] getRuntimeTypes()
- Returns an array of all known runtime types.
A new array is returned on each call, so clients may store or modify the result.
-
-
Returns:
- the array of runtime types
IRuntimeType
findRuntimeType
public static
IRuntimeType findRuntimeType(java.lang.String id)
- Returns the runtime type with the given id, or
null
if none. This convenience method searches the list of known
runtime types (
getRuntimeTypes()
) for the one with a matching
runtime type id (
IRuntimeType.getId()
). The id may not be null.
-
-
Parameters:
-
id
- the runtime type id
-
Returns:
- the runtime type, or
null
if there is no runtime type
with the given id
getServerTypes
public static
IServerType[] getServerTypes()
- Returns an array of all known server types.
A new array is returned on each call, so clients may store or modify the result.
-
-
Returns:
- the array of server types
IServerType
findServerType
public static
IServerType findServerType(java.lang.String id)
- Returns the server type with the given id, or
null
if none. This convenience method searches the list of known
server types (
getServerTypes()
) for the one with a matching
server type id (
IServerType.getId()
). The id may not be null.
-
-
Parameters:
-
id
- the server type id
-
Returns:
- the server type, or
null
if there is no server type
with the given id
findRuntime
public static
IRuntime findRuntime(java.lang.String id)
- Returns the runtime with the given id, or
null
if none. This convenience method searches the list of known
runtimes (
getRuntimes()
) for the one with a matching
runtime id (
IRuntime.getId()
). The id may not be null.
-
-
Parameters:
-
id
- the runtime id
-
Returns:
- the runtime instance, or
null
if there is no runtime
with the given id
getRuntimes
public static
IRuntime[] getRuntimes()
- Returns an array of all known runtime instances. The list will not contain any
working copies.
A new array is returned on each call, so clients may store or modify the result.
-
-
Returns:
- a possibly-empty array of runtime instances
IRuntime
findServer
public static
IServer findServer(java.lang.String id)
- Returns the server with the given id, or
null
if none. This convenience method searches the list of known
servers (
getServers()
) for the one with a matching
server id (
IServerAttributes.getId()
). The id must not be null.
-
-
Parameters:
-
id
- the server id
-
Returns:
- the server instance, or
null
if there is no server
with the given id
getServers
public static
IServer[] getServers()
- Returns an array of all known server instances. The array will not include any
working copies.
A new array is returned on each call, so clients may store or modify the result.
-
-
Returns:
- a possibly-empty array of server instances
IServer
addRuntimeLifecycleListener
public static void addRuntimeLifecycleListener(
IRuntimeLifecycleListener listener)
- Adds a new runtime lifecycle listener.
Has no effect if an identical listener is already registered.
-
-
Parameters:
-
listener
- a runtime lifecycle listener -
See Also:
-
removeRuntimeLifecycleListener(IRuntimeLifecycleListener)
removeRuntimeLifecycleListener
public static void removeRuntimeLifecycleListener(
IRuntimeLifecycleListener listener)
- Removes a runtime lifecycle listener.
Has no effect if the listener is not registered.
-
-
Parameters:
-
listener
- a runtime lifecycle listener -
See Also:
-
addRuntimeLifecycleListener(IRuntimeLifecycleListener)
addServerLifecycleListener
public static void addServerLifecycleListener(
IServerLifecycleListener listener)
- Adds a new server lifecycle listener.
Has no effect if an identical listener is already registered.
-
-
Parameters:
-
listener
- a server lifecycle listener -
See Also:
-
removeServerLifecycleListener(IServerLifecycleListener)
removeServerLifecycleListener
public static void removeServerLifecycleListener(
IServerLifecycleListener listener)
- Removes a server lifecycle listener.
Has no effect if the listener is not registered.
-
-
Parameters:
-
listener
- a server lifecycle listener
#addServerLifecycleListener(IServerLifecycleListener)
getDefaultServer
public static
IServer getDefaultServer(
IModule module)
- Returns the preferred runtime server for the given module. This method
returns null if the server was never chosen or does not currently exist. (if the
server is recreated or was in a closed project, etc. this method will return
the original value if it becomes available again)
-
-
Parameters:
-
module
- a module
-
Returns:
- the current default server, or
null
if there is no
default server
setDefaultServer
public static void setDefaultServer(
IModule module,
IServer server,
IProgressMonitor monitor)
throws CoreException
- Sets the preferred runtime server for the given module. Set the server to
null to clear the setting. If there is a problem saving the file, a CoreException
will be thrown.
-
-
Parameters:
-
module
- the module to set the default for -
server
- the server to set the default server, or null
to unset the default -
monitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
-
Throws:
-
CoreException
- if there is a problem setting the default server
isAutoPublishing
public static boolean isAutoPublishing()
- Returns
true
if the preference is set to automatically
publish when starting servers, or false
otherwise
-
-
Returns:
-
true
if the preference is set to automatically
publish when starting servers, or false
otherwise -
Since:
- 3.0