客户端代码是非常简单的,下面是你能创建的最小的客户端程序。
// Client.java
public class Client
{
public static void main(String[] args)
{
Counter.Count count = null;
org.omg.CORBA.ORB orb = null;
// Initialize the ORB
orb = org.omg.CORBA.ORB.init();
// Bind to the object on the server
count = Counter.CountHelper.bind(orb, "test");
// Call the server functions
count.increment();
System.out.println("Current Count = " + count.getCounter());
// clean up
count = null;
orb.shutdown();
}
}