You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by membersound <me...@web.de> on 2012/11/16 17:16:39 UTC

What is @ApplicationScoped for tapestry?

Hi,

how can I make an @ApplicationScoped within tapestry? Is there any pendant
to share the same data within one single class across the application in T5?

Thanks



--
View this message in context: http://tapestry.1045711.n5.nabble.com/What-is-ApplicationScoped-for-tapestry-tp5718048.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: What is @ApplicationScoped for tapestry?

Posted by Cezary Biernacki <ce...@gmail.com>.
On Fri, Nov 16, 2012 at 6:04 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Fri, 16 Nov 2012 14:28:17 -0200, Lenny Primak <lp...@hope.nyc.ny.us>
> wrote:
>
>  Any kind of a singleton service can be used as a data pool
>> See http://tapestry.apache.org/**defining-tapestry-ioc-**services.html<http://tapestry.apache.org/defining-tapestry-ioc-services.html>
>>
>
> In other words: put the application-scoped data as fields in a class,
> write some methods to read and write them, declare it as a Tapestry-IoC
> singleton service (which is the same as declaring it as a service, as
> singleton is the default service scope in Tapestry-IoC), use the service,
> that's it. The application scope in JSP and servlets is a very bad idea
> from times in which webapps were a huge mess in terms of architecture.


But please be aware that you get exactly what you ask for, a Java singleton
object.

It means:
- It is shared between all process threads,
  so you must properly handle multi-threading issues.
- It is shared by different users.
  so you must ensure that you don't accidentally leak one user-specific
data to another user.
- It is NOT shared between different Java processes,
  so if you run your application using a cluster of servers and you really
need to share data,
  you should implement such sharing somehow yourself.
- It is NOT saved/restored in case of a server restart (like data stored in
user sessions might be),
  so if you need to have such ability, you need to implement it yourself.

I know that everything above is obvious to a seasoned Java developer,
but not everybody might understand all implications at first glance.

Best regards,
Cezary

Re: What is @ApplicationScoped for tapestry?

Posted by membersound <me...@web.de>.
That's very keen, ty! And again one more point why I hate having to use plain
JSF at work ;)



--
View this message in context: http://tapestry.1045711.n5.nabble.com/What-is-ApplicationScoped-for-tapestry-tp5718048p5718053.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: What is @ApplicationScoped for tapestry?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 16 Nov 2012 14:28:17 -0200, Lenny Primak <lp...@hope.nyc.ny.us>  
wrote:

> Any kind of a singleton service can be used as a data pool
> See http://tapestry.apache.org/defining-tapestry-ioc-services.html

In other words: put the application-scoped data as fields in a class,  
write some methods to read and write them, declare it as a Tapestry-IoC  
singleton service (which is the same as declaring it as a service, as  
singleton is the default service scope in Tapestry-IoC), use the service,  
that's it. The application scope in JSP and servlets is a very bad idea  
 from times in which webapps were a huge mess in terms of architecture.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: What is @ApplicationScoped for tapestry?

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
Any kind of a singleton service can be used as a data pool

See http://tapestry.apache.org/defining-tapestry-ioc-services.html

On Nov 16, 2012, at 11:24 AM, membersound wrote:

> This shares a variable between multiple pages.
> BUT I'm looking for some kind of "data-pool" service. So I want to annotate
> the service and it should contain the same data among ALL sessions.
> 
> 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/What-is-ApplicationScoped-for-tapestry-tp5718048p5718050.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: What is @ApplicationScoped for tapestry?

Posted by membersound <me...@web.de>.
This shares a variable between multiple pages.
BUT I'm looking for some kind of "data-pool" service. So I want to annotate
the service and it should contain the same data among ALL sessions.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/What-is-ApplicationScoped-for-tapestry-tp5718048p5718050.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: What is @ApplicationScoped for tapestry?

Posted by Kristian Marinkovic <kr...@gmail.com>.
use @SessionState in T5

g,
kris

On Fri, Nov 16, 2012 at 5:16 PM, membersound <me...@web.de> wrote:
> Hi,
>
> how can I make an @ApplicationScoped within tapestry? Is there any pendant
> to share the same data within one single class across the application in T5?
>
> Thanks
>
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/What-is-ApplicationScoped-for-tapestry-tp5718048.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org