// StockClient.java
// mini Client for accessing bean Stock

package org.objectweb.jonas.stests.appli;

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

/**
 *
 */
public class StockClient {

    static Context ctx = null; 
    static StockHome 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 = "StockHome";
	try {
	    home = (StockHome) PortableRemoteObject.narrow(ctx.lookup(bName), StockHome.class);
 
	} catch(Exception e) {
	    e.printStackTrace();
	    System.exit(2);
	}

	// ...
    }
}
