You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by "Henning P. Schmiedehausen" <hp...@intermeta.de> on 2003/06/02 12:36:12 UTC

Re: Request Tool Refreshing

CP Lim <cp...@redsheriff.com> writes:

>Hi,

>I think I might have stumbled upon a bug in the TurbinePullService.java 
>  file.  On line 227, it expects to lookup 'tools.per.request.refresh', 
>but the configured attribute name is:

>------------------
>services.PullService.tools.per.request.refresh=true

Please tell us, which Turbine Version you're using.

I'm 99,99% sure, that the configuration object in which this property
is looked up is a configuration subset of all keys starting with
services.PullService, so the lookup is correct.

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Request Tool Refreshing

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
CP Lim <cp...@redsheriff.com> writes:

Hi,

ah, now I understand. No, request level tools are not refreshed at
all, because this would make no sense. A Request Tool is re-invoked on
every request which means calling "init()", right.

The fact that you might get the same object over and over when you
debug/test is not something that you can rely on (please, don't!). 
This is a property of the global object cache that simply
recycles a tool object.

If you care to try 2.3-dev, there is a switch in the pool service
(services.PoolService.pool.debug = true) , which allows you to force
Turbine to generate new objects until the pool is half full (normally
it only generates new objects if it is under pressure which means
multiple simultaneous accesses to a Turbine application).

	Regards
		Henning


>Hi Henning,

> > Either I'm too blind to understand what you consider the bug or you
> > don't understand how this property is evaluated. :-)

>Unfortunately I think its the latter (and a bit more). :)

>I mistakenly thought that the 
>"services.PullService.tools.per.request.refresh" was applied to 
>_request_ level pull tools, but it turns out that it is applied to 
>_session_ level pull tools.

>It looks like for request level pull tools, if I want to refresh my 
>objects I'll have to manually reset them in the init() method (I had 
>previously depended on the refresh() method to be invoked).

>Sorry for any inconvenience caused.

>cheers,
>CP

>Henning P. Schmiedehausen wrote:
>> CP Lim <cp...@redsheriff.com> writes:
>> 
>> 
>>>Hi Henning,
>> 
>> 
>>>I'm using v2.2 of Turbine, and I agree that the configuration lookup is 
>>>correct.  I think the bug is in the 
>>>o.a.t.services.pull.TurbinePullService.java file.
>> 
>> 
>>>The following is the extract from the file (line 223):
>> 
>> 
>>>---------------------
>>>    /**
>>>     * Property tag for per request tool refreshing
>>>     * (for obvious reasons has no effect for per-request tools)
>>>     */
>>>    private static final String TOOLS_PER_REQUEST_REFRESH =
>>>        "tools.per.request.refresh";
>> 
>> 
>>>---------------------
>> 
>> 
>>>As you can see it is using 'tools.per.request.refresh' instead of 
>>>'services.PullService.tools.per.request.refresh', which I think is the 
>>>core of the bug.
>> 
>> 
>> Either I'm too blind to understand what you consider the bug or you
>> don't understand how this property is evaluated. :-) Look a little
>> further below:
>> 
>> (Line numbers straight from the TURBINE_2_2_0 tag in the CVS)
>> 
>> 265      Configuration conf = getConfiguration();
>> [...]
>> 289       refreshToolsPerRequest = conf.getBoolean(TOOLS_PER_REQUEST_REFRESH);
>> 
>> The "conf" object fetched in line 265 is already a subset of the
>> global configuration. These are all objects with the
>> "services.PullService" prefix. This prefix is stripped from the
>> properties. Simply look up the definition of getConfiguration() in the
>> parent object. This is _not_ Turbine.getConfiguration which returns
>> the whole configuration properties set.
>> 
>> And in 289 we fetch the boolean value of the property above. So we do
>> check services.PullService.tools.per.request.refresh
>> 
>> Or am I getting it all wrong what you want?
>> 
>> 	Regards
>> 		Henning
>> 


>-- 
>R E D S H E R I F F
>C.P. Lim - Software Engineer
>Level 1, 10 Queens Road    +61 3 9864 0733 tel
>Melbourne VIC              +61 3 9864 0778 fax
>Australia                  +61 413 781 846 mob

>This message and any files transmitted with it are confidential and 
>intended solely for the use of the individual or entity to whom they are 
>addressed. If you are not the intended recipient, you are hereby 
>notified that any use or dissemination of this communication is strictly 
>prohibited. If you have received this message in error please notify us 
>immediately by return email or telephone +61 (3) 9659 0432, then delete 
>this message. Any views expressed in this message are those of the 
>individual sender and many not necessarily reflect the views of Red 
>Sheriff.


>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Request Tool Refreshing

Posted by CP Lim <cp...@redsheriff.com>.
Hi Henning,

 > Either I'm too blind to understand what you consider the bug or you
 > don't understand how this property is evaluated. :-)

Unfortunately I think its the latter (and a bit more). :)

I mistakenly thought that the 
"services.PullService.tools.per.request.refresh" was applied to 
_request_ level pull tools, but it turns out that it is applied to 
_session_ level pull tools.

It looks like for request level pull tools, if I want to refresh my 
objects I'll have to manually reset them in the init() method (I had 
previously depended on the refresh() method to be invoked).

Sorry for any inconvenience caused.

cheers,
CP

