org.jboss.jbossas.servermanager
Class Server

java.lang.Object
  extended by org.jboss.jbossas.servermanager.Server

public class Server
extends Object

A Server.

Version:
$Revision: 76538 $
Author:
Ryan Campbell

Field Summary
static String JBOSS_SERVER_CONFIG_DIR_NAME
          the directory where server config instances live
static String JBOSS_SERVER_DEPLOY_DIR_NAME
          the hot deployment directory
 
Constructor Summary
Server()
           
 
Method Summary
 void addArg(Argument arg)
          Add an argument.
 void addJvmArg(Argument arg)
          Add a jvm arg.
 void addSysProperty(Property property)
          Add a system property.
 String getArgs()
          Get the arguments as a string for the command line.
 String getConfig()
          Get the config.
 File getErrorLog()
          Where should the server's std err log go?
 PrintWriter getErrorWriter()
          The error log's writer.
 String getHost()
          Get the host.
 Integer getHttpPort()
          Get the httpPort.
 URL getHttpUrl()
          Where is the HTTP service listening?
 String getJvmArgs()
          Get the JVM args for the command line.
 String getName()
          Get the name.
 Context getNamingContext()
          Get the Naming Context.
 File getOutputLog()
          Where should the servers's std out go?
 PrintWriter getOutWriter()
          The writer for the output log.
 String getPassword()
          Get password to pass to org.jboss.Shutdown using the -p option.
 Process getProcess()
          Get the process.
 Integer getRmiPort()
          Get the rmiPort
 String getRmiUrl()
          The URl for the RMI listener.
 String getSysProperties()
          Get the system properties for the command line.
 String getSysProperty(String key)
          Get a single system property.
 String getUsername()
          Get username to pass to org.jboss.Shutdown using the -u option.
 boolean hasWebServer()
          Get the hasWebServer.
 boolean isRunning()
          Is the server actually running?
 boolean isStopped()
          Has the server been intentionally stopped?
 void setConfig(String config)
          Set the config.
 void setErrorWriter(PrintWriter errorlog)
          Set the error writer.
 void setHasWebServer(boolean hasWebServer)
          Set the hasWebServer.
 void setHost(String host)
          Set the host.
 void setHttpPort(Integer httpPort)
          Set the httpPort.
protected  void setManager(ServerManager manager)
          Set the manager.
 void setName(String name)
          Set the name.
 void setNamingContext(Context namingContext)
          Set the NamingContext in case the default is inadequate.
 void setOutWriter(PrintWriter outlog)
          Set the output log's writer
 void setPassword(String password)
          Set password to pass to org.jboss.Shutdown using the -p option.
 void setProcess(Process process)
          The running process of this server.
 void setRmiPort(Integer rmiPort)
          Set the rmiPort.
 void setUsername(String username)
          Set username to pass to org.jboss.Shutdown using the -u option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JBOSS_SERVER_CONFIG_DIR_NAME

public static final String JBOSS_SERVER_CONFIG_DIR_NAME
the directory where server config instances live

See Also:
Constant Field Values

JBOSS_SERVER_DEPLOY_DIR_NAME

public static final String JBOSS_SERVER_DEPLOY_DIR_NAME
the hot deployment directory

See Also:
Constant Field Values
Constructor Detail

Server

public Server()
Method Detail

getName

public String getName()
Get the name.

Returns:
the name.

setName

public void setName(String name)
Set the name.

Parameters:
name - The name to set.

getUsername

public String getUsername()
Get username to pass to org.jboss.Shutdown using the -u option.

Returns:
the server jmx username

setUsername

public void setUsername(String username)
Set username to pass to org.jboss.Shutdown using the -u option.

Parameters:
username - the server jmx username

getPassword

public String getPassword()
Get password to pass to org.jboss.Shutdown using the -p option.

Returns:
the server jmx password

setPassword

public void setPassword(String password)
Set password to pass to org.jboss.Shutdown using the -p option.

Parameters:
password - the server jmx password

setManager

protected void setManager(ServerManager manager)
Set the manager.

Parameters:
manager -

addArg

public void addArg(Argument arg)
Add an argument.

Parameters:
arg -

getArgs

public String getArgs()
Get the arguments as a string for the command line.

Returns:
the arguments as a string

addJvmArg

public void addJvmArg(Argument arg)
Add a jvm arg.

Parameters:
arg -

getJvmArgs

public String getJvmArgs()
Get the JVM args for the command line.

Returns:
the arguments as a string

addSysProperty

public void addSysProperty(Property property)
Add a system property.

Parameters:
property -

getSysProperty

public String getSysProperty(String key)
Get a single system property.

Returns:
a System property

getSysProperties

public String getSysProperties()
Get the system properties for the command line.

Returns:
the properties as a string

setProcess

public void setProcess(Process process)
The running process of this server.

Parameters:
process -

isRunning

public boolean isRunning()
Is the server actually running?

Returns:
whether the server is running

isStopped

public boolean isStopped()
Has the server been intentionally stopped?

Returns:
whether the server is stopped

getProcess

public Process getProcess()
Get the process.

Returns:
the process

getHttpUrl

public URL getHttpUrl()
               throws MalformedURLException
Where is the HTTP service listening?

Returns:
whether the service is listening
Throws:
MalformedURLException - for a malformed url

getRmiUrl

public String getRmiUrl()
The URl for the RMI listener.

Returns:
the rmi url

getConfig

public String getConfig()
Get the config. Defaults to the server name.

Returns:
the config.

setConfig

public void setConfig(String config)
Set the config.

Parameters:
config - The config to set.

getHost

public String getHost()
Get the host.

Returns:
the host.

setHost

public void setHost(String host)
Set the host.

Parameters:
host - The host to set.

getHttpPort

public Integer getHttpPort()
Get the httpPort.

Returns:
the http port

setHttpPort

public void setHttpPort(Integer httpPort)
Set the httpPort.

Parameters:
httpPort - The httpPort to set.

setRmiPort

public void setRmiPort(Integer rmiPort)
Set the rmiPort.

Parameters:
rmiPort - The rmiPort to set.

getRmiPort

public Integer getRmiPort()
Get the rmiPort

Returns:
the rmi port

getErrorLog

public File getErrorLog()
Where should the server's std err log go?

Returns:
the error log file

getOutputLog

public File getOutputLog()
Where should the servers's std out go?

Returns:
the output log file

setOutWriter

public void setOutWriter(PrintWriter outlog)
Set the output log's writer

Parameters:
outlog - the log writer

getOutWriter

public PrintWriter getOutWriter()
The writer for the output log.

Returns:
the output writer

getErrorWriter

public PrintWriter getErrorWriter()
The error log's writer.

Returns:
the log writer

setErrorWriter

public void setErrorWriter(PrintWriter errorlog)
Set the error writer.

Parameters:
errorlog -

hasWebServer

public boolean hasWebServer()
Get the hasWebServer.

Returns:
the hasWebServer.

setHasWebServer

public void setHasWebServer(boolean hasWebServer)
Set the hasWebServer.

Parameters:
hasWebServer - The hasWebServer to set.

getNamingContext

public Context getNamingContext()
                         throws NamingException
Get the Naming Context.

Returns:
the namingContext.
Throws:
NamingException

setNamingContext

public void setNamingContext(Context namingContext)
Set the NamingContext in case the default is inadequate.

Parameters:
namingContext -


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.