Initial import of the ircii-pana-1.1-final source tree.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
38
dll/europa/corba/ai.java
Normal file
38
dll/europa/corba/ai.java
Normal file
@@ -0,0 +1,38 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user