git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
39 lines
999 B
Java
39 lines
999 B
Java
import java.io.*;
|
|
import org.omg.CORBA.*;
|
|
import EuropaAI.*;
|
|
|
|
class EuropaServant extends _EuropaImplBase {
|
|
public void inputChat(String text) {
|
|
System.out.println(text);
|
|
}
|
|
}
|
|
|
|
public class ai {
|
|
public static void main(String args[]) {
|
|
try {
|
|
ORB orb = ORB.init(args, null);
|
|
|
|
// create the servant and register it
|
|
EuropaServant europaRef = new EuropaServant();
|
|
orb.connect(europaRef);
|
|
|
|
// stringify the europaRef and dump to an ior file
|
|
String str = orb.object_to_string(europaRef);
|
|
FileOutputStream fos = new FileOutputStream("ai.ior");
|
|
PrintStream ps = new PrintStream(fos);
|
|
ps.print(str);
|
|
ps.close();
|
|
|
|
// wait for invocations from clients
|
|
java.lang.Object sync = new java.lang.Object();
|
|
synchronized (sync) {
|
|
sync.wait();
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
System.err.println("Error: " + e);
|
|
e.printStackTrace(System.out);
|
|
}
|
|
}
|
|
}
|