[jboss-dev-forums] [Design of Management Features on JBoss] - Re: Using xinclude in config files
snacker
do-not-reply at jboss.com
Thu Nov 15 16:08:10 EST 2007
Compiling this:
| import java.io.File;
| import javax.xml.parsers.DocumentBuilder;
| import javax.xml.parsers.DocumentBuilderFactory;
| import javax.xml.transform.Result;
| import javax.xml.transform.Source;
| import javax.xml.transform.Transformer;
| import javax.xml.transform.TransformerFactory;
| import javax.xml.transform.dom.DOMSource;
| import javax.xml.transform.stream.StreamResult;
| import org.w3c.dom.Document;
|
| public class JunkXInclude{
| public static void main( String[] args )throws Exception{
| DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
| dbf.setNamespaceAware( true );
| dbf.setXIncludeAware( true );
| System.out.println( "dbf=" + dbf );
| DocumentBuilder db = dbf.newDocumentBuilder();
| System.out.println( "db=" + db );
| Document doc = db.parse( new File( null == args || 0 == args.length ? "/jboss/server/all/deploy/deploy.last/cachea-service.xml" : args[ 0 ] ) );
| System.out.println( "doc=" + doc );
| Source source = new DOMSource(doc);
| Result result = new StreamResult( System.out );
| Transformer xformer = TransformerFactory.newInstance().newTransformer();
| xformer.transform(source, result);
| }
| }
|
... and executing with this:
anonymous wrote :
| java -cp xml-apis.jar;xercesImpl.jar;serializer.jar;resolver.jar;. JunkXInclude
|
shows that it is properly included:
| <?xml version="1.0" encoding="UTF-8" standalone="no"?><server>
| <classpath archives="jboss-cache.jar, jgroups.jar" codebase="./lib"/>
| <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=CacheA">
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
| <depends>jboss:service=FarmMember,partition=${jboss.partition.name:DefaultPartition}</depends>
|
| <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
| <attribute name="IsolationLevel">NONE</attribute>
| <attribute name="CacheMode">REPL_ASYNC</attribute>
| <attribute name="ClusterName">CacheA-Cluster</attribute>
| <attribute name="ClusterConfig">
| <!--xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="/jboss/server/all/deploy/deploy.last/config-setup.xml" xpointer="element(/1/1)"/>
| <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="/jboss/server/all/deploy/deploy.last/config-setup.xml" xpointer="element(/1/2)"/-->
| <TCP bind_addr="localhost" id="cache-config-a-tcp" loopback="true" start_port="7850" xml:base="/jboss/server/all/deploy/deploy.last/config-setup.xml"/>
| <TCPPING down_thread="true" id="cache-config-a-tcpping" initial_hosts="localhost[7850]" num_initial_members="1" port_range="1" timeout="3500" up_thread="true" xml:base="/jboss/server/all/deploy/deploy.last/config-setup.xml"/>
| <MERGE2 max_interval="10000" min_interval="5000"/>
| <FD_SOCK/>
| <FD down_thread="true" max_tries="5" shun="true" timeout="2500" up_thread="true"/>
| <VERIFY_SUSPECT down_thread="false" timeout="1500" up_thread="false"/>
| <pbcast.NAKACK down_thread="true" gc_lag="100" retransmit_timeout="300,600,1200,2400,4800" up_thread="true"/>
| <pbcast.STABLE desired_avg_gossip="50000" down_thread="false" max_bytes="2100000" stability_delay="1000" up_thread="false"/>
| <pbcast.GMS join_retry_timeout="2000" join_timeout="5000" print_local_addr="true" shun="false"/>
| <pbcast.STATE_TRANSFER down_thread="true" up_thread="true"/>
| </attribute>
|
| <attribute name="SyncReplTimeout">20000</attribute>
| <attribute name="InitialStateRetrievalTimeout">600000</attribute>
|
| <!-- Max number of milliseconds to wait for a lock acquisition -->
| <attribute name="LockAcquisitionTimeout">15000</attribute>
| <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
| <attribute name="EvictionPolicyConfig">
| <config>
| <attribute name="wakeUpIntervalSeconds">600</attribute>
| <region name="/_default_">
| <attribute name="maxNodes">10000</attribute>
| <attribute name="timeToIdleSeconds">14400</attribute>
| </region>
| </config>
| </attribute>
| </mbean>
| </server>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105220#4105220
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105220
More information about the jboss-dev-forums
mailing list