|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
org.radrails.server.core.Server
This class represents a web server that is capable of running Rails
applications. It is an observable object, and is observed by the ServersView
class.
Instead of traditional setXXX
methods, updateXXX
methods are provided. These update methods will set the attribute and then
notify all observers of the change.
Subclasses must implement the start
and stop
methods. Subclasses should also create static factory methods to create
instances of themselves, such as createMyServer
.
Method Summary | |
java.lang.String |
getEnvironment()
|
java.lang.String |
getName()
|
java.lang.String |
getPort()
|
java.io.File |
getProject()
|
java.lang.String |
getStatus()
|
java.lang.String |
getType()
|
boolean |
isStarted()
|
boolean |
isStopped()
|
abstract void |
start()
Starts the server. |
abstract void |
stop()
Stops the server. |
void |
touch()
Sets the changed flag. |
void |
updateEnvironment(java.lang.String environment)
Sets the environment of the server and notifies observers of the change. |
void |
updateName(java.lang.String name)
Sets the name of the server and notifies observers of the change. |
void |
updatePort(java.lang.String port)
Sets the port number of the server and notifies observers of the change. |
void |
updateStatus(java.lang.String status)
Sets the status of the server and notifies observers of the change. |
Methods inherited from class java.util.Observable |
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public java.io.File getProject()
public java.lang.String getName()
public java.lang.String getPort()
public java.lang.String getType()
public java.lang.String getEnvironment()
public java.lang.String getStatus()
public void updatePort(java.lang.String port)
port
- the number of the port the server operates onpublic void updateName(java.lang.String name)
name
- the name of the serverpublic void updateEnvironment(java.lang.String environment)
ENV_XXX
environment
- the environment of the serverpublic void updateStatus(java.lang.String status)
IServerConstants.STARTED
or
IServerConstants.STOPPED
status
- the status of the serverpublic void touch()
notifyObservers()
method explicitly.
public boolean isStarted()
IServerConstants.STARTED
, false otherwise.public boolean isStopped()
IServerConstants.STOPPED
, false otherwise.public abstract void start()
setChanged
and
notifyObservers
after the server is started.
Pass {IServerConstants.UPDATE
as the second argument to
notifyObservers
.
public abstract void stop()
setChanged
and
notifyObservers
after the server is started.
Pass IServerConstants.UPDATE
as the second argument to
notifyObservers
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |