Peter Penzov
Peter Penzov

Reputation: 1712

Turn Managed bean into EJB

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

Upvotes: 1

Views: 301

Answers (2)

Óscar López
Óscar López

Reputation: 236112

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 {
}

Upvotes: 2

Bala
Bala

Reputation: 1203

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.

Upvotes: 1

Related Questions