Methods Summary |
---|
public static Context | getStubFromServer(java.lang.String serverName)
return getStubFromServer(serverName, BOOTSTRAP_PORT_NUMBER);
|
public static Context | getStubFromServer(java.lang.String serverName, int portNumber)
Context returnValue = null;
try {
Socket socket = new Socket(serverName, portNumber);
ObjectInputStream objectInputStream = new ObjectInputStream(socket.getInputStream());
returnValue = (Context) objectInputStream.readObject();
} catch (Exception e) {
System.out.println("Stub note available");
e.printStackTrace();
}
return returnValue;
|
public void | vendStubViaSocket()
vendStubViaSocket(BOOTSTRAP_PORT_NUMBER);
|
public void | vendStubViaSocket(int portNumber)
StubSender stubSender = new StubSender(this);
Thread stubSenderThread = new Thread(stubSender);
stubSenderThread.setName("Stub sender thread");
stubSenderThread.start();
StubSocketListener socketListener = new StubSocketListener(portNumber, stubSender);
Thread socketListenerThread = new Thread(socketListener);
socketListenerThread.setName("Socket Listener thread");
socketListenerThread.start();
|