-
1. Re: getters/setter vs. field interception
julien1 Sep 9, 2004 6:18 PM (in response to rjlawre)> I have the following use case. I have a cache
> (subclass of java.util.Map) into which I put keys and
> values (which all have to be serializable). Let's
> take an example:
>
> Cache c;
> c.put("name", "Bela Ban");
>
> Whenever I put a new entry, it will be replicated to
> all cache instances. Caches can be in different
> processes, on different machines etc.
>
> Now consider a class Person with attrs name and age
> that I put into the cache:
>
> Person p=new Person("Bela Ban, 37);
> cache.put("bela", p);
>
> Now the entry will be replicated to all instances of
> the replicated cache. But when someone does
>
> p.setAge(p.getAge()++);
>
> the new value of p's age will not be replicated
> unless we put the item back into the cache:
>
> c.put("bela", p);
>
> See my problem ? If people forget to invoke the put()
> method, the values in the caches are going to become
> inconsistent.
>
Don't understand what would be the difference between intercepting methods and interception fields here.
Just do this.
public class CacheInterceptor
{
...
public Object invoke(Invocation invocation) ...
{
Method method = invocation.getMethod();
Object rtn = invocation.invokeNext();
if (method.getName().startsWith("set"))
{
cache.put("bela", targetObject);
}
}
}
> Now one could argue that this it is the programmer's
> fault, but it would be nice to take care of these
> things automatically.
>
> Another nice aspect would be that we would know
> exactly which field have changed, and therefore only
> replicated the field which actually changed, *not*
> the entire object. We currently replicate the entire
> object in HTTPSession replication and in clustering
> (stateful session beans).
>
I think this could be done as long as the app developer follows the getter/setter semantic.
Bill -
2. Re: Wiki module?
cookman Sep 9, 2004 9:06 PM (in response to rjlawre)Nukes integrates with JSPWiki, you can search "wiki" in the nukes user forum
-
3. Re: Wiki module?
jae77 Sep 9, 2004 9:13 PM (in response to rjlawre)this site uses a modified version of jspwiki.
here are two links on the topic
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=50376
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=47376
there have been other discussions about buiilding a native wiki module, but no one has taken up the task. this wiki does have some issues (ie: it doesn't always properly save a page), so "buyer beware" :)
hrm... since i want to setup a wiki myself, maybe i should look into a native nukes module. -
4. Re: Wiki module?
rjlawre Sep 9, 2004 10:03 PM (in response to rjlawre)Thanks for the pointers, I'll give this a try. As to a native module, xwiki (http://www.xwiki.org/) has some JSR-168 portlet support, so maybe in nukes 2, it will just plug right in :)
-
5. Re: Wiki module?
jae77 Sep 10, 2004 10:16 AM (in response to rjlawre)i'll take a look at xwiki and see what the possibilities are.
julien: didn't you say that bill wrote a parser for wiki html tags, where can i find that? -
-
7. Re: Wiki module?
jae77 Sep 12, 2004 9:45 PM (in response to rjlawre)where is that wiki parser so i can look into it - i should be able to hook into the existing html module as a base for the version history.
-
8. Re: Wiki module?
julien1 Sep 12, 2004 10:34 PM (in response to rjlawre)There is no written parser yet.
Actually the wiki parser must be integrated through the parser stack framework sitting in the common module.
Then the HTML module must be capable to interpret some files with a specialized content type "text/wiki" and render it. That would be an internal content type and the real content type is "text/html".
The interest of the parser stack integration is the unified use of this framework and the reuse accross different modules like news and of course the forum. -
9. Re: Wiki module?
triathlon98 Sep 13, 2004 3:49 AM (in response to rjlawre)There is a offline wiki module in JBoss cvs (I think Scott Stark wrote that). Alternatively, you could consider looking at radeox.
Joachim