简体   繁体   中英

Turn Managed bean into EJB

Is it possible to turn a Managed bean into an Enterprise Managed Bean? Would you give some example?

For turning a POJO bean class into an EJB, add the @Stateless of @Stateful annotation and implement the @Remote or @Local (or both) interfaces. Of course some additional configuration steps will be necessary, but that depends on the particular application server you're using.

Do something along these lines:

@Local
public interface ServiceLocal {
}

@Remote
public interface ServiceRemote {
}

@Stateless
public class ServiceEJB implements ServiceLocal, ServiceRemote {
}

If you have a valid scenario where you want to use an EJB as your backing bean, then yes you can do it. JBoss Seam would help you in this. Check out this for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM