Recently, it is more idle. I intend to study EJB. I use Eclipse Lomboz JBoss3.2.1, so it is not the latest EJB specification, but it should also understand some truth.
The document is at http://www.tusc.com.au/tutorial/html/index.html, this is a very good document, very detailed, SessionBean's description file is approximately au.com.tusc.session. StoreAccessHome home> au.com.tusc.Session.StoreAccess remote> au.com.tusc.session.storeAccessLocalHome local-home> au.com.tusc. Session.StoreAccessLocal local> au.com.tusc.session.storeAccessSession ejb-class> stateless session-type> container transaction-type > Simple analysis The following home interface is au.com.tusc.session.storeAccessHome Remote interface is au.com.tusc.session.SstoreAccess Local Home interface is au.com.tusc.session.storeAccessLocalhome (conceptual and home interface is similar, just In order to speed up the speed of the EJB of EJB, the local interface is au.com.tusc.session.StoreAccessLocal EJB class as au.com.tusc.session.StoreAccessses, EJB's main implementation is in this class, this SessionBean is the state of the SESSIONBEAN transaction type is the easiest EJB of the container control as the following server deployment: an HOME interface, a remote interface, a bean class, ie au.com.tusc.session.StoreAccessHome Au.com.Tusc.Session.StoreAccess Au.com.Tusc.Session.StoreAccessses client deployment: an HOME interface, a remote interface, a customer class, ie au.com.tusc.session.storeAccessHome au.com.tusc. Session.StoreAccess customer class, use to access remote EJB Next, the calling process client finds a remote HOME interface via JNDI, then call Home's CREATE method to get a remote interface, then call this interface method, the client The way to call is just a remote interface, but the server is actually calling the EJB class, which is the method of the class in ejb-class>.
Therefore, the EJB class must implement the methods that need to be called in all remote interfaces. Basically, the following client-> jndi-> home-> remote client-> remote.method-> bean.method supplement 1, JNDI: Java Naming and Directory Interface Java Names and Directory Interfaces), JNDI API is used to perform names and directory services, which provide a consistent model to access and operate enterprise resources such as DNS, LDAP, local file system, or applicable object JNDI's benefits Your resource you call, your API is actually the same, and the general form is as follows 1) Create an initialContext object, actually feeling and creating a socket connection, just hanging on a resource: such as InitialContext CTX = New InitialContext (); // this unit or props.put (InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); props.put (InitialContext.PROVIDER_URL, "jnp: //127.0.0.1: 1099");
InitialContext InitialContext = New InitialContext (PROPS); 2) Lookup Object Source: Datasource DS = (Datasource) CTX.lookup ("Java: Comp / Env / Java / JDBC"); Find home interface: Home Home = (Home) CTX.lookup ("Java: Comp / ENV / EJB / STOREACCESS")