It is not reccommended to start threads inside an EJB. You can use JMX insted for any polling services.
In order to develop reliable and portable EJB components, the following restrictions apply to EJB code implementation:
--Avoid using static non-final fields. Declaring all static fields in EJB component as final is recommended. This enables the EJB container to distribute instances across multiple JVMs.
--Avoid starting a new thread (conflicts with EJB container) or using thread synchronization (allow the EJB container to distribute instances across multiple JVMs).
--Avoid using AWT or Swing functionality. EJBs are server side business components.
--Avoid using file access/java.io operations. EJB business components are meant to use resource managers such as
JDBC to store and retrieve application data. Also deployment descriptors can be used to store <env-entry>.
--Avoid accepting or listening to socket connections. EJB components are not meant to provide network socket functionality. However the specification lets EJB components act as socket clients or RMI clients.
--Avoid using the reflection API. This restriction enforces
Java security.
--Can�t use custom class loaders.