Configuration file format

"Bordet, Simone" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <[email protected]>
Hi all,

after discussing with Lachezar on this list I came up with the format below for the configuration file.

The attribute 'port' for the 'configuration' element is a server socket used to shutdown the configuration from remote.

A simple client like this does the job:

Socket socket = new Socket((String)null, 8872);
socket.getOutputStream().write("shutdown".getBytes());
socket.close();

It can be easily written in a public static void main(String[]) of a Shutdown class.

Comments are very welcome.

Simon


<?xml version="1.0" encoding="UTF-8" ?>

<configuration port="8872">
   
   <startup>

      <create classname="javax.management.timer.Timer" objectname="services:type=timer" loadername="null" />
      <call objectname="services:type=timer" operation="start" />

      <object objectid="obj1">
         <new classname="com.acme.ObjectNumberOne">
            <arg type="int">50</arg>
         </new>
      </object>

      <register objectname=":key1=value1,key2=value2">
         <arg type="java.lang.Object" refobjectid="obj1"/>
      </register>

      <create classname="mx4j.adaptor.http.HttpAdaptor" objectname="connectors:type=http" loadername="null" />
      <create classname="mx4j.adaptor.http.XSLTProcessor" objectname="connectors:type=http,processor=xslt" loadername="null" />
      <call objectname="connectors:type=http" attribute="ProcessorNameString">
         <arg type="string">connectors:type=http,processor=xslt</arg>
      </call>
      <call objectname="connectors:type=http" operation="start" />

   </startup>
   
   <shutdown>
   
      <call objectname="connectors:type=http" operation="stop" />
      <unregister objectname="connectors:type=http" />
      <unregister objectname="connectors:type=http,processor=xslt" />
      
      <unregister objectname=":key1=value1,key2=value2" />
      
      <call objectname="services:type=timer" operation="stop" />
      <unregister objectname="services:type=timer" />

   </shutdown>
   
</configuration>


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.