I am using the @Singleton and @Startup annotations together to create a long running process. By using these annotation can I safely assume that my process will be a single thread running fully asynchronously?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
You can use these annotations just at the class-level, so I'm not sure what 'process' do you refer to (@PostConstruct method?)
I don't remember any part of the EJB 3.1 specification which talks about the required asynchronous singleton initialization.
4.8.1 Singleton Initialization:
It rather depends on the Application Server vendor what technique of initialization he choose. I would not assume that the loading will occur in a separate process but rather just that it will occur during server startup and before serving clients.
ENTERED FROM COMMENTS: what about providing a separate asynchronous EJB method for your time-consuming operation which will be invoked from your singleton initializer EJB?