org.cougaar.tools.server |
Notes on the app-server
Notes on the app-server
The "App-Server" is an application server (daemon) that allows
remote clients to:
- launch and kill processes, plus listen for the output
of those processes
- access the file system to read and write files
- list running processes on the system ("ps")
As of Cougaar 9.0 there is little security built into the
server, so use at your own risk. If the
machines are behind a firewall then you're probably okay...
The AppServer is the "main" program to launch the
server. The default port address is 8484. ".props" filenames
that are specified as arguments are loaded by the server and
used to set default process properties.
The RemoteHostRegistry allows a remote client to lookup
an app-server on a specified (host:port) address.
There are several example app-server clients:
-
The "org.cougaar.tools.server.examples" package, with source under
"server/examples/*", contains two example consoles:
- "MinConsole", which is a command-line test rig
- "GuiConsole", which is simple Swing-based UI
-
The "CSMARTConsole", which is integrated into CSMART.
-
The "Manager", which is in the "manager" module.
FIXME:
The interfaces have a lot of "throws Exception" in them, which
is messy. With a little work most of these methods could probably
become something more specific, such as "throws IOException".
|
Java Source File Name | Type | Comment |
AppServer.java | Class | Main class to launch the app-server. |
DualStreamBuffer.java | Class | This utility-class is a buffer for capturing system-out and
system-error output to a byte[], plus reading the captured
output back with the interleaved write-ordering preserved.
Example usage:
// create streams
DualStreamBuffer dsb = new DualStreamBuffer();
PrintStream pout = new PrintStream(dsb.getOutputStream(true));
PrintStream perr = new PrintStream(dsb.getOutputStream(false));
// use streams as usual
pout.print("example std-out");
perr.print("some error");
pout.print("more std-out");
// replay to standard-out and standard-err
dsb.writeTo(System.out, System.err);
The internal representation has been optimized to make
both appending and the writeTo(*) methods efficient
(memory + time).
NOTE: this class is not internally thread-safe! If
multiple threads need access to the same DualStreamBuffer
instance then they must externally synchronized their
actions. |
NodeEvent.java | Class | An event that occured in the Node and sent to the client via
OutputListener.
Soon to be deprecated -- see NodeEventTranslator. |
NodeEventTranslator.java | Class | This is a temporary translator class for
OutputBundles to Lists of NodeEvents. |
OutputBundle.java | Class | An OutputBundle is a chunk of output from
the remote process that is sent to the client. |
OutputListener.java | Interface | Direct method-invocation API for a client to listen for output
from a RemoteProcess. |
OutputPolicy.java | Class | Immutable class that allows the client to indicate its listening
preferences to the server (buffering, frequency, etc). |
ProcessDescription.java | Class | Immutable description for a remote process. |
RemoteFileSystem.java | Interface | |
RemoteHost.java | Interface | Client support from a particular host:port to access that host,
including the capability to create remote processes. |
RemoteHostRegistry.java | Class | Registry for app-servers. |
RemoteListenable.java | Interface | Client support to watch remote process activity. |
RemoteListenableConfig.java | Class | Snapshot for RemoteListenable creation. |
RemoteProcess.java | Interface | Client support for a remote Process running on the server. |
RemoteProcessManager.java | Interface | Client support from a host to create remote processes. |
URLListener.java | Class | Client adapter (server) that listens on a port for URL
connections keeps a map of (path, OutputListener) pairs. |