FileDocCategorySizeDatePackage
SupplyClient.javaAPI DocExample1004Sat Nov 25 11:54:30 GMT 2000None

SupplyClient

public class SupplyClient extends Object
This is a simple client that just lists the CDs and tracks.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		try {
			// Initialize the ORB
			ORB orb = ORB.init(argv, null);

			// Get the root naming context. Do NOT use "bind",
			// which is a VisiBroker non-standard extension.
			// (but a very convenient one!)
			org.omg.CORBA.Object objRef =
				orb.resolve_initial_references("NameService");
			NamingContext ncRef = NamingContextHelper.narrow(objRef);

			// Find an object that supports Supply
			NameComponent nc = new NameComponent("Supply", "");
			NameComponent path[] = {nc};
			Supply mySupply = SupplyHelper.narrow(ncRef.resolve(path));

			// Interact with Object
			int x = mySupply.dispenseCup();
		} catch (Exception e) {			// Any CORBA Exceptions?
			System.out.println("Error: " + e) ;
			e.printStackTrace(System.err);
		}