import java.util.*;
import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;

import jwsunleashed.trading.ejb.*;

public class TestTrading
{
    public static void main(String[] args)
    {
        try
        {
            Context context = new InitialContext();

            TradingHome home = (TradingHome) PortableRemoteObject.narrow(
                context.lookup("ejb/TradingHome"), TradingHome.class);

            Trading trading = home.create("mark", "secret");

            trading.buy("SUNW", 100, 2000);
        
        }
        catch (Exception exc)
        {
            exc.printStackTrace();
        }
    }
}
