All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.server.ServerProcess

java.lang.Object
   |
   +----sun.server.ServerProcess

public class ServerProcess
extends Object
implements Runnable
A ServerProcess represents an OS process and can run one or more Service instances, each of which is associated with a protocol and a configuration.


Constructor Index

 o ServerProcess()

Method Index

 o getAutoStartServiceNames()
Get the list of automatically-started service names for a server.
 o getCurrentServerName()
Get the name of the current server.
 o getDefaultServiceConfiguration(String)
Get the default configuration for a service in a server.
 o getDescription()
Get a server description.
 o getOrderedServiceNames()
Get the order in which to display service names for a server.
 o getProperties()
Get the properties for a server.
 o getServer(String)
Get a server instance given its name.
 o getServerNames()
Get the list of server names.
 o getServerProperties()
Get the server's properties.
 o getService(String)
Get a service instance.
 o getServiceConfiguration(String, String)
Get the configuration for a service in a server.
 o getServiceNames()
Get the service names for a server.
 o getServiceNames(String)
Get the list of service names for a server.
 o getThreadGroup(String)
Get the thread group for a service.
 o isRoot()
Checks if the process is being run as (Posix) root.
 o isRunning()
Find out if the server is running.
 o isServiceRunning(String)
Check if a service is running in the current server.
 o main(String[])
Main function
 o restartCurrentServer()
Restart the current server process.
 o restartServer(String)
Restart a server process.
 o restartService(String, int)
Restart a single service in the current server.
 o run()
Periodically check whether there are any service threads running.
 o setGroup(String)
Sets the current group to the specified group name or group id.
 o setUser(String)
Sets the current user to the specified user name or user id.
 o startServer(String)
Start a server process.
 o startService(String)
Start up a service.
 o stopCurrentServer()
Stop the current server process.
 o stopServer(String)
Stop a server process.
 o stopService(String, boolean)
Stop a service.

Constructors

 o ServerProcess
 public ServerProcess()

Methods

 o main
 public static void main(String argv[])
Main function

 o run
 public void run()
Periodically check whether there are any service threads running. Current period is every five seconds.

 o getServerProperties
 public static Properties getServerProperties()
Get the server's properties.

 o getServerNames
 public static String[] getServerNames()
Get the list of server names.

Returns:
the server names
 o getServer
 public static ServerProcess getServer(String serverName)
Get a server instance given its name.

Parameters:
serverName - server name
Returns:
ServerProcess instance
 o getServiceNames
 public static String[] getServiceNames(String serverName)
Get the list of service names for a server.

Parameters:
serverName - the server whose services are to be listed
Returns:
the service names for the server
 o getCurrentServerName
 public static String getCurrentServerName()
Get the name of the current server.

Returns:
the name of the server for this process
 o restartCurrentServer
 public static void restartCurrentServer()
Restart the current server process.

 o stopCurrentServer
 public static void stopCurrentServer()
Stop the current server process.

 o restartServer
 public static void restartServer(String serverName)
Restart a server process.

Parameters:
serverName - the name of the server to restart
 o startServer
 public static void startServer(String serverName)
Start a server process.

Parameters:
serverName - the name of the server to start
 o stopServer
 public static void stopServer(String serverName)
Stop a server process.

Parameters:
serverName - the name of the server to stop
 o startService
 public static void startService(String serviceName) throws Exception
Start up a service. Adds to autostart list, and restarts server.

Parameters:
serviceName - the name of the service to stop
Throws: Exception
If the service cannot be started
 o stopService
 public static void stopService(String serviceName,
                                boolean realStop)
Stop a service. Remove from autostart list.

Parameters:
serviceName - the name of the service to stop
 o restartService
 public static void restartService(String serviceName,
                                   int newPort) throws Exception
Restart a single service in the current server.

Parameters:
serviceName - the short name of the service to restart
Throws: Exception
If the service cannot be restarted
 o isServiceRunning
 public static boolean isServiceRunning(String serviceName)
Check if a service is running in the current server.

Parameters:
serviceName - the service name
Returns:
true if service is running
 o getServiceConfiguration
 public static ServiceConfiguration getServiceConfiguration(String serverName,
                                                            String serviceName)
Get the configuration for a service in a server.

Returns:
the service configuration
 o getDefaultServiceConfiguration
 public static ServiceConfiguration getDefaultServiceConfiguration(String serviceName)
Get the default configuration for a service in a server.

Returns:
the default service configuration
 o getService
 public static Service getService(String serviceName)
Get a service instance.

Parameters:
serviceName - the name of the service to get
 o setUser
 protected static native boolean setUser(String user)
Sets the current user to the specified user name or user id.

Parameters:
user - the user name or id
Returns:
true if user was changed, false if permission denied
Throws: IllegalArgumentException
if the user name or id was invalid
 o setGroup
 protected static native boolean setGroup(String group)
Sets the current group to the specified group name or group id.

Parameters:
group - the group name or id
Returns:
true if group was changed, false if permission denied
Throws: IllegalArgumentException
if the group name or id was invalid
 o isRoot
 protected static native boolean isRoot()
Checks if the process is being run as (Posix) root. Allows for smarter error reporting and security precautions.

Returns:
true is process is being run as root, false if not.
 o getDescription
 public String getDescription()
Get a server description.

Parameters:
serverName - the server name
Returns:
the server description
 o getServiceNames
 public String[] getServiceNames()
Get the service names for a server.

Returns:
the service names
 o getProperties
 public ExProperties getProperties()
Get the properties for a server.

Returns:
the server properties
 o getAutoStartServiceNames
 public String[] getAutoStartServiceNames()
Get the list of automatically-started service names for a server.

Returns:
the autostarted service names
 o getOrderedServiceNames
 public String[] getOrderedServiceNames()
Get the order in which to display service names for a server.

Returns:
the ordered list of service names
 o isRunning
 public boolean isRunning()
Find out if the server is running.

Returns:
true if the server has a running process
 o getThreadGroup
 public static ThreadGroup getThreadGroup(String serviceName)
Get the thread group for a service.


All Packages  Class Hierarchy  This Package  Previous  Next  Index