You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jeremy Quinn <je...@media.demon.co.uk> on 2003/08/16 22:11:55 UTC

HttpSessionBindingEvent

Hi All

Sorry, this is part of the Servlet spec I have had little use for in 
the past.

I don't think HttpSessionBindingListener/HttpSessionBindingEvents are 
available in Cocoon, but I think they are supposed to be the way to 
solve a problem I have.

I am planning a Job Manager, shared by a FlowScript in the Context (?), 
between a group of people who will share work on a batch of jobs 
between them, and need to lock jobs from each other while they are 
working on them.

I need to have Jobs unlocked if a user with their lock has their 
Session time out.

Sounds familiar?
Any suggestions?
Or am I barking up the wrong tree?

thanks

regards Jeremy


Re: HttpSessionBindingEvent

Posted by Geoff Howard <co...@leverageweb.com>.
Jeremy Quinn wrote:

>> [just curious : is "barking" the dog's sound in this context ?]
> 
> 
> Indeed! It is actually the verb, ie. when a dog goes "Woof! Woof!" it is 
> barking .... they also growl, yelp, whine and howl ;)
> If you say a Human is barking, you are saying (in slang) that they are 
> Mad ....
> The noun, bark is the (crinkly brown etc.) covering on a tree ....
> There is also is a (not so lovely) town in Essex called Barking (my 
> apologies to any residents :)
> 

Sylvain,

And the phrase is a reference to looking for something in the wrong 
place, as a dog chasing a cat but "barking" at a tree that the cat is 
not in.

Geoff


Re: HttpSessionBindingEvent

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On Sunday, August 17, 2003, at 08:17 PM, Sylvain Wallez wrote:

>> So if I understand correctly, the way to do this is to keep a 
>> UserManager (a Map of Users, implements HttpSessionBindingListener) 
>> in the Context, while also keeping a copy in each Session. When the 
>> UserManager is unbound, it can remove the User. Or something like 
>> that anyway.
>
>
> Mmmh... This should work, but IMO it would be cleaner if this was not 
> UserManager that implements HttpSessionBindingListener, since it's a 
> gobal object, but the User object or some other session-related > object.
>

Yeah, I have a slightly different scheme, but it is untested while I 
work on other test units.
It maybe has the same flaw ....

My JobManager is stored in both the Context and each User's Session, it 
implements HttpSessionBindingListener.

When I take something, I give the session.id of the Taker to the Job, 
and the Job to the JobManager's Taken Map, (I use the Session.id so the 
User can work in multiple windows if they want, and only the window's 
session that times out, releases it's lock).

When unBound is called, the JobManager can get the id of the Session 
and release any Jobs with this id.

That's the theory anyway ;)

Thanks for your help

regards Jeremy

PS. Thanks for explaining "ronronner" :)


Re: HttpSessionBindingEvent

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Jeremy Quinn wrote:

>
> On Saturday, August 16, 2003, at 09:51 PM, Sylvain Wallez wrote:
>
>> Jeremy Quinn wrote:
>>
>>> Hi All
>>>
>>> Sorry, this is part of the Servlet spec I have had little use for in 
>>> the past.
>>>
>>> I don't think HttpSessionBindingListener/HttpSessionBindingEvents 
>>> are available in Cocoon, but I think they are supposed to be the way 
>>> to solve a problem I have.
>>
>>
>>
>> Yes, they _are_ available, as long as your application runs as a 
>> servlet (i.e. HttpEnvironment), since in that case the Cocoon Session 
>> (interface o.a.c.environment.Session) is simply a wrapper around a 
>> servlet HttpSession.
>
>
> Ah Ha!!
>
> Many thanks for the clarification!!
>
> So if I understand correctly, the way to do this is to keep a 
> UserManager (a Map of Users, implements HttpSessionBindingListener) in 
> the Context, while also keeping a copy in each Session. When the 
> UserManager is unbound, it can remove the User. Or something like that 
> anyway. 


Mmmh... This should work, but IMO it would be cleaner if this was not 
UserManager that implements HttpSessionBindingListener, since it's a 
gobal object, but the User object or some other session-related object.

>>> I am planning a Job Manager, shared by a FlowScript in the Context 
>>> (?), between a group of people who will share work on a batch of 
>>> jobs between them, and need to lock jobs from each other while they 
>>> are working on them.
>>
>>
>>
>> Same for Context : this is a wrapper around the ServletContext.
>>
>>> I need to have Jobs unlocked if a user with their lock has their 
>>> Session time out.
>>>
>>> Sounds familiar?
>>> Any suggestions?
>>> Or am I barking up the wrong tree?
>>
>>
>>
>> [just curious : is "barking" the dog's sound in this context ?]
>
>
> Indeed! It is actually the verb, ie. when a dog goes "Woof! Woof!" it 
> is barking .... they also growl, yelp, whine and howl ;)
> If you say a Human is barking, you are saying (in slang) that they are 
> Mad ....
> The noun, bark is the (crinkly brown etc.) covering on a tree ....
> There is also is a (not so lovely) town in Essex called Barking (my 
> apologies to any residents :)


Thanks for this explanation (and also to Geoff, and to Joerg off-list). 
I was wondering about "bark" since, as a noun, it has two meanings 
related to dogs and to trees (see 
http://www.wordreference.com/english/definition.asp?en=bark)

> PS, my favourite onomatopoeia in French is "ronronner" :) 


For non french speakers : "ronronner" is "to purr", i.e. what a cat does 
when it's happy.

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



Re: HttpSessionBindingEvent

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On Saturday, August 16, 2003, at 09:51 PM, Sylvain Wallez wrote:

> Jeremy Quinn wrote:
>
>> Hi All
>>
>> Sorry, this is part of the Servlet spec I have had little use for in 
>> the past.
>>
>> I don't think HttpSessionBindingListener/HttpSessionBindingEvents are 
>> available in Cocoon, but I think they are supposed to be the way to 
>> solve a problem I have.
>
>
> Yes, they _are_ available, as long as your application runs as a 
> servlet (i.e. HttpEnvironment), since in that case the Cocoon Session 
> (interface o.a.c.environment.Session) is simply a wrapper around a 
> servlet HttpSession.

Ah Ha!!

Many thanks for the clarification!!

So if I understand correctly, the way to do this is to keep a 
UserManager (a Map of Users, implements HttpSessionBindingListener) in 
the Context, while also keeping a copy in each Session. When the 
UserManager is unbound, it can remove the User. Or something like that 
anyway.

>> I am planning a Job Manager, shared by a FlowScript in the Context 
>> (?), between a group of people who will share work on a batch of jobs 
>> between them, and need to lock jobs from each other while they are 
>> working on them.
>
>
> Same for Context : this is a wrapper around the ServletContext.
>
>> I need to have Jobs unlocked if a user with their lock has their 
>> Session time out.
>>
>> Sounds familiar?
>> Any suggestions?
>> Or am I barking up the wrong tree?
>
>
> [just curious : is "barking" the dog's sound in this context ?]

Indeed! It is actually the verb, ie. when a dog goes "Woof! Woof!" it 
is barking .... they also growl, yelp, whine and howl ;)
If you say a Human is barking, you are saying (in slang) that they are 
Mad ....
The noun, bark is the (crinkly brown etc.) covering on a tree ....
There is also is a (not so lovely) town in Essex called Barking (my 
apologies to any residents :)

PS, my favourite onomatopoeia in French is "ronronner" :)

> Hope this helps,

It does, many thanks

regards Jeremy


Re: HttpSessionBindingEvent

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Jeremy Quinn wrote:

> Hi All
>
> Sorry, this is part of the Servlet spec I have had little use for in 
> the past.
>
> I don't think HttpSessionBindingListener/HttpSessionBindingEvents are 
> available in Cocoon, but I think they are supposed to be the way to 
> solve a problem I have. 


Yes, they _are_ available, as long as your application runs as a servlet 
(i.e. HttpEnvironment), since in that case the Cocoon Session (interface 
o.a.c.environment.Session) is simply a wrapper around a servlet HttpSession.

> I am planning a Job Manager, shared by a FlowScript in the Context 
> (?), between a group of people who will share work on a batch of jobs 
> between them, and need to lock jobs from each other while they are 
> working on them.


Same for Context : this is a wrapper around the ServletContext.

> I need to have Jobs unlocked if a user with their lock has their 
> Session time out.
>
> Sounds familiar?
> Any suggestions?
> Or am I barking up the wrong tree? 


[just curious : is "barking" the dog's sound in this context ?]

Hope this helps,
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