Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.vrspace.util
Class Console  view Console download Console.java

java.lang.Object
  extended byorg.vrspace.util.Console
All Implemented Interfaces:
java.util.Observer, java.lang.Runnable

public class Console
extends java.lang.Object
implements java.lang.Runnable, java.util.Observer

A simple console, able to connect to server.
Uses following properties to connect:
vrspace.host - default: localhost
vrspace.port - default: 8500
vrspace.login - default: guest
vrspace.password - default: guest
vrspace.command - command to execute & quit - default:none
Propmts on stdin for unset properties.


Field Summary
 Connection connection
           
 java.lang.String host
           
 java.io.BufferedReader input
           
 java.lang.String login
           
 java.io.PrintStream output
           
 java.lang.String password
           
 int port
           
 
Constructor Summary
Console()
           
 
Method Summary
 void attemptLogin()
           
 void login()
           
static void main(java.lang.String[] args)
           
 void print(java.lang.String s)
           
 void run()
          This method will be called by whoever wishes to run your class implementing Runnable.
 void update(java.util.Observable conn, java.lang.Object arg)
          This method is called whenever the observable object changes, and has called notifyObservers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

host

public java.lang.String host

port

public int port

login

public java.lang.String login

password

public java.lang.String password

connection

public Connection connection

input

public java.io.BufferedReader input

output

public java.io.PrintStream output
Constructor Detail

Console

public Console()
Method Detail

main

public static void main(java.lang.String[] args)

print

public void print(java.lang.String s)

login

public void login()

attemptLogin

public void attemptLogin()
                  throws ConnectionException,
                         java.io.IOException

run

public void run()
Description copied from interface: java.lang.Runnable
This method will be called by whoever wishes to run your class implementing Runnable. Note that there are no restrictions on what you are allowed to do in the run method, except that you cannot throw a checked exception.

Specified by:
run in interface java.lang.Runnable

update

public void update(java.util.Observable conn,
                   java.lang.Object arg)
Description copied from interface: java.util.Observer
This method is called whenever the observable object changes, and has called notifyObservers. The Observable object can pass arbitrary information in the second parameter.

Specified by:
update in interface java.util.Observer