<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title></title>
	<atom:link href="http://techzen.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://techzen.wordpress.com</link>
	<description>Pondering on compassion that is greater than rationality</description>
	<lastBuildDate>Fri, 13 Nov 2009 06:50:10 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='techzen.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/b774efe8deb98eb991e294393b21648a?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title></title>
		<link>http://techzen.wordpress.com</link>
	</image>
			<item>
		<title>JMX</title>
		<link>http://techzen.wordpress.com/2009/11/13/jmx/</link>
		<comments>http://techzen.wordpress.com/2009/11/13/jmx/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 04:45:25 +0000</pubDate>
		<dc:creator>techzen</dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://techzen.wordpress.com/?p=1197</guid>
		<description><![CDATA[ModelMBean can be created by using any simple POJO.
ModelMBeanInfo = Interface, MBeanInfo     = Class
I was wondering &#8211; why does the MBeanInfo class not implement the ModelMBeanInfo interface?. MBeanInfo class does implement some methods defined in ModelMBeanInfo interface but not all the methods &#8211; like getDescriptors etc is not implemented, and in addition to that there [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1197&subd=techzen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>ModelMBean can be created by using any simple POJO.</p>
<p>ModelMBeanInfo = Interface, MBeanInfo     = Class</p>
<p>I was wondering &#8211; why does the MBeanInfo class not implement the ModelMBeanInfo interface?. MBeanInfo class does implement some methods defined in ModelMBeanInfo interface but not all the methods &#8211; like getDescriptors etc is not implemented, and in addition to that there are other methods like fastGetAttributes.</p>
<blockquote><p>Java resources wishing to be manageable instantiate the ModelMBean using the MBeanServer&#8217;s <strong>createMBean </strong>method. The resource then sets the ModelMBeanInfo and Descriptors for the ModelMBean instance</p>
<p>A Java object cannot be registered in the MBeanServer unless it is a JMX compliant MBean. By instantiating a ModelMBean, resources are guaranteed that the MBean is valid. MBeanException and RuntimeOperationsException must be thrown on every public method. This allows for wrapping exceptions from distributed communications (RMI, EJB, etc.)</p>
<p>The contents of the <code>MBeanInfo</code> for a Dynamic MBean are determined by its <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/management/DynamicMBean.html#getMBeanInfo()"><code>getMBeanInfo()</code></a> method. This includes Open MBeans and Model MBeans, which are kinds of Dynamic MBeans.</p></blockquote>
<p>We need the following class instances</p>
<div id="_mcePaste">
<pre class="brush: java;">
&lt;div&gt;ModelMBeanOperationInfo[] ops;
ModelMBeanAttributeInfo[] atts ;
ModelMBeanConstructorInfo[] cons;
ModelMBeanNotificationInfo[] notifs;
</pre>
<p>mmbinfo (intfc), mbinfo (class), mmbinfosupport (implementation of mmbinfo)</p>
<pre class="brush: java;">

  return new ModelMBeanInfoSupport( &quot;javax.management.modelmbean.ModelMBeanInfo&quot;, &quot;description&quot;, atts, cons, ops, notifs, desc );
  ObjectName mName = new ObjectName(&quot;JMXBookAgent:name=Modeled&quot;);
  client.createMBean( &quot;javax.management.modelmbean.RequiredModelMBean&quot;, mName );
 </pre>
<p>﻿Now once you have created an object of MMBISupport then you use it in the call of it&#8217;s setter method <span style="color:#ff6600;">setModelMBeanInfo <span style="color:#000000;">and only the is your bean ready to be used by other clients.</span></span></p>
<p><span style="color:#ff6600;"><span style="color:#000000;">So the sequence is:</span></span></p>
<p><span style="color:#ff6600;"><span style="color:#000000;">1. Create  an object of mmbiSupport and populate it (myInfo).</span></span></p>
<p><span style="color:#ff6600;"><span style="color:#000000;">2. Call the createBean method and pass it your ObjectName. (Registration)</span></span></p>
<p><span style="color:#ff6600;"><span style="color:#000000;">3. Call the setModelMBeanInfo method to set myInfo (Op. Exposer)</span></span></p>
<p><span style="color:#ff6600;"><span style="color:#000000;">4. Call the <span style="font-family:'Lucida Grande', Verdana, Arial, 'Bitstream Vera Sans', sans-serif;white-space:pre-wrap;">setManagedResource method to set POJO instance.</span></span></span></p>
<pre class="brush: java;">

String[] sig = { &quot;java.lang.Object&quot;, &quot;java.lang.String&quot; };
Object[] params = { obj, &quot;ObjectReference&quot; };
client.invoke( mName, &quot;setManagedResource&quot;, params, sig );
</pre>
<p><a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/management/MBeanInfo.html">Java 5.0 JMX Api Doc</a></p>
<p>Useful class for building  - <a href="http://www.javadocexamples.com/java_source/jmxbook/ch7/ModelMBeanInfoBuilder.java." target="_blank">ModelMBeanInfoBuilder.java</a></p>
<p>Code for  creating ModelMbean</p>
<pre class="brush: java;">
  //Step 1: Create your object
			DBModel mypojo = new DBModel();

			//Step 2: Expose it through ModelMBeanInfo
		    ModelMBeanInfoBuilder builder = new ModelMBeanInfoBuilder();
		    //Descriptor attDesc = builder.buildAttributeDescriptor( &quot;MyAttribute&quot;, null, &quot;always&quot;, &quot;10&quot;, null, &quot;getMyAttribute&quot;, null, &quot;10&quot; );
		    Descriptor attDesc = builder.buildAttributeDescriptor( &quot;MaxConn&quot;,&quot;Max Connection&quot;,&quot;never&quot;,&quot;0&quot;,&quot;0&quot;,&quot;getTotalConn&quot;,null,&quot;-1&quot;);
		    builder.addModelMBeanAttribute( &quot;MaxConn&quot;, &quot;java.lang.Integer&quot;, true, false, false, &quot;Get the max connection&quot;, attDesc );

		    Descriptor mbeanDesc = builder.buildMBeanDescriptor( &quot;DB&quot;, &quot;SampleDBModel&quot;, &quot;never&quot;, &quot;-1&quot;, null ,null, null, null );
		    ModelMBeanInfo myinfo = builder.buildModelMBeanInfo( mbeanDesc );

		    //Step 3: Register it
		    ObjectName oname = new ObjectName(dbDomainName);
		    MBeanServer mbs;
		    List mbsArl = MBeanServerFactory.findMBeanServer(null);
			if(mbsArl.size() &gt; 0)
			{
				mbs = (MBeanServer)mbsArl.get(0);
				System.out.println(&quot;Got existing mbean server . . . .&quot;);
			}
			else
				mbs = ManagementFactory.getPlatformMBeanServer();

			mbs.createMBean(&quot;javax.management.modelmbean.RequiredModelMBean&quot;, oname);

				//Step 4: Call the setters for our POJO and INFO objects.

				//Set our POJO
			    String[] sig = { &quot;java.lang.Object&quot;, &quot;java.lang.String&quot; };
			    Object[] params = { mypojo, &quot;ObjectReference&quot; };
			    mbs.invoke( oname, &quot;setManagedResource&quot;, params, sig );

				//Set our INFO
			    sig = new String[ 1 ];
			    sig[ 0 ] = &quot;javax.management.modelmbean.ModelMBeanInfo&quot; ;
			    params = new Object[ 1 ];
			    params[ 0 ] = myinfo;
			    mbs.invoke( oname, &quot;setModelMBeanInfo&quot;, params, sig );
</pre>
</div>
<p>PersistPeriod: Specifies the number of seconds that the OnTimer or NoMoreOftenThan persistence policies use. If you do not specify this attribute in the MBeanType or </p>
<p>MBeanAttribute elements, the assumed value is 0.If PersistPolicy is set to OnTimer, then the attribute is persisted when the number of seconds expires. If PersistPolicy is set to </p>
<p>NoMoreOftenThan, then persistence is constrained to happen not more often than the specified number seconds.<br />
Note: When specified in the MBeanType element, this value overrides any setting within an individual MBeanAttribute subelement.</p>
<p>PersistPolicy: Specifies how persistence will occur</p>
<p>Never. The attribute is never stored. This is useful for highly volatile data or data that only has meaning within the context of a session or execution period.<br />
OnTimer. The attribute is stored whenever the MBean type&#8217;s persistence timer, as defined in the PersistPeriod attribute, expires.<br />
OnUpdate. The attribute is stored every time the attribute is updated.<br />
NoMoreOftenThan. The attribute is stored every time it is updated unless the updates are closer together than the PersistPeriod. This mechanism helps prevent temporarily highly </p>
<p>volatile data from affecting performance.<br />
OnUnregister, that means that the value of the attribute is persisted when the MBean containing it is unregistered from the MBean Server</p>
<p>currencyTimeLimit: How long an attribute value is valid before needing to be refreshed.<br />
 0 = a seconds value</p>
<p>If you do not specify this attribute in the MBeanType or MBeanAttribute elements, the assumed value is Never. Note: When specified in the MBeanType element, this value overrides any setting within an individual MBeanAttribute subelement.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techzen.wordpress.com/1197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techzen.wordpress.com/1197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techzen.wordpress.com/1197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techzen.wordpress.com/1197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techzen.wordpress.com/1197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techzen.wordpress.com/1197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techzen.wordpress.com/1197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techzen.wordpress.com/1197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techzen.wordpress.com/1197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techzen.wordpress.com/1197/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1197&subd=techzen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://techzen.wordpress.com/2009/11/13/jmx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">techzen</media:title>
		</media:content>
	</item>
		<item>
		<title>Forces</title>
		<link>http://techzen.wordpress.com/2009/11/12/forces/</link>
		<comments>http://techzen.wordpress.com/2009/11/12/forces/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 01:20:59 +0000</pubDate>
		<dc:creator>techzen</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[poetry]]></category>

		<guid isPermaLink="false">http://techzen.wordpress.com/?p=1204</guid>
		<description><![CDATA[Knots of my imagination,
Tears me away from my bonds of Present,
Shreds  &#8211; self respect and dignity,
Real self &#8211; lost in the mundane thoughts,
Fake mountains of past and future.
Obstructing my view of life.
Blind, enslaved,
Despising my own imagination,
Watching,
Glasses shattered around,
- Mistaks of the past.
I remember, how these broke,
I remember, how I gently shaped them,
With every hope [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1204&subd=techzen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font:times 9pt;"><em>Knots of my imagination,<br />
Tears me away from my bonds of Present,<br />
Shreds  &#8211; self respect and dignity,<br />
Real self &#8211; lost in the mundane thoughts,<br />
Fake mountains of past and future.<br />
Obstructing my view of life.</em></span></p>
<p><em>Blind, enslaved,<br />
Despising my own imagination,<br />
Watching,<br />
Glasses shattered around,<br />
- Mistaks of the past.</p>
<p>I remember, how these broke,<br />
I remember, how I gently shaped them,<br />
With every hope and every dream,<br />
That I could possibly spawn.</p>
<p>These worn out dusty shoes,<br />
Of my imagination,<br />
Can take me no longer,<br />
To new places.</p>
<p>Awaken, dearest,<br />
Listen no more to lies,<br />
Spoken by ignorance.<br />
That flows in your veins.</p>
<p>And now,<br />
I see through my imagination,<br />
Walk through the shattered pieces,<br />
Careful not to trample on them again,<br />
And make my way out,</p>
<p>To breath the fresh air.<br />
and the livliness,<br />
completeness.<br />
opportunity,<br />
of the present.</p>
<p></em></p>
<p><em>Fragrance of the beautiful flowers,<br />
Calls me.<br />
Come dearest, Come to this beautiful present.<br />
We are here.<br />
Waiting for you.<br />
Gently. Purely .<br />
Ever Yours.<br />
</em></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techzen.wordpress.com/1204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techzen.wordpress.com/1204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techzen.wordpress.com/1204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techzen.wordpress.com/1204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techzen.wordpress.com/1204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techzen.wordpress.com/1204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techzen.wordpress.com/1204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techzen.wordpress.com/1204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techzen.wordpress.com/1204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techzen.wordpress.com/1204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1204&subd=techzen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://techzen.wordpress.com/2009/11/12/forces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">techzen</media:title>
		</media:content>
	</item>
		<item>
		<title>Swaraj</title>
		<link>http://techzen.wordpress.com/2009/11/11/swaraj/</link>
		<comments>http://techzen.wordpress.com/2009/11/11/swaraj/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 04:01:23 +0000</pubDate>
		<dc:creator>techzen</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[sahaja]]></category>

		<guid isPermaLink="false">http://techzen.wordpress.com/?p=1193</guid>
		<description><![CDATA[स्वराज   हमारा   जन्मसिद्ध  अधिकार हैं !
~~~~
आत्मा का प्रकाश शारीर में,
~~~~
निर्विचारिता मस्तिष्क में
~~~~
Swaraj is my birthright and I shall have it. Freedom from the slavery of thoughts &#8211; and guidance from the light of Atma. That is our path in this life. 


       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1193&subd=techzen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font-size:14pt;"><span style="color:#800000;"><strong>स्वराज   हमारा   जन्मसिद्ध  अधिकार हैं !</strong></span></span></p>
<p><span style="font-size:17pt;"><span style="color:#800000;"><strong>~~~~</strong></span></span></p>
<p><span style="font-size:11pt;"><span style="color:#800000;"><span style="color:#008000;"><strong>आत्मा का प्रकाश शारीर में,</strong></span></span></span></p>
<p><span style="font-size:11pt;"><span style="color:#800000;"><span style="color:#008000;">~~~~</span></span></span></p>
<p><span style="font-size:11pt;"><span style="color:#800000;"><span style="color:#008000;"><strong>निर्विचारिता मस्तिष्क में</strong></span></span></span></p>
<p><span style="font-size:medium;"><span style="color:#008000;">~~~~</span></span></p>
<p><span style="font-size:medium;">Swaraj is my birthright and I shall have it. Freedom from the slavery of thoughts &#8211; and guidance from the light of Atma. That is our path in this life. </span></p>
<div><span style="font-family:Arial, Helvetica, sans-serif;font-size:medium;"><span style="line-height:21px;white-space:pre-wrap;"><br />
</span></span></div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techzen.wordpress.com/1193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techzen.wordpress.com/1193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techzen.wordpress.com/1193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techzen.wordpress.com/1193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techzen.wordpress.com/1193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techzen.wordpress.com/1193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techzen.wordpress.com/1193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techzen.wordpress.com/1193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techzen.wordpress.com/1193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techzen.wordpress.com/1193/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1193&subd=techzen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://techzen.wordpress.com/2009/11/11/swaraj/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">techzen</media:title>
		</media:content>
	</item>
		<item>
		<title>Jboss JMX with Hyperic</title>
		<link>http://techzen.wordpress.com/2009/11/09/jboss-jmx-with-hyperic/</link>
		<comments>http://techzen.wordpress.com/2009/11/09/jboss-jmx-with-hyperic/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 09:56:38 +0000</pubDate>
		<dc:creator>techzen</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[hyperic]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[jmx]]></category>

		<guid isPermaLink="false">http://techzen.wordpress.com/?p=1185</guid>
		<description><![CDATA[One of the uses of JMX is for exposing any data across remotely.
If you need to use Jboss and Hyperic for JMX configuration then following configurations are required:
1. Select a property to be exposed. To test: take Catalina:type=StringCache , this is existing by default.
2. In Hyperic you can create the plugin .xml file either in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1185&subd=techzen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>One of the uses of JMX is for exposing any data across remotely.<br />
If you need to use Jboss and Hyperic for JMX configuration then following configurations are required:</p>
<p>1. Select a property to be exposed. To test: take Catalina:type=StringCache , this is existing by default.<br />
2. In Hyperic you can create the plugin .xml file either in the /hq-plugins folder or  in the /hq/agent-4.1.3/bundles/agent-4.1.3-1067/pdk plugins folder.</p>
<p>3. The plugin xml file for String cache jmx  attr named: cacheSize in the file customjmx-plugin.xml  is below:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;plugin name=&quot;customjmx&quot; package=&quot;org.hyperic.hq.product.jmx&quot;&gt;
  &lt;classpath&gt;
    &lt;include name=&quot;pdk/lib/mx4j&quot;/&gt;
  &lt;/classpath&gt;

  &lt;config name=&quot;jmx&quot; type=&quot;global&quot;&gt;
    &lt;option name=&quot;jmx.url&quot;
            description=&quot;JMX URL to MBeanServer&quot;
            default=&quot;service:jmx:rmi:///jndi/rmi://machineName:12345/jmxrmi&quot;/&gt;
  &lt;/config&gt;

&lt;property name=&quot;BEAN_NAME&quot;
            value=&quot;Catalina:type=StringCache&quot;/&gt;
&lt;server name=&quot;jboss_jmx&quot;&gt;
          &lt;property name=&quot;PROC_HOME_PROPERTY&quot; value=&quot;program.name=testJboss.sh&quot;/&gt;
          &lt;property name=&quot;PROC_MAIN_CLASS&quot; value=&quot;org.jboss.Main&quot;/&gt;
	  &lt;plugin type=&quot;autoinventory&quot;
		class=&quot;org.hyperic.hq.product.jmx.MxServerDetector&quot;/&gt;
	&lt;plugin type=&quot;measurement&quot;
			class=&quot;org.hyperic.hq.product.jmx.MxMeasurementPlugin&quot;/&gt;
          &lt;metric name=&quot;cacheSize&quot;
                  template=&quot;${BEAN_NAME}:cacheSize&quot;
                  alias=&quot;cacheSize&quot;
                  indicator=&quot;true&quot;/&gt;
 &lt;/server&gt;
&lt;/plugin&gt;
</pre>
<p>Hyperic uses SIGAR for discovering processes and the <a href="http://support.hyperic.com/display/SIGAR/PTQL">PTQL </a>is the process table query language used.<br />
Launch sigar using java -jar sigar.jar and test the ptql in this prompt.</p>
<p>The important thing to know is that arguments to ps command can be seen through pargs &lt;process_id&gt; and then knowing that -D is appended by default when the main class is defined and then the final sigar cmd becomes:</p>
<p>ps  State.Name.sw=java,Args.*.eq=org.jboss.Main,Args.*.re=-Dprogram.name=testJboss.sh</p>
<p>Where the value program.name=testJboss.sh is defined in the customjmx-plugin.xml in the PROC_HOME_PROPERTY value.</p>
<p>Also, recall that if you need to associate your custom Mbean with jboss mbean viewer &#8211; then you need to register your mbean in the jboss specific mbean server whose instances can be found through the following<a href="http://www.jboss.org/community/wiki/FindMBeanServer"> defined ways.</a></p>
<p>Also, to expose the jboss mbeans &#8211; to jconsole &#8211; follow the steps <a href="http://www.jboss.org/community/wiki/JBossMBeansInJConsole">detailed</a> here.</p>
<p>I modified the run.conf with the following java opts.</p>
<p>JAVA_OPTS=&#8221;-Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false  -Djboss.platform.mbeanserver -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl &#8220;</p>
<p>&nbsp;</p>
<p>To test if your plugin works:</p>
<pre class="brush: java;">
java -jar /home/hyp/hq/agent-4.1.3/bundles/agent-4.1.3-1067/pdk/lib/hq-product.jar -Dplugins.include=customjmx  -m discover -a metric -Dlog=DEBUG
</pre>
<p>It took some time &#8211; to identify this &#8211; mainly because of incomplete(and incorrect!_) documentation which is the evil part of using open source &#8211; the good thing was &#8211; the hyperic forum is definitely alive</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techzen.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techzen.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techzen.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techzen.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techzen.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techzen.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techzen.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techzen.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techzen.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techzen.wordpress.com/1185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1185&subd=techzen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://techzen.wordpress.com/2009/11/09/jboss-jmx-with-hyperic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">techzen</media:title>
		</media:content>
	</item>
		<item>
		<title>Naraina 5th Nov</title>
		<link>http://techzen.wordpress.com/2009/11/05/naraina-5th-nov/</link>
		<comments>http://techzen.wordpress.com/2009/11/05/naraina-5th-nov/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 17:51:18 +0000</pubDate>
		<dc:creator>techzen</dc:creator>
				<category><![CDATA[SY]]></category>
		<category><![CDATA[naraina]]></category>
		<category><![CDATA[sahaja]]></category>

		<guid isPermaLink="false">http://techzen.wordpress.com/?p=1182</guid>
		<description><![CDATA[Guru Nanak  was born around 500 yrs back in 1469 on 20th Oct and he lived for 70 years 5 months 7 days and got his realization at the age of 30. He was born in talvandi in pakistan.
When he was 13 his family decided to get the &#8220;janaiu&#8221; done but he refused it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1182&subd=techzen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Guru Nanak  was born around 500 yrs back in 1469 on 20th Oct and he lived for 70 years 5 months 7 days and got his realization at the age of 30. He was born in talvandi in pakistan.</p>
<p>When he was 13 his family decided to get the &#8220;janaiu&#8221; done but he refused it as to what can a thread provide me &#8211; in terms of purification. Understanding his bent towards spirituality his family decided to marry him at the age of 16. So he had two children also. He used to work as an accountant and used to work with dedication. In the morning he used to get up and meditate and also at night. When he used to count &#8211; he used to go into &#8220;complete silence&#8221; when saying &#8220;Terah &#8211; 13&#8243; which in turn can be heard as &#8220;Tera -&#8221; meaning Yours only God Almighty.</p>
<p>One day he had gone to take a bath in the river Ben and there he was inside the water for 3 days and he got God Realization &#8211; Complete revelation and complete knowledge of the divine and existence. Mardana was his dear disciple.</p>
<p>At that time when Guru Nanaka was born there was a lot of darkness . On this darkness He had said &#8211; that the times are like knife, the king like butchers and religion has taken wings and fly away.</p>
<p>Baba Farid (who was Guru of Nizamudin Auliya ) had successor Ibrahim. Guru Nanaka went to meet Ibrahim and he asked what is the right way Hindu or Islam &#8211; So Guru Nanaka said there is only one way &#8211; that which has been there since Anadi Kaal.  (Ancient times ) and that way is the way to grow the Chakras and Kundalini &#8211; there is no short cut or long cut  to know God. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Guru Nanaka had two principles: Two things &#8211; that people are equal and belief in service of humanity </strong></p>
<p>So the style of Guru Nanaka was a mild one where as Kabira was revolutionary. Kabira challenged things and proved them wrong &#8211; all superstitious things. Like he went to Maghar    (earlier was Marg Har &#8211; a place where one lost the way to go and ppl had the doubt that anybody who died there would go to hell ). And Kabira at the age of 125 to prove everybody wrong died at that place only.</p>
<p>Also there was an incident of Saint Farid going to meet Kabir &#8211; travelled, walked a difficult path all the way and when they met &#8211; they were silent for 3 days !! Kabira&#8217;s disciples were wondering what they two would talk about &#8211; but both of them were silent. So after Baba Farid went away &#8211; their disicples asked Kabira why did you not talk something? Kabira said where were you? Did you not hear that we talked all the time 3 days &#8211; but it was all done in silence !! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  -</p>
<p><strong>God is expressed in silence only. </strong></p>
<p>Where there is any problem or any calamity &#8211; it is best to go in thoughtless awareness &#8211; that is the greatest solution available.</p>
<p>The Love of Spirit is the only way to Purify the Attention &#8211; not through discipline or anger. And Kundalini is the shakti of the Spirit.</p>
<p>When you enjoy the Nature you can enjoy the beauty and it makes you thoughtless.<br />
And then you feel the bliss of nature inside you . When you get complete self realization then you become beauty and fragrance yourself &#8211; like a flower.</p>
<p>Kartik maas ki purnima has the brightest moon, though it is not full.<br />
Kala &#8211; the art &#8211; 16 phases of moon &#8211; are 16 phases of growth inside us. Sharad_Indu = Indu is moon &#8211; so already Sahaja Yogis have got 12 phases right upto Agya  (6th chakra &#8211; two parts left &#8211; right so 12) and then from 13 to 16 we need to travel with dedication.</p>
<p>So after Sahasrara, we have Ardh bindu then bindu and then Valay. Bindu is the complete 16 phase of moon. Completeness.  Mother is in the form of complete moon &#8211; giving blessings and love</p>
<p>Only a thankful heart can get the knowledge of this Divine love and keep the atma awakened. So one must remember to be grateful to Almighty Mother for this beautiful blessing and love.</p>
<p>One can get complete 100% realization &#8211; only with the Grace of Mother and her Compassion. Completely flowered with Her Love.</p>
<p>A complete sahaja yogi is one who is a Guru and being a Guru means that your Swadhistan which revolves in Nabhi has to be very strong and you need to have Motherly qualities in you. Even the greatest Muni&#8217;s and greatest Tapasvis that have been there had to worship the Adi Mother to gain the Completeness.</p>
<p>Every day man is moving towards his graveyard &#8211; we do not realize how the days end. When we have a holiday, we say to ourselves &#8211; never came to know how quickly the holidays ended. Similarly is the case of this life, we do not know how fast it ends. And so the Yogi&#8217;s &#8211; the seekers wish to get complete realization in this lifetime itself. But also, that we do not realize how we are <strong>blessed</strong> each and every day <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><em>1986 &#8211; Mahakali Puja &#8211; Mother said everything has to happen on its own time &#8211; and you must know worry &#8211; why it is not happening at your own set time &#8211; there are deep reasons for things happening the way they are.<br />
</em><br />
====================================<br />
Today&#8217;s meditation was Yummy Sweet Candy <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Amazing and in the end we had the bhajan   Durga &#8211; Arti wow thank you <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thank you very very very much.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techzen.wordpress.com/1182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techzen.wordpress.com/1182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techzen.wordpress.com/1182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techzen.wordpress.com/1182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techzen.wordpress.com/1182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techzen.wordpress.com/1182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techzen.wordpress.com/1182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techzen.wordpress.com/1182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techzen.wordpress.com/1182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techzen.wordpress.com/1182/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1182&subd=techzen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://techzen.wordpress.com/2009/11/05/naraina-5th-nov/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">techzen</media:title>
		</media:content>
	</item>
		<item>
		<title>Jboss JMX Url</title>
		<link>http://techzen.wordpress.com/2009/11/04/jm/</link>
		<comments>http://techzen.wordpress.com/2009/11/04/jm/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 09:20:46 +0000</pubDate>
		<dc:creator>techzen</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>

		<guid isPermaLink="false">http://techzen.wordpress.com/?p=1180</guid>
		<description><![CDATA[Hostname: name of machine where jboss is running
portnumber : is the port of jmxremote property and NOT jni and NOT RMI port defined in jboss-service.xml file.
So if you need to connect to jboss mbean through jconsole: add the following the run.conf file JAVA_OPTS
 -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djboss.platform.mbeanserver -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl
And then you can connect either remotely: localhost:12345
OR [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1180&subd=techzen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hostname: name of machine where jboss is running<br />
portnumber : is the port of jmxremote property and NOT jni and NOT RMI port defined in jboss-service.xml file.</p>
<p>So if you need to connect to jboss mbean through jconsole: add the following the run.conf file JAVA_OPTS</p>
<p> -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djboss.platform.mbeanserver -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl</p>
<p>And then you can connect either remotely: localhost:12345</p>
<p>OR </p>
<p>through the JMX service url</p>
<p>service:jmx:rmi:///jndi/rmi://HostName:portnumber/jmxrmi</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techzen.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techzen.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techzen.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techzen.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techzen.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techzen.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techzen.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techzen.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techzen.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techzen.wordpress.com/1180/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1180&subd=techzen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://techzen.wordpress.com/2009/11/04/jm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">techzen</media:title>
		</media:content>
	</item>
		<item>
		<title>Auth</title>
		<link>http://techzen.wordpress.com/2009/10/29/auth/</link>
		<comments>http://techzen.wordpress.com/2009/10/29/auth/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 10:21:36 +0000</pubDate>
		<dc:creator>techzen</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://techzen.wordpress.com/?p=1175</guid>
		<description><![CDATA[The identities of a user(username, SSN, employeeID, etc.) are stored as java.security.Principal objects in the Subject Principals set. The roles assigned to a user are also stored in the Principals set, but they are stored in named role sets using java.security.acl.Group instances. The Group interface is a subinterface of java.security.Principal. A Group is a collection [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1175&subd=techzen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The identities of a user(username, SSN, employeeID, etc.) are stored as java.security.Principal objects in the Subject Principals set. The roles assigned to a user are also stored in the Principals set, but they are stored in named role sets using java.security.acl.Group instances. The Group interface is a subinterface of java.security.Principal. A Group is a collection of Principals and or Groups. There can be any number of role sets assigned to a Subject. Currently the JBossSX framework uses two well known roles sets named &#8220;Roles&#8221; and &#8220;CallerPrincipal&#8221;. The &#8220;Roles&#8221; set is the set of Principals for the named roles as known in the application domain the Subject has been assigned. This role set is used by methods like the EJBContext.isCallerInRole(String) which is used by EJBs to see if the current caller belongs to the named application domain role. The CallerPrincipal role set consists of the Principal identity assigned to the user in the application domain. It is used by the EJBContext.getCallerPrincipal() method to allow the application domain to map from the operation environment identity to a user identity suitable for the application. If a Subject does not have a CallerPrincipal role set then the application identity is that of the operational environment identity.</p>
<p>extend  UsernamePasswordLoginModule<br />
validatePassword (Authenticates user against LDAP)<br />
getRoleSets (This adds the user role that was found in LDAP and you must hve valid role as well.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techzen.wordpress.com/1175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techzen.wordpress.com/1175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techzen.wordpress.com/1175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techzen.wordpress.com/1175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techzen.wordpress.com/1175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techzen.wordpress.com/1175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techzen.wordpress.com/1175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techzen.wordpress.com/1175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techzen.wordpress.com/1175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techzen.wordpress.com/1175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1175&subd=techzen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://techzen.wordpress.com/2009/10/29/auth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">techzen</media:title>
		</media:content>
	</item>
		<item>
		<title>CAS Restful Java Client</title>
		<link>http://techzen.wordpress.com/2009/10/27/cas-restful-java-client/</link>
		<comments>http://techzen.wordpress.com/2009/10/27/cas-restful-java-client/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 10:49:38 +0000</pubDate>
		<dc:creator>techzen</dc:creator>
				<category><![CDATA[CAS]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://techzen.wordpress.com/?p=1170</guid>
		<description><![CDATA[Here is a sample test cas restful java client.
To validate the service ticket you can use the code that is similar to yale cas client SecureUtil.java class sending an https request to /serviceValidate URL of CAS.

public static boolean validateFromCAS(String username, String password) throws Exception
	{

		String url = &#34;https://myPC.com:8443/cas/v1/tickets&#34;;
		try
		{
			HttpsURLConnection hsu = (HttpsURLConnection)openConn(url);
			String s =   URLEncoder.encode(&#34;username&#34;,&#34;UTF-8&#34;) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1170&subd=techzen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here is a sample test cas restful java client.<br />
To validate the service ticket you can use the code that is similar to yale cas client SecureUtil.java class sending an https request to /serviceValidate URL of CAS.</p>
<pre class="brush: java;">
public static boolean validateFromCAS(String username, String password) throws Exception
	{

		String url = &quot;https://myPC.com:8443/cas/v1/tickets&quot;;
		try
		{
			HttpsURLConnection hsu = (HttpsURLConnection)openConn(url);
			String s =   URLEncoder.encode(&quot;username&quot;,&quot;UTF-8&quot;) + &quot;=&quot; + URLEncoder.encode(&quot;adriza&quot;,&quot;UTF-8&quot;);
			s+=&quot;&amp;&quot; +URLEncoder.encode(&quot;password&quot;,&quot;UTF-8&quot;) + &quot;=&quot; + URLEncoder.encode(&quot;adriza&quot;,&quot;UTF-8&quot;);

			System.out.println(s);
			OutputStreamWriter out = new OutputStreamWriter(hsu.getOutputStream());
			BufferedWriter bwr = new BufferedWriter(out);
			bwr.write(s);
			bwr.flush();

			String tgt = hsu.getHeaderField(&quot;location&quot;);
			System.out.println( hsu.getResponseCode());
			if(tgt != null &amp;&amp; hsu.getResponseCode() != 400)
			{
				System.out.println(tgt);

				System.out.println(&quot;Tgt is : &quot; + tgt.substring( tgt.lastIndexOf(&quot;/&quot;) +1));
				tgt = tgt.substring( tgt.lastIndexOf(&quot;/&quot;) +1);
		        bwr.close();
		        closeConn(hsu);

		        String serviceURL = &quot;http://myPC.com:8080/testingWebSvc&quot;;
		        s = URLEncoder.encode(&quot;service&quot;,&quot;utf-8&quot;) +&quot;=&quot; + URLEncoder.encode(serviceURL,&quot;utf-8&quot;);
		        hsu = (HttpsURLConnection)openConn(url+ &quot;/&quot;+ tgt);
		        System.out.println(&quot;Response code is:  &quot; + hsu.getResponseCode());

     	                BufferedReader isr = new BufferedReader(   new
                                    InputStreamReader(hsu.getInputStream()));
		        String line;
		        System.out.println( hsu.getResponseCode());
		        while ((line = isr.readLine()) != null) {
		        	System.out.println( line);
		        }
		        isr.close();
		        hsu.disconnect();
		        return true;
		    }
			else
			{
				return false;
			}
		}
		catch(MalformedURLException mue)
		{
			mue.printStackTrace();
			throw mue;
		}
		catch(IOException ioe)
		{
			ioe.printStackTrace();
			throw ioe;
		}
	}
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techzen.wordpress.com/1170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techzen.wordpress.com/1170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techzen.wordpress.com/1170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techzen.wordpress.com/1170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techzen.wordpress.com/1170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techzen.wordpress.com/1170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techzen.wordpress.com/1170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techzen.wordpress.com/1170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techzen.wordpress.com/1170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techzen.wordpress.com/1170/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1170&subd=techzen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://techzen.wordpress.com/2009/10/27/cas-restful-java-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">techzen</media:title>
		</media:content>
	</item>
		<item>
		<title>Shutdown jboss</title>
		<link>http://techzen.wordpress.com/2009/10/22/shutdown-jboss/</link>
		<comments>http://techzen.wordpress.com/2009/10/22/shutdown-jboss/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 19:47:00 +0000</pubDate>
		<dc:creator>techzen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jboss]]></category>

		<guid isPermaLink="false">http://techzen.wordpress.com/2007/11/27/shutdown-jboss/</guid>
		<description><![CDATA[[Original : November 2007]
[rubik:/tmp/jboss-3.2.3/bin] % ./shutdown.sh -s jnp://myremotemachineOrIP:1099Shutdown message has been posted to the server.Server shutdown may take a while &#8211; check logfiles for completion
Stopping JBoss when running multiple JBoss instances using the Service Binding Manager
./shutdown.sh -s jnp://myserver:31099 -S

You will again use the lower-case -s flag but you will need to look in your bindings [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=87&subd=techzen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>[Original : November 2007]</p>
<p>[rubik:/tmp/jboss-3.2.3/bin] % ./shutdown.sh -s jnp://myremotemachineOrIP:1099Shutdown message has been posted to the server.Server shutdown may take a while &#8211; check logfiles for completion</p>
<p>Stopping JBoss when running multiple JBoss instances using the Service Binding Manager</p>
<p><span style="color:#6600cc;"><span style="font-size:85%;font-family:courier new;">./shutdown.sh -s jnp://myserver:31099 -S</span><br />
</span><br />
You will again use the lower-case -s flag but you will need to look in your bindings file to find the port of each Naming service.</p>
<p><span style="font-size:85%;font-family:courier new;">&lt;service-bindings&gt; </span><br />
<span style="font-size:85%;font-family:courier new;">&lt;server name=&#8221;ports-default&#8221;&gt; &lt;</span><br />
<span style="font-size:85%;font-family:courier new;">service-config name=&#8221;jboss:service=Naming&#8221; delegateClass=&#8221;org.jboss.services.binding.AttributeMappingDelegate&#8221; &gt; </span><br />
<span style="font-size:85%;font-family:courier new;">&lt;delegate-config portName=&#8221;Port&#8221; hostName=&#8221;BindAddress&#8221;&gt;</span><br />
<span style="font-size:85%;font-family:courier new;">&lt;attribute name=&#8221;RmiPort&#8221;&gt;1098</span><br />
<span style="font-size:85%;font-family:courier new;">&lt;/attribute&gt; &lt;/delegate-config&gt; </span><br />
<span style="font-size:85%;font-family:courier new;">&lt;binding port=&#8221;1099&#8243; host=&#8221;${jboss.bind.address}&#8221;/&gt; </span><br />
<span style="font-size:85%;font-family:courier new;">&lt;/service-config&gt;</span></p>
<p><strong>UPDATE &#8211; 22-Oct-2009</strong></p>
<p>-&gt;  Default behavior is to shutdown (S)<br />
Other operations:<br />
-S, &#8211;shutdown            Shutdown the server<br />
-e, &#8211;exit=<code> Force the VM to exit with a status code<br />
-H, --halt=</code><code> Force the VM to halt with a status code<br />
And default port for shutdown used is jnp  1099. You can test this by experimenting with jnp port in jboss-service.xml</code></p>
<p>Another point is that usage of username , password for authentication for shutdown.  (u,p)<br />
If you have enabled the interceptor in jmx-invoker-service.xml file  in deploy folder.</p>
<pre class="brush: xml;">
&lt;!-- Uncomment to require authenticated users --&gt;
                  &lt;interceptor code=&quot;org.jboss.jmx.connector.invoker.AuthenticationInterceptor&quot;
                     securityDomain=&quot;java:/jaas/jmx-console&quot;/&gt;
</pre>
<p>Then it will refer to the security Domain jmx-console from the login-config.xml in the conf folder to check if user credentials.If user is not valid then it will throw the following Exception:</p>
<p>jboss-4.2.3.GA\bin&gt;shutdown.bat -S<br />
Exception in thread &#8220;main&#8221; java.lang.SecurityException: Failed to authenticate principal=null, securityDomain=jmx-console<br />
at org.jboss.jmx.connector.invoker.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:97)</p>
<p>In login-config.xml you can define your own login class that will check if the user has valid roles and credentials for doing the op.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techzen.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techzen.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techzen.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techzen.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techzen.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techzen.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techzen.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techzen.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techzen.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techzen.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=87&subd=techzen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://techzen.wordpress.com/2009/10/22/shutdown-jboss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">techzen</media:title>
		</media:content>
	</item>
		<item>
		<title>Understanding Inspektr</title>
		<link>http://techzen.wordpress.com/2009/10/19/understanding-inspektr/</link>
		<comments>http://techzen.wordpress.com/2009/10/19/understanding-inspektr/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 04:10:42 +0000</pubDate>
		<dc:creator>techzen</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[CAS]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://techzen.wordpress.com/?p=1156</guid>
		<description><![CDATA[Inspektr library is an auditing aspect built inside CAS server.
This library has two aspects built in &#8211; one is AuditTrailManagementAspect and other is StatisticManagementAspect.
Like any other aspect class the above two classes are annotated with
@Aspect at top class definition and
@Around for managing aop method execution.
The notable points wrt this library are:
There is a custom annotation [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1156&subd=techzen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Inspektr library is an auditing aspect built inside CAS server.</p>
<p>This library has two aspects built in &#8211; one is AuditTrailManagementAspect and other is StatisticManagementAspect.</p>
<p>Like any other aspect class the above two classes are annotated with</p>
<p>@Aspect at top class definition and<br />
@Around for managing aop method execution.</p>
<p>The notable points wrt this library are:<br />
There is a custom annotation that is created called @Auditable (similarly @Statistics)<br />
To create a custom annotation we need to define the class as follows:</p>
<pre class="brush: java;">
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Auditable {}
</pre>
<p>Then there are three parts to Auditing: (user info, resource info, action info)<br />
Principal: User info<br />
Resource: Ticket info (ST or TGT)<br />
Action : type of ticket created info (Failure or success)</p>
<p>So classes providing this info are injected along to the AuditAspect class along with the name of the class that will know how to publish this information to the right output.</p>
<p>User info, we have the class called TicketOrCredentialBasedAuditablePrincipalResolver.<br />
Resource: Service ticket info, ServiceResourceResolver<br />
Action: ObjectCreationAuditableActionResolver (prefixes failure/success based on null value check of object)</p>
<p>One question can come is why are we keeping all the resources in the list of of constructer. Example if I only need to audit the service ticket creation or validation then should the references of other resources is needed? . The answer is that object creation of these resources takes place one time only in the construction of the aspect class so that these object handlers of resources can be used in different places (be it TGT or ST creation etc.) .</p>
<p>If there is no @Auditable tag kept only at the level of service ticket creation then only one resource resolver an be kept at the list level which is ServiceResourceResolver. (Note you would need to remove @auditable annotation from other places to avoid error)</p>
<pre class="brush: xml;">
&lt;bean id=&quot;auditTrailManagementAspect&quot; class=&quot;org.inspektr.audit.AuditTrailManagementAspect&quot;&gt;
		&lt;constructor-arg index=&quot;0&quot; ref=&quot;auditablePrincipalResolver&quot; /&gt;
		&lt;constructor-arg index=&quot;1&quot;&gt;
         	&lt;list&gt;
	         	&lt;bean class=&quot;org.jasig.cas.audit.spi.CredentialsAsFirstParameterResourceResolver&quot; /&gt;
	         	&lt;bean class=&quot;org.jasig.cas.audit.spi.TicketAsFirstParameterResourceResolver&quot; /&gt;
	         	&lt;bean class=&quot;org.jasig.cas.audit.spi.ServiceResourceResolver&quot; /&gt;
			&lt;/list&gt;
		&lt;/constructor-arg&gt;
		&lt;constructor-arg index=&quot;2&quot;&gt;
			&lt;list&gt;
				&lt;bean class=&quot;org.inspektr.audit.support.ConsoleAuditTrailManager&quot; /&gt;
			&lt;/list&gt;
      	&lt;/constructor-arg&gt;
		&lt;constructor-arg index=&quot;3&quot; value=&quot;CAS&quot; /&gt;
   &lt;/bean&gt;
&lt;bean id=&quot;auditablePrincipalResolver&quot;
                class=&quot;org.jasig.cas.audit.spi.TicketOrCredentialBasedAuditablePrincipalResolver&quot;&gt;
		&lt;constructor-arg index=&quot;0&quot; ref=&quot;ticketRegistry&quot; /&gt;
	&lt;/bean&gt;
</pre>
<p>The class that manages the final bundle of information &#8211; i.e clubbing of complete info related to resource, principal and action is AuditableActionContext that stores all the data (strings of info) in it and the object of this class is then used by the manager that &#8220;records&#8221; the information in the right output. So for example the ConsoleTrailManager will do a simple sysout of the information.</p>
<pre class="brush: java;">
 public void record(final AuditableActionContext auditableActionContext) {
        System.out.println(&quot;Audit trail record BEGIN&quot;);
        System.out.println(&quot;=============================================================&quot;);
        System.out.println(&quot;WHO: &quot; + auditableActionContext.getPrincipal());
        System.out.println(&quot;WHAT: &quot; + auditableActionContext.getResourceOperatedUpon());
        System.out.println(&quot;ACTION: &quot; + auditableActionContext.getActionPerformed());
        System.out.println(&quot;APPLICATION: &quot; + auditableActionContext.getApplicationCode());
        System.out.println(&quot;WHEN: &quot; + auditableActionContext.getWhenActionWasPerformed());
        System.out.println(&quot;CLIENT IP ADDRESS: &quot; + auditableActionContext.getClientIpAddress());
        System.out.println(&quot;SERVER IP ADDRESS: &quot; + auditableActionContext.getServerIpAddress());
        System.out.println(&quot;=============================================================&quot;);
        System.out.println(&quot;\n&quot;);
    }
</pre>
<p>So if you need to record additional information like browser info, session id , etc, then you need to see if you wish to extend Auditable or create your own custom Aspect class that will handle all the data.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techzen.wordpress.com/1156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techzen.wordpress.com/1156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techzen.wordpress.com/1156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techzen.wordpress.com/1156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techzen.wordpress.com/1156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techzen.wordpress.com/1156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techzen.wordpress.com/1156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techzen.wordpress.com/1156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techzen.wordpress.com/1156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techzen.wordpress.com/1156/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techzen.wordpress.com&blog=3437533&post=1156&subd=techzen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://techzen.wordpress.com/2009/10/19/understanding-inspektr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">techzen</media:title>
		</media:content>
	</item>
	</channel>
</rss>