what i got from docs isEJB interacts with its container through the following mechanisms 1) EJBContext 2) JNDI 3) Call-back Methods

Regarding Call-back Methods --> Every EJB implements an interface (extends EnterpriseBean) which define several methods which alert the bean to various events in its lifecycle. A container is responsible for invoking these methods. These methods notify the bean when it is about to be activated, to be persisted to the database, to end a transaction, to remove the bean from the memory, etc. For example the entity bean has the following call-back methods: