File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

distributable

 
ZhiningZhang
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, all,
what does it mean by "distributable" in web.xml?
thanks!
-Zhining
 
Marcos Maia
Ranch Hand
Posts: 977
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, a short answer - your application is deployed in a cluster environment in more than one server/VM.
regards.
[This message has been edited by Marcos Maia (edited November 07, 2001).]
 
Win Yu
Ranch Hand
Posts: 224
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got problem to understand the numbers of instance when using distributable or not. Can anyone explain this. thanks
 
Marcos Maia
Ranch Hand
Posts: 977
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I�m gonna use some situations here to explain:
Situation 1 - A servlet that doesn�t implement SingleThreadModel interface and is not marked as distributable in the dd -> Only one instance of that servlet should exist in one virtual machine and the container will create a new Thread to each request that arrive for that servlet to run it�s service method.
Situation 2 - A servlet that implements SingleThreadModel interface and is not marked as distributable in the dd -> The container is allowed to create a pool of servlets in one virtual machine and even serialize them to match the condition of only one thread executing per servlet at a time.
Situation 3 - A Servlet that does not implement SingleThreadModel interface and is marked as distributable in the dd -> Only one instance of that servlet should exist in each virtual machine that the application is deployed.(This is a tipical clustered environment)
Situation 4 - A servlet that implements SingleThreadModel interface and is marked as distributable in the dd -> The container is allowed to create a pool of servlets in each virtual machine.
hope this clarify a bit.
regards.
 
anders eriksson
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But then there's also objective 3.3 "Distinguish the behavour of the following in a distributable:
- Servlet context init parameters
- Servlet context listeners
- Servlet context attribute listeners
- Session attribute listeners"
I understnad there's always ONE context object per VM, i.e. in a distributable web app, there can be several context objects, who's state can be differet. Therefore a context init parameters, listeners and attribute listeners can be different too.
Sessions are - on the contrary - shared across the the JVM, so that a session attribute listener will always get the SAME events, regardless of which JVM it resides in.
This is my understanding, do you agree?
/Anders
 
Win Yu
Ranch Hand
Posts: 224
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marcos. Can I test it. It is easier to understand it if I can do some test for it.
I also have problem to understand the objective 3.3. Can anyone provide some codes, so I can test it. Thanks.
 
Rishi Singh
Ranch Hand
Posts: 321
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anders,
There was a fair bit pf explanation given by marcos, wd like to add to it.When a web-application is distributed across multiple JVM's then the Servlet Context is not shared, each JVM/Container has its own instance of the Servlet context, accordingly its own attributes, listeners, attribute listeners.A session can be migrated across and we need to implement the HttpActivation listener to notify the objects whenever the session is abt to move(Passivate) and when it is available(Activate).The attibutes, listeners, and attribute listeners with a session thereby is shared, perhaps it needs to be serialized.
Hope this helps..
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic