• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

global object

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All of our servlets need to obtain a global object via a JNDI lookup and pass it data. The global object then sends a command over a socket connection to a legacy system, gets back a response and sends it back to the servlet. The global object starts up and goes down along with the appserver ( or servlet container) This should work on both Tomcat and Websphere. I've noticed WS is much more restrictive with objects running within the app server, no multiple threading, no sockets, whereas I can do all of that within Tomcat by simply creating a Global JNDI resource defined in server.xml.

I'd like to come up with a general solution that works for both Tomcat and WS. Am I missing something within WS that might allow me to do this? Is there a better solution that will work for both TC and WS?

thx
 
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A static variable will be able to be accessed as long as the jvm is up. If you loaded the jar/class of this variable in the server classpath it would be available to all applications within the server.
 
Ranch Hand
Posts: 472
Objective C Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just mad idea to create a fake servlet which context can be accessed from all others.
 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic