I am using Maven framework to build my project and EJB 3.0 is the EJB specification. I have an EJB interface A and its corresponding EJB class B that implements A. The body of class B is shown below:
@Stateless
@TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW)
class B implements A{
@PersistenceContext(unitName = "Draco-PU", type = PersistenceContextType.TRANSACTION)
EntityManager entityManager;
//called post construct
@PostConstruct
public init(){
//body of init method
}
I have a non-EJB class in a different package under the same project. I want to instantiate class B in this class, so that the init() method and other annotations are automatically referred and I can give explicit call to other methods in the EJB class. Please help.