Loading
Standlone Client to Stateful Session Bean.

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  If you have Business Layer (EJB layer) which could be accessed by a web application as well as a Standalone application , how could you manange state which used by both the applications ?


Ans)

You have to create StatefulSessionBean and make that accessible for both Web as well as Standalone applications.

You could access the Stateful Session by using  JNDI look up.

From as Stanalone Client you could use application specific protocal to connect to JNDI tree.

Weblogic:

Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
String url = "t3://localhost:7001";
p.put(Context.PROVIDER_URL, url);
Context ctx = new InitialContext(p);
MyBeanHome home = (MyBeanHome)ctx.lookup("server.MyBeanHome");
MyBean remote = home.create();

WebSphere:

1)
 Hashtable env = new Hashtable();
  env.put(Context.INITIAL_CONTEXT_FACTORY,
                  "com.ibm.websphere.naming.WsnInitialContextFactory");
     env.put(Context.PROVIDER_URL, "corbaloc::localhost:2809");
      InitialContext ctx = new InitialContext(env);
  
2)
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
     "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "iiop://myhost.mycompany.com:2809");
Context initialContext = new InitialContext(env);


 

 

 



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

Standlone Client to Stateful Session Bean.


Standlone Client to Stateful Session Bean.

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free