Wo ist der JNDI-name in meinem code?

Habe ich einen EJB2.0 mit Eclipse 3.7 IDE, und implementiert es in der JBoss 5 application server (mein bean-name-Produkt). Ich mache das normale Kontext-lookup (und andere Sachen zu nennen, ejb), und ich bin in der Lage zu nennen, EJB erfolgreich. Nun ist meine Frage, was ist der JNDI-name, genau, und wo wurde es verwendet. Ist mein bean name der JNDI-name, oder ist dies mein JNDI-Namen -> org.jnp.interfaces.NamingContextFactory. Wo ist der JNDI-name?????
mein code:-

//initial code.............
Context  ctx = getContext();
Object obj=ctx.lookup("Product");
ProductHome home =(ProductHome)  javax.rmi.PortableRemoteObject.narrow(obj,ProductHome.class);
ProductRemote remote=home.create();

Product prd = new rohit.Product("PRDCamera",001,50.50) ;
remote.addProduct(prd);
remote.updateProduct(prd);
remote.removeProduct(001);
remote.findProduct(001);
remote.findAllProduct();


//getContext Method

public static InitialContext getContext() throws Exception{
    Properties pro = new Properties();
    pro.put(javax.naming.InitialContext.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
    pro.put(javax.naming.InitialContext.PROVIDER_URL,"localhost:1099");
    return new InitialContext(pro);
}

InformationsquelleAutor Rohit Elayathu | 2012-03-16

Schreibe einen Kommentar