Get a reference to the bean's home

In order to do anything with the bean, the client must obtain a reference to the bean's home interface. To do this, it looks up a well-known name via JNDI:
// Obtain a JNDI initial context
Context initContext = new InitialContext();

// Look up the home interface of the bean
Object accountBeanHome = initContext.lookup("JNDI_prefix/AccountBean");
// where:
// 'JNDI_prefix/' is the JNDI prefix on the CORBASERVER definition
// 'AccountBean' is the name of the bean in the XML deployment descriptor

// Convert to the correct type
AccountHome accountHome = (AccountHome) 
            PortableRemoteObject.narrow(accountBeanHome,AccountHome.class);