cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <>
Subject RE: [RT] On building on stone
Date Fri, 26 Mar 2004 14:44:07 GMT

> From: Pier Fumagalli [] 
> On 26 Mar 2004, at 11:57, Leo Sutic wrote:
> >
> > Think about TCP/IP. You have guaranteed delivery of packets 
> (which you 
> > don't have with UDP). Completely guaranteed? No. A 
> chopped-off network 
> > cable is not something that the protocol can handle. But still very 
> > useful.
> The TCP/IP is a good example...
> To use the same parallel, when I open a TCP connection I am guaranteed

> that I'm going to get a Socket object (to use Java) I can use. But the

> platform doesn't guarantee me that its InputStream or OutputStream are

> going to be valid forever, they might throw IOExceptions, and the 
> socket itself can be in a connected or disconnected status (you're 
> never guaranteed).
> You go usually until you don't hit an IOException on the streams (or 
> isConnected() returns true), but then you'll have (somehow) to handle 
> that state change which you don't control...
> Wirings between blocks behave in the same way, you go until one of the

> methods you call doesn't return an exception, or until the wiring is 
> available (err, you can check on that),

Actually, you can't.

There's no guarantee that the block isn't going to be swapped out
between the checking call and the next method call.

So there's absolutely no point in making the checking call.

There's even no guarantee that the block won't be swapped out ***while
is executing a method***. 

Now that's starting to become dangerous.

> If component locking needs to be performed, it needs to be a framework

> feature unaccessible to components, otherwise it will be abused of.

Well, for stateless interfaces (think MailServer), the framework
should lock the component during the method call, so the block isn't
out while it is executing a call.

For stateful interfaces (think ContentHandler), the framework can lock
the component between lookup and release.


View raw message