什么是JBoss
是一个基于J2EE的开放源代码的应用服务器。 JBoss代码遵循LGPL许可,可以在任何商业应用中免费使用。简历html源码JBoss是一个管理EJB的容器和服务器,支持EJB 1、活动钓鱼源码1、ssd mobilenet源码EJB 2、0和EJB3的规范。但JBoss核心服务不包括支持servlet/JSP的WEB容器,一般与Tomcat或Jetty绑定使用。
ejbç¨åºä»£ç
EJBæ¯J2EEæ¡æ¶ä¸æéè¦çé¨åï¼ä¹æ¯ä¼ä¸åºç¨ä¸æ常ç¨çææ¯ä¹ä¸ï¼ç¶èEJBç客æ·ç«¯ç¼å对äºå¼åè èè¨ä¸æ¯ä¸ä»¶è½»æ¾çäºæ ãæ§ä»¶æ¶æä¸çEJBæ§ä»¶å¤§å¤§çç®åäºEJBèµæºçå¤ææ§ãé¾åº¦ï¼å¼åè åªéè¦éè¿ç®åçç»§æ¿ org.apache.beehive.controls.system.ejb.SessionEJBControlæè org.apache.beehive.controls.system.ejb.EntityEJBControlï¼ç¶åéè¿æä¾ç¸åºç注éå°±å¯ä»¥å®æ EJBèµæºç访é®ã
-------------------------------------------------------------
EJB Beanç±»æºä»£ç âHelloWorld.java
æ¸ å1 ejbsrcorgvivianjbeehivecontrolsexamplesejbhelloworld.java
1. package org.vivianj.beehive.controls.examples.ejb;
2.
3. import javax.ejb.*;
4.
5. public class HelloWorld
6. implements SessionBean
7. {
8. public void ejbCreate() {
9. }
. public String sayHello()
. {
. return âHello World!â;
. }
. }
å ±4页ã
EJB Remoteæ¥å£ç±»æºä»£ç âHelloWorldRemote.java
æ¸ å2 ejbsrcorgvivianjbeehivecontrolsexamplesejbHelloWorldRemote.java
1. package org.vivianj.beehive.controls.examples.ejb;
2.
3. import javax.ejb.EJBObject;
4. import java.rmi.RemoteException;
5.
6. import javax.ejb.*;
7.
8. public interface HelloWorldRemote extends EJBObject {
9.
. public String sayHello() throws RemoteException;
.
. }
EJB Homeæ¥å£ç±»æºä»£ç --HelloWorldHome.java
æ¸ å3 ejbsrcorgvivianjbeehivecontrolsexamplesejbHelloWorldHome.java
1. package org.vivianj.beehive.controls.examples.ejb;
2.
3. import javax.ejb.CreateException;
4. import javax.ejb.EJBHome;
5. import javax.ejb.FinderException;
6. import java.rmi.RemoteException;
7. import java.util.Collection;
8.
9. import javax.ejb.*;
.
. public interface HelloWorldHome extends EJBHome {
.
. public HelloWorldRemote create()
. throws CreateExceptionï¼ RemoteException;
.
. }
EJBå¼åå®æåï¼æ们å¯ä»¥å°EJBæå æä¼ä¸åºç¨ï¼ç¶åå°çæçä¼ä¸åºç¨åå¸å°JBossåºç¨æå¡å¨ä¸ã
å¼åEJBæ§ä»¶
æ们ç°å¨æ¥å¼åä¸ä¸ªEJBæ§ä»¶-- HelloWorldSessionEJBControlï¼éè¿å®æ们è½å¤ç´æ¥è®¿é® 1.å¼åSessionBean ä¸å¼ååé¨ç½²çEJBã
HelloWorldSessionEJBControléè¿JBossæä¾çorg.jnp.interfaces.NamingContextFactoryå·¥åç±»è·åEJB访é®çä¸ä¸æç¯å¢ã
æ¸ å4ä¸æ¯EJBæ§ä»¶çå ¨é¨æºä»£ç ã
æ¸ å4 srcorgvivianjbeehivecontrolsexamplescontrols
HelloWorldSessionEJBControl.java
1. package org.vivianj.beehive.controls.examples.controls;
2.
3. import org.apache.beehive.controls.api.bean.ControlExtension;
4. import org.apache.beehive.controls.system.ejb.SessionEJBControl;
5. import org.vivianj.beehive.controls.examples.ejb.helloworldHome;
6. import org.vivianj.beehive.controls.examples.ejb.helloworldRemote;
7.
8. /
**9. * HelloWorldSessionEJBControl ç¨äºå°è£ 访é®è¿ç¨JBossæå¡å¨ä¸
. * SessionBeançæä½æ¹æ³
. */
. @ControlExtension
. @SessionEJBControl.EJBHome(jndiName = âjndi/helloworldâ)
. @SessionEJBControl.JNDIContextEnv(
. contextFactory = âorg.jnp.interfaces.NamingContextFactoryâï¼
. providerURL = âjnp://localhost:â)
. public interface HelloWorldSessionEJBControl
. extends SessionEJBControlï¼
. HelloWorldHomeï¼ HelloWorldRemote {
. }
2024-11-14 23:20
2024-11-14 23:12
2024-11-14 23:04
2024-11-14 23:03
2024-11-14 22:29