Refresh Your Java - Before Java Interview
We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....
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);
This Portal is intended to put all Java/J2ee related topics at one single place for quick referance, not only Technical , but also the Project Management Related thing such as Development Process methodoogies build process, unit testing etc.,
This Portal has More than 500 Java Interview Questions (also could be Considered as Quick Notes) very neatly separated topic by topic with simple diagrams which makes you easily understandable. Importantly these are from our Realtime expericance.