Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

custom JNDI factory  RSS feed

N Goldsmith
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!