简体   繁体   English

将托管bean转换为EJB

[英]Turn Managed bean into EJB

Is it possible to turn a Managed bean into an Enterprise Managed Bean? 是否可以将托管Bean转换为企业托管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. 对于把一个POJO bean类为EJB,添加@Stateless@Stateful注释和执行@Remote@Local (或两者)接口。 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. 如果您有使用EJB作为后备bean的有效方案,那么可以。 JBoss Seam would help you in this. JBoss Seam将在此方面为您提供帮助。 Check out this for more information. 查看以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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