| java.lang.Object com.sun.midp.main.NamsTestService
NamsTestService | public class NamsTestService implements EventListener,Runnable(Code) | | A service for testing the Native AMS (nams). Listens on a socket and
processes commands by calling native methods that invoke the native AMS
API. Receives Native AMS callbacks and sends the information out through
the socket.
|
PORT | final static int PORT(Code) | | |
NamsTestService | NamsTestService(ServerSocketConnection s, EventQueue eq)(Code) | | Constructor for the test service. Starts the listener thread and
registers itself as a listener for test events.
|
check | Integer check(String[] argv, int rqd, int idx)(Code) | | A simple argument checking function. Given an argument array argv,
ensures that it is exactly rqd elements long, and then attempts to
parse argument idx as an integer. If all of these are successful, the
parsed integer value is returned in an Integer object. Otherwise, null
is returned.
|
d | static void d(String s)(Code) | | Prints string s to stdout, prefixed by PFX.
|
init | public static void init(SecurityToken token, EventQueue eq)(Code) | | Initializes the nams service. Sets up translation of native callbacks
into events, opens up a socket, and creates the service.
|
preprocess | public boolean preprocess(Event event, Event waitingEvent)(Code) | | Preprocesses events. Does no preprocessing, so always returns true.
|
process | public void process(Event event)(Code) | | Processes test events. Decodes the event and sends the information out
through the socket.
|
processLine | void processLine(String[] sa)(Code) | | Processes a command and its arguments.
|
readLines | void readLines()(Code) | | Reads lines of input from the socket and processes them. Reads as long
as the 'reading' boolean is true, then returns.
|
readSocket | void readSocket(SocketConnection sock)(Code) | | Opens input and output streams from a fresh connection, then processes
input from the socket. Closes and cleans up after input processing
completes.
|
run | public void run()(Code) | | The socket listener loop. Awaits a connection, processes requests from
the connection, then goes back to waiting, forever.
|
tokenize | String[] tokenize(String st)(Code) | | Tokenizes a string in a simple fashion. Given a line of input, returns
an array of strings containing tokens. A token consists of a sequence
of nonblank characters. Tokens are separated by one or more blanks.
|
|
|