• Post Reply Bookmark Topic Watch Topic
  • New Topic

Factory design for accessing multiple contexts  RSS feed

Justin Chu
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to determine a Factory pattern for accessing (initial) contexts on multiple servers.

In general, I'm accessing contexts from at least two servers, one is connecting to the local container, and the other is to remote EJB container.

What is a good approach in designing this? The objective is to separate each server's initial context into different classes, and have them be swappable if needed.

Here's what I come up with:

A problem I see in this approach is that the instances are created at class loading time, and cannot access ServletContext or other webapp resources.
[ February 02, 2007: Message edited by: Chu Tan ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!