I have a custom JNDI factory that creates and returns a particular Java class. I was wondering if it was possible to make the factory generic to a few different custom objects and have the user pass in a type it wants the factory to create.
For instance, the factory below can create just one type of object. How would a client do a lookup and pass in the type it wants to create?
Here is my client code:
Can the client pass in a type so the factory can be more generic?