My misunderstanding or the mistake of the doc?
It's like below before:
@Name(chatroom)
public class Chatroom {
@In PojoCache pojoCache;
public void join(String username) {
try
{
Set userList = (Set) pojoCache.get(chatroom, userList);
if (users==null)
No, JBossCache has automagic dirty checking.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4023095#4023095
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4023095
___
jboss-user
I means the users field and the userList filed. The users field isn't defined.
Do the userList and users represent different?
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4023123#4023123
Reply to the post :
Yes, users should be userList.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4023138#4023138
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4023138
___
jboss-user mailing list
AND is the join method to add user in the userList? Why
pojoCache.put(chatroom, users, username)? Why not add the username to the
set?
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4023143#4023143
Reply to the post :
What if this is the first time? What if there is no Set there yet?
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4023151#4023151
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4023151
If it is the later time, just get the userList as the try scope varible, and do
nothing?
So I suppose it as below.
if (userList==null)
{
userList = new HashSet();
}
userList.add(username);
pojoCache.put(chatroom, userList, userList);
View the original post :
OK, the code should be:
@Name(chatroom)
| public class Chatroom {
| @In PojoCache pojoCache;
|
| public void join(String username) {
| try
| {
| SetString userList = (SetString) pojoCache.get(chatroom,
userList);
| if (userList==null)
OK, thanks. I finally understand your words JBossCache has automagic dirty
checking.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4023166#4023166
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4023166