[jboss-user] [JBoss Seam] - Re: About the new chapter Caching in documentation.
gavin.king@jboss.com
do-not-reply at jboss.com
Tue Feb 27 11:32:02 EST 2007
OK, the code should be:
@Name("chatroom")
| public class Chatroom {
| @In PojoCache pojoCache;
|
| public void join(String username) {
| try
| {
| Set<String> userList = (Set<String>) pojoCache.get("chatroom", "userList");
| if (userList==null)
| {
| userList = new HashSet<String>();
| pojoCache.put("chatroom", "userList", userList);
| }
| userList.put(username);
| }
| catch (CacheException ce)
| {
| throw new RuntimeException(ce);
| }
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023161#4023161
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023161
More information about the jboss-user
mailing list