// CustomerClient.java
// mini Client for accessing bean Customer

package org.objectweb.jonas.stests.appli;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;

/**
 *
 */
public class CustomerClient {

    static Context ctx = null; 
    static CustomerHome home = null;

    public static void main(String[] arg) {

	// Get InitialContext
	try {
	    ctx = new InitialContext();
	} catch (NamingException e) {
	    e.printStackTrace();
	    System.exit(2);
	}

	// Lookup bean home 
	String bName = "CustomerHome";
	try {
	    home = (CustomerHome) PortableRemoteObject.narrow(ctx.lookup(bName), CustomerHome.class);

	} catch(Exception e) {
	    e.printStackTrace();
	    System.exit(2);
	}

	// ...
    }
}
