FileDocCategorySizeDatePackage
Client_3.javaAPI DocExample1472Sat Mar 06 09:47:18 GMT 1999com.titan.travelagent

Client_3

public class Client_3 extends Object

Fields Summary
Constructors Summary
Methods Summary
public static javax.naming.ContextgetInitialContext()


        Properties p = new Properties();
        // ... specify the JNDI properties specific to the vendor
        return new javax.naming.InitialContext(p);
    
public static voidgetTheEJBHome(TravelAgent agent)


            // the home interface is out of scope in this method
            // so it must be obtained from the EJB object
            TravelAgentHome home = (TravelAgentHome) agent.getEJBHome( );
            // do something useful with the home interface
        
public static voidmain(java.lang.String[] args)

        try{
            Context jndiContext = getInitialContext();
            TravelAgentHome home =
             (TravelAgentHome)jndiContext.lookup("TravelAgentHome");

            // get a remote reference to the bean (EJB object)
            TravelAgent agent = home.create();
            // pass the remote reference to some method
            getTheEJBHome(agent);

            }catch(java.rmi.RemoteException re){re.printStackTrace();}
             catch(Throwable t){t.printStackTrace();}