Upayavira wrote:

On 30 Jun 2003 at 22:29, Sylvain Wallez wrote:



<snip/>

Once again, I agree that explicit release is very unnatural. But
automagic release is good only if we can have some automagic restore.
For this we can have getComponent() actually return a proxy to the
real component, and have the proxy do a release/lookup when a
continuation is suspended/reactivated. But as elegant this may seem,
this won't work : stateful components have... a state, and a
release/lookup cycle destroys this state.

So I don't see any other solution...



How about defining a FlowSafe interface (contains no state and can be released/looked up transparently),



We already have this with the ThreadSafe marker interface. So yes, we could have transparent release/lookup for ThreadSafe components.


and maybe a FlowSerializable interface (has a way that the state can be stored into the continuation and then restored, all transparently?


Good point. But actually, this is not related exclusively to flow, but to the ability to externalize the component state. So this could be :
interface StateExternalizable {
Object /* or Serializable? */ getState();
void setState(Object state);
}


So you would have to consciously code your components to use either of these interfaces, otherwise you'll have to manually release them before creating a continuation.


Yep. An you would still get an error if there are some unreleased components that are neither ThreadSafe nor StateExternalizable.


Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com




Reply via email to