org.eclipse.wst.server.core
Class ServerCore

java.lang.Object
  extended byorg.eclipse.wst.server.core.ServerCore

public 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. Methods ** 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.

Caveat: The server core API is still in an early form, and is likely to change significantly before the initial release.

Since:
1.0

Method Summary
static void addRuntimeLifecycleListener(IRuntimeLifecycleListener listener)
          Adds a new runtime lifecycle listener.
static void addServerLifecycleListener(IServerLifecycleListener listener)
          Adds a new server lifecycle listener.
static IRuntime findRuntime(java.lang.String id)
          Returns the runtime with the given id, or null if none.
static IRuntimeTargetHandler findRuntimeTargetHandler(java.lang.String id)
          Returns the runtime target handler with the given id, or null if none.
static IRuntimeType findRuntimeType(java.lang.String id)
          Returns the runtime type with the given id, or null if none.
static IServer findServer(java.lang.String id)
          Returns the server with the given id, or null if none.
static IServerType findServerType(java.lang.String id)
          Returns the server type with the given id, or null if none.
static IProjectProperties getProjectProperties(IProject project)
          Returns the preference information for the project.
static IRuntime[] getRuntimes()
          Returns an array of all known runtime instances.
static IRuntimeTargetHandler[] getRuntimeTargetHandlers()
          Returns an array of all known runtime target handler instances.
static IRuntimeType[] getRuntimeTypes()
          Returns an array of all known runtime types.
static IServer[] getServers()
          Returns an array of all known server instances.
static IServerType[] getServerTypes()
          Returns an array of all known server types.
static void removeRuntimeLifecycleListener(IRuntimeLifecycleListener listener)
          Removes a runtime lifecycle listener.
static void removeServerLifecycleListener(IServerLifecycleListener listener)
          Removes a server lifecycle listener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getProjectProperties

public static IProjectProperties getProjectProperties(IProject project)
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

getRuntimeTargetHandlers

public static IRuntimeTargetHandler[] getRuntimeTargetHandlers()
Returns an array of all known runtime target handler instances.

A new array is returned on each call, so clients may store or modify the result.

Returns:
a possibly-empty array of runtime target handler instances IRuntimeTargetHandler

findRuntimeTargetHandler

public static IRuntimeTargetHandler findRuntimeTargetHandler(java.lang.String id)
Returns the runtime target handler with the given id, or null if none. This convenience method searches the list of known runtime target handlers (getRuntimeTargetHandlers()) for the one with a matching runtime target handler id (IRuntimeTargetHandler.getId()). The id may not be null.

Parameters:
id - the runtime target handler id
Returns:
the runtime target handler instance, or null if there is no runtime target handler 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)