[ 
http://jira.jboss.com/jira/browse/JBCACHE-89?page=comments#action_12315656 ]
     
Daniel Gredler commented on JBCACHE-89:
---------------------------------------

Yep. I just wanted to point out that it would be nice to somehow keep this 
flexibility once the standard way of configuring this is via XML.

> Allow Specifying Custom Interceptors in XML Configuration
> ---------------------------------------------------------
>
>          Key: JBCACHE-89
>          URL: http://jira.jboss.com/jira/browse/JBCACHE-89
>      Project: JBoss Cache
>         Type: Feature Request
>     Versions: 1.2
>     Reporter: Daniel Gredler
>     Assignee: Bela Ban
>     Priority: Minor
>      Fix For: 1.3

>
>
> It would be nice to be able to add interceptors via the XML configuration 
> files. Indeed, in TreeCache.java the following comment exists, which may 
> indicate that this feature is already planned:
>       // Create the interceptors in the correct order (later to be defined in 
> XML file)
>       createInterceptorChain();
> A possible example configuration would be:
>    <server>
>      <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar" /> 
>      <mbean code="org.jboss.cache.TreeCache" 
> name="jboss.cache:service=TreeCache">
>        ...
>        <attribute name="Interceptors">
>          <interceptor>com.foo.project.MyInterceptor</interceptor>
>        </attribute>
>        ...
>      </mbean>
>    </server>
> Something along the lines of the following method would then be able to add 
> the custom interceptors (in TreeCache.java):
>    public void setInterceptors(Element interceptors) throws Exception {
>       NodeList list = interceptors.getChildNodes();
>       for(int i = 0; i < list.getLength(); i++) {
>          org.w3c.dom.Node node = list.item(i);
>          if(node.getNodeType() != org.w3c.dom.Node.ELEMENT_NODE)
>             continue;
>          NodeList children = node.getChildNodes();
>          if(children.getLength() != 1)
>             continue;
>          org.w3c.dom.Node childNode = list.item(0);
>          if(childNode.getNodeType() != org.w3c.dom.Node.TEXT_NODE)
>             continue;
>          String className = childNode.getNodeValue();
>          if(className == null || className.length() == 0)
>             continue;
>          Interceptor interceptor = createInterceptor(className);
>          addInterceptor(interceptor_chain, interceptor);
>       }
>    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to