Are EJBs allowed to call private methods
Issue
- We want to structure our publicly exposed service methods in EJBs by delegating parts of the work to private helper methods within the same Stateless EJB. Doing so we need some of the injected objects within our helper methods (loggers, services, CDI beans).
- Is it safe and legal (according to Java EE spec) to use injected properties within directly called private methods (without EJB proxy but with "this" reference) in Stateless EJBs?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