Henning P. Schmiedehausen wrote:
> CP Lim <cp...@redsheriff.com> writes:
> 
> 
>>Hi Henning,
> 
> 
>>I'm using v2.2 of Turbine, and I agree that the configuration lookup is 
>>correct.  I think the bug is in the 
>>o.a.t.services.pull.TurbinePullService.java file.
> 
> 
>>The following is the extract from the file (line 223):
> 
> 
>>---------------------
>>    /**
>>     * Property tag for per request tool refreshing
>>     * (for obvious reasons has no effect for per-request tools)
>>     */
>>    private static final String TOOLS_PER_REQUEST_REFRESH =
>>        "tools.per.request.refresh";
> 
> 
>>---------------------
> 
> 
>>As you can see it is using 'tools.per.request.refresh' instead of 
>>'services.PullService.tools.per.request.refresh', which I think is the 
>>core of the bug.
> 
> 
> Either I'm too blind to understand what you consider the bug or you
> don't understand how this property is evaluated. :-) Look a little
> further below:
> 
> (Line numbers straight from the TURBINE_2_2_0 tag in the CVS)
> 
> 265      Configuration conf = getConfiguration();
> [...]
> 289       refreshToolsPerRequest = conf.getBoolean(TOOLS_PER_REQUEST_REFRESH);
> 
> The "conf" object fetched in line 265 is already a subset of the
> global configuration. These are all objects with the
> "services.PullService" prefix. This prefix is stripped from the
> properties. Simply look up the definition of getConfiguration() in the
> parent object. This is _not_ Turbine.getConfiguration which returns
> the whole configuration properties set.
> 
> And in 289 we fetch the boolean value of the property above. So we do
> check services.PullService.tools.per.request.refresh
> 
> Or am I getting it all wrong what you want?
> 
> 	Regards
> 		Henning
> 


-- 
R E D S H E R I F F
C.P. Lim - Software Engineer
Level 1, 10 Queens Road    +61 3 9864 0733 tel
Melbourne VIC              +61 3 9864 0778 fax
Australia                  +61 413 781 846 mob

This message and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they are 
addressed. If you are not the intended recipient, you are hereby 
notified that any use or dissemination of this communication is strictly 
prohibited. If you have received this message in error please notify us 
immediately by return email or telephone +61 (3) 9659 0432, then delete 
this message. Any views expressed in this message are those of the 
individual sender and many not necessarily reflect the views of Red 
Sheriff.


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Request Tool Refreshing

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
CP Lim <cp...@redsheriff.com> writes:

>Hi Henning,

>I'm using v2.2 of Turbine, and I agree that the configuration lookup is 
>correct.  I think the bug is in the 
>o.a.t.services.pull.TurbinePullService.java file.

>The following is the extract from the file (line 223):

>---------------------
>     /**
>      * Property tag for per request tool refreshing
>      * (for obvious reasons has no effect for per-request tools)
>      */
>     private static final String TOOLS_PER_REQUEST_REFRESH =
>         "tools.per.request.refresh";

>---------------------

>As you can see it is using 'tools.per.request.refresh' instead of 
>'services.PullService.tools.per.request.refresh', which I think is the 
>core of the bug.

Either I'm too blind to understand what you consider the bug or you
don't understand how this property is evaluated. :-) Look a little
further below:

(Line numbers straight from the TURBINE_2_2_0 tag in the CVS)

265      Configuration conf = getConfiguration();
[...]
289       refreshToolsPerRequest = conf.getBoolean(TOOLS_PER_REQUEST_REFRESH);

The "conf" object fetched in line 265 is already a subset of the
global configuration. These are all objects with the
"services.PullService" prefix. This prefix is stripped from the
properties. Simply look up the definition of getConfiguration() in the
parent object. This is _not_ Turbine.getConfiguration which returns
the whole configuration properties set.

And in 289 we fetch the boolean value of the property above. So we do
check services.PullService.tools.per.request.refresh

Or am I getting it all wrong what you want?

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Request Tool Refreshing

Posted by CP Lim <cp...@redsheriff.com>.
Hi Henning,

I'm using v2.2 of Turbine, and I agree that the configuration lookup is 
correct.  I think the bug is in the 
o.a.t.services.pull.TurbinePullService.java file.

The following is the extract from the file (line 223):

---------------------
     /**
      * Property tag for per request tool refreshing
      * (for obvious reasons has no effect for per-request tools)
      */
     private static final String TOOLS_PER_REQUEST_REFRESH =
         "tools.per.request.refresh";

---------------------

As you can see it is using 'tools.per.request.refresh' instead of 
'services.PullService.tools.per.request.refresh', which I think is the 
core of the bug.

Thanks for getting back to me.

cheers,
CP


Henning P. Schmiedehausen wrote:
> CP Lim <cp...@redsheriff.com> writes:
> 
> 
>>Hi,
> 
> 
>>I think I might have stumbled upon a bug in the TurbinePullService.java 
>> file.  On line 227, it expects to lookup 'tools.per.request.refresh', 
>>but the configured attribute name is:
> 
> 
>>------------------
>>services.PullService.tools.per.request.refresh=true
> 
> 
> Please tell us, which Turbine Version you're using.
> 
> I'm 99,99% sure, that the configuration object in which this property
> is looked up is a configuration subset of all keys starting with
> services.PullService, so the lookup is correct.
> 
> 	Regards
> 		Henning
> 


-- 
R E D S H E R I F F
C.P. Lim - Software Engineer
Level 1, 10 Queens Road    +61 3 9864 0733 tel
Melbourne VIC              +61 3 9864 0778 fax
Australia                  +61 413 781 846 mob

This message and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they are 
addressed. If you are not the intended recipient, you are hereby 
notified that any use or dissemination of this communication is strictly 
prohibited. If you have received this message in error please notify us 
immediately by return email or telephone +61 (3) 9659 0432, then delete 
this message. Any views expressed in this message are those of the 
individual sender and many not necessarily reflect the views of Red 
Sheriff.


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org