<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Storing webservice properties using dynamic MBeans</title>
	<atom:link href="http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/</link>
	<description>Where Business meets IT</description>
	<lastBuildDate>Fri, 05 Mar 2010 05:28:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: suman</title>
		<link>http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/comment-page-1/#comment-228308</link>
		<dc:creator>suman</dc:creator>
		<pubDate>Wed, 16 Apr 2008 01:05:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/#comment-228308</guid>
		<description>From the above article
&quot;This gives the administrator the change to alter the properties through the Oracle Enterprise Manager instead of digging for property files on the server&quot;
I am trying to do a similar usecase, are these properties inside war,ear or jar or sar? Do you edit them inplace? Could you please let me know how do you do that? If not, if you explode the archive edit and rebundle the archive, how do you manage the production environment, do you assume it is downtime during this update or any other alternative so that the uses has seemless acess to the production applicaiton?

You quick responses would be highly appreciated.

tHanks much</description>
		<content:encoded><![CDATA[<p>From the above article<br />
&#8220;This gives the administrator the change to alter the properties through the Oracle Enterprise Manager instead of digging for property files on the server&#8221;<br />
I am trying to do a similar usecase, are these properties inside war,ear or jar or sar? Do you edit them inplace? Could you please let me know how do you do that? If not, if you explode the archive edit and rebundle the archive, how do you manage the production environment, do you assume it is downtime during this update or any other alternative so that the uses has seemless acess to the production applicaiton?</p>
<p>You quick responses would be highly appreciated.</p>
<p>tHanks much</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: suman</title>
		<link>http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/comment-page-1/#comment-228220</link>
		<dc:creator>suman</dc:creator>
		<pubDate>Tue, 15 Apr 2008 19:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/#comment-228220</guid>
		<description>Very good article. I have a similar usecase i need to implement. I am newbie to j2ee and jmx, could you help me with the steps for packaging it with ear. How did you package your mbean into ear. Package the mbean as jar, does this also include the jboss-service.xml, where does jboss-service.xml go into ear or jar?? Please give the complete details of packaging the mbean into an existing ear. 

I managed to run it by packaging it into .sar and run standalone but i need to pacakge it inot existing .ear now.

Thanks a lot in advance</description>
		<content:encoded><![CDATA[<p>Very good article. I have a similar usecase i need to implement. I am newbie to j2ee and jmx, could you help me with the steps for packaging it with ear. How did you package your mbean into ear. Package the mbean as jar, does this also include the jboss-service.xml, where does jboss-service.xml go into ear or jar?? Please give the complete details of packaging the mbean into an existing ear. </p>
<p>I managed to run it by packaging it into .sar and run standalone but i need to pacakge it inot existing .ear now.</p>
<p>Thanks a lot in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Albert Sikkema</title>
		<link>http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/comment-page-1/#comment-165235</link>
		<dc:creator>Albert Sikkema</dc:creator>
		<pubDate>Fri, 04 Jan 2008 08:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/#comment-165235</guid>
		<description>Hi Terry,

I implemented the load and saveproperties methods by just writing our properties to file (using encryption). Here&#039;s an example:
    /**
     * Loads the properties which are specified by the user.
     */
    public Boolean loadProperties() {
        FileInputStream fis;

        try {
            if (properties == null) {
                properties = new Properties();
            }

            synchronized (properties) {
                properties.clear();

                File f = new File(propertiesfile);

                if (f.exists()) {
                    fis = new FileInputStream(f);

                    Properties tempProps = new Properties();
                    tempProps.loadFromXML(fis);
                    properties = decryptProperties(tempProps);
                    fis.close();
                } else {
                    loadDefaultProperties();
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        return true;
    }


    /**
     * Persist the properties to file.
     * @return true if succesfull
     */
    public Boolean saveProperties() {
        FileOutputStream fos;

        try {
            File f = new File(propertiesfile);
            fos = new FileOutputStream(f);

            synchronized (properties) {
                String comment = &quot;Written by &quot; + this.getClass().getName();
                encryptProperties(properties).storeToXML(fos, comment, &quot;UTF-8&quot;);
                fos.close();
            }
        } catch (Exception e) {
            e.printStackTrace();

            return false;
        }

        return true;
    }

You can easily remove the encryption and decryption and use this.</description>
		<content:encoded><![CDATA[<p>Hi Terry,</p>
<p>I implemented the load and saveproperties methods by just writing our properties to file (using encryption). Here&#8217;s an example:<br />
    /**<br />
     * Loads the properties which are specified by the user.<br />
     */<br />
    public Boolean loadProperties() {<br />
        FileInputStream fis;</p>
<p>        try {<br />
            if (properties == null) {<br />
                properties = new Properties();<br />
            }</p>
<p>            synchronized (properties) {<br />
                properties.clear();</p>
<p>                File f = new File(propertiesfile);</p>
<p>                if (f.exists()) {<br />
                    fis = new FileInputStream(f);</p>
<p>                    Properties tempProps = new Properties();<br />
                    tempProps.loadFromXML(fis);<br />
                    properties = decryptProperties(tempProps);<br />
                    fis.close();<br />
                } else {<br />
                    loadDefaultProperties();<br />
                }<br />
            }<br />
        } catch (Exception e) {<br />
            e.printStackTrace();<br />
        }</p>
<p>        return true;<br />
    }</p>
<p>    /**<br />
     * Persist the properties to file.<br />
     * @return true if succesfull<br />
     */<br />
    public Boolean saveProperties() {<br />
        FileOutputStream fos;</p>
<p>        try {<br />
            File f = new File(propertiesfile);<br />
            fos = new FileOutputStream(f);</p>
<p>            synchronized (properties) {<br />
                String comment = &#8220;Written by &#8221; + this.getClass().getName();<br />
                encryptProperties(properties).storeToXML(fos, comment, &#8220;UTF-8&#8243;);<br />
                fos.close();<br />
            }<br />
        } catch (Exception e) {<br />
            e.printStackTrace();</p>
<p>            return false;<br />
        }</p>
<p>        return true;<br />
    }</p>
<p>You can easily remove the encryption and decryption and use this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Terry Bayne</title>
		<link>http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/comment-page-1/#comment-165015</link>
		<dc:creator>Terry Bayne</dc:creator>
		<pubDate>Thu, 03 Jan 2008 16:25:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/#comment-165015</guid>
		<description>Hi,

Thanks for the article.  I am a newbie to oracle web services (and java in general).  I&#039;ve been struggling to find a way to configure my web service(s) via the management interface.  Is there any chance I could see a simple example implementation of the loadProperties() and saveProperties() methods?

Thanks
Terry</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks for the article.  I am a newbie to oracle web services (and java in general).  I&#8217;ve been struggling to find a way to configure my web service(s) via the management interface.  Is there any chance I could see a simple example implementation of the loadProperties() and saveProperties() methods?</p>
<p>Thanks<br />
Terry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JDeveloper &#38; Oracle ADF &#187; Storing webservice properties using dynamic MBeans</title>
		<link>http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/comment-page-1/#comment-149373</link>
		<dc:creator>JDeveloper &#38; Oracle ADF &#187; Storing webservice properties using dynamic MBeans</dc:creator>
		<pubDate>Wed, 21 Nov 2007 05:38:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/#comment-149373</guid>
		<description>[...] Original post by Albert Sikkema [...]</description>
		<content:encoded><![CDATA[<p>[...] Original post by Albert Sikkema [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edwin Biemond</title>
		<link>http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/comment-page-1/#comment-146691</link>
		<dc:creator>Edwin Biemond</dc:creator>
		<pubDate>Sat, 17 Nov 2007 10:55:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/#comment-146691</guid>
		<description>Hi, We use mbeans for starting and stopping background processes and for status checking. I see you load the mbeans with orion-application but you can load the mbean also with a ServletContextListener 
see my blog. 

http://biemond.blogspot.com/2007/11/jmx-for-starting-background-processes.html</description>
		<content:encoded><![CDATA[<p>Hi, We use mbeans for starting and stopping background processes and for status checking. I see you load the mbeans with orion-application but you can load the mbean also with a ServletContextListener<br />
see my blog. </p>
<p><a href="http://biemond.blogspot.com/2007/11/jmx-for-starting-background-processes.html" rel="nofollow">http://biemond.blogspot.com/2007/11/jmx-for-starting-background-processes.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad Sneade</title>
		<link>http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/comment-page-1/#comment-146080</link>
		<dc:creator>Brad Sneade</dc:creator>
		<pubDate>Fri, 16 Nov 2007 18:52:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.it-eye.nl/weblog/2007/11/16/storing-webservice-properties-using-dynamic-mbeans/#comment-146080</guid>
		<description>I&#039;ve taken a similar approach to managing our application, but I used the Preferences API instead of Properties.  The Preferences API is especially nice for this since you don&#039;t have to worry about path information or any file IO (and associated exceptions). 

For projects using Spring there is an even easier approach using the MBeanExporter and the @ManagedResource annotation.  This JMX enables any Spring managed bean and (as you mentioned) admin your app through OEM.  Since Spring takes care of exporting your beans, you don&#039;t have to worry about the orion-specific config files either.  There are a few pitfalls in getting it to work properly in OC4J, but most of that has to do with how you are allowed to name your MBeans.

Its also worth mentioning that this can be used for more than configuration.  You can also gather statistics about your running application.  For instance, you could add a getInvokeCount() method and increment a counter every time invoke() is called.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve taken a similar approach to managing our application, but I used the Preferences API instead of Properties.  The Preferences API is especially nice for this since you don&#8217;t have to worry about path information or any file IO (and associated exceptions). </p>
<p>For projects using Spring there is an even easier approach using the MBeanExporter and the @ManagedResource annotation.  This JMX enables any Spring managed bean and (as you mentioned) admin your app through OEM.  Since Spring takes care of exporting your beans, you don&#8217;t have to worry about the orion-specific config files either.  There are a few pitfalls in getting it to work properly in OC4J, but most of that has to do with how you are allowed to name your MBeans.</p>
<p>Its also worth mentioning that this can be used for more than configuration.  You can also gather statistics about your running application.  For instance, you could add a getInvokeCount() method and increment a counter every time invoke() is called.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
