I'm working for a company that uses Bea Weblogic 9.2 with Beehive annotations and controls for a web application. The use case is the following:
- A user selects a file for upload and a message type from a combo box.
- The file is uploaded and needs to be handled by a specific EJB that will save the message in one or more tables in the database.
Some developers want to define an interface that has the following method:
public Result handle(byte msg, String msgType)
Different message types require of course different implementations because the database tables where they are store in differ. Therefore a mapping between the msgType and the JNDI name of (local) session bean home interface is need. So you end up with a Service Locator implementation that also delegates the call to the right EJB.
To be more generic, they want to use a database table for the mapping between the message type and the JNDI name of the EJB. This way they want to plugin new message handlers by deploying an EAR with EJBs implementing the above interface.
Does anyone know another way to do the mapping from the above message type to a conrete EJB instance? I like the callback methods in Spring but we can't use Spring for the moment.