<?xml version="1.0"?><rss version="2.0">
<channel>
  <title>Java Beans dot Asia - beans category</title>
  <link>http://javabeans.asia/categories/beans/</link>
  <description>Just a few simple tutorials</description>
  <language>en</language>
  <copyright>Alexander Zagniotov</copyright>
  <lastBuildDate>Tue, 23 Feb 2010 11:04:00 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  <image>
    <url>/images/blog-image.jpg</url>
    <title>Java Beans dot Asia (beans category)</title>
    <link>http://javabeans.asia/</link>
  </image>
  <item>
    <title>JBoss Clustering Architecture - Distributed Replicant Manager</title>
    <link>http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html</link>
	 <description>
        My understanding of Distributed Replicant Manager (DRM) is that it allows you to attach some serialized data (stub) to a cluster node and manage it. &lt;br /&gt;
&lt;br /&gt;
Examples of this data include the list of stubs for a given RMI server. Each node has a stub to share with other nodes. The DRM enables the sharing of these stubs in the cluster, and allows one to know which node each stub belongs to.&lt;br /&gt;
&lt;br /&gt;
In case one of the nodes leaves the cluster, its stub is automatically removed from the list of replicants (stubs) that DRM maintains. &lt;br /&gt;
&lt;br /&gt;
Also for each set of replicants DRM holds an id, which is identical on all nodes in the cluster.&lt;br /&gt;
&lt;br /&gt;
I used DRM to attach a replicant to a node in the cluster. The replicant contains a String which holds a node IP that i get from &lt;em&gt;jboss.bind.address &lt;/em&gt;property. Every time my cluster is going through a topology changes, my service bean on the master node will prints out replicant list.&lt;br /&gt;
&lt;br /&gt;
My service MBean as follows:
&lt;pre name=&#034;code&#034; class=&#034;java:firstline[1]&#034;&gt;package com.example;&lt;br /&gt;&lt;br /&gt;public class CoordinatorHAService extends &lt;br /&gt;	HASingletonSupport implements &lt;br /&gt;			CoordinatorHAServiceMBean  {&lt;br /&gt;&lt;br /&gt;    private static Logger logger = &lt;br /&gt;	Logger.getLogger(CoordinatorHAService.class);&lt;br /&gt; &lt;br /&gt;	/**&lt;br /&gt;	 * Can be used instead of the constructor &lt;br /&gt;	 * defined in jboss-service.xml&lt;br /&gt;	 */&lt;br /&gt;	private static final String BIND_ADDRESS = &lt;br /&gt;		System.getProperty(&amp;quot;jboss.bind.address&amp;quot;);&lt;br /&gt;&lt;br /&gt;	/**&lt;br /&gt;	 * Custom name for this HA partition, overrides &lt;br /&gt;	 * the default HA partition name which is &lt;br /&gt;	 * canonical name of this MBean&lt;br /&gt;	 */&lt;br /&gt;	private final static &lt;br /&gt;	String COORDINATOR_HA_SERVICE_NAME = &lt;br /&gt;		&amp;quot;ServiceName:CoordinatorHAService&amp;quot;;&lt;br /&gt;	&lt;br /&gt;	/**&lt;br /&gt;	 * Current node IP&lt;br /&gt;	 */&lt;br /&gt;	private String nodeIp = null;&lt;br /&gt;&lt;br /&gt;	/**&lt;br /&gt;	 * Constructor that gets value of this node IP &lt;br /&gt;	 * from &#039;jboss.bind.address&#039; property&lt;br /&gt;	 * defined in jboss-service.xml&lt;br /&gt;	 * &lt;br /&gt;	 */&lt;br /&gt;	public CoordinatorHAService(String nodeIp) {&lt;br /&gt;		this.nodeIp = nodeIp;&lt;br /&gt;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	public void startService() throws Exception {&lt;br /&gt;&lt;br /&gt;	try {&lt;br /&gt;	/**&lt;br /&gt;	 * Call for super must be done before getting&lt;br /&gt;	 * HAPartition. If super is not called, HAPartition&lt;br /&gt;	 * will be &#039;null&#039;&lt;br /&gt;	 *&lt;br /&gt;	 * Alternatively you can use InitialContext to get &lt;br /&gt;	 * default partition, then you dont have to make &lt;br /&gt;	 * a call for super.startService(). I havent&lt;br /&gt;	 * tested it, so I am not sure of the results. &lt;br /&gt;	 *&lt;br /&gt;	 *&lt;br /&gt;	 * InitialContext ic = new InitialContext();&lt;br /&gt;	 * String partitionName = ServerConfigUtil.getDefaultPartitionName();&lt;br /&gt;	 * String partitionJndi = &amp;quot;/HAPartition/&amp;quot; + partitionName;&lt;br /&gt;	 * HAPartition partition = (HAPartition) ic.lookup(partitionJndi);&lt;br /&gt;	 */&lt;br /&gt;		super.startService();&lt;br /&gt;&lt;br /&gt;	/**&lt;br /&gt;	 * HAPartition gives access to the replicant manager,&lt;br /&gt;	 * which I am using to add node replicants to.&lt;br /&gt;	 */&lt;br /&gt;		HAPartition partition = super.getPartition();&lt;br /&gt;&lt;br /&gt;		if (partition != null) {&lt;br /&gt;			partition.getDistributedReplicantManager().add(&lt;br /&gt;					this.getServiceHAName(), this.getNodeIp());&lt;br /&gt;		}&lt;br /&gt;&lt;br /&gt;		} catch (Exception e) {&lt;br /&gt;			this.stopService();&lt;br /&gt;		}&lt;br /&gt;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	synchronized public void stopService() throws Exception {&lt;br /&gt;		super.stopService();&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	public boolean isMasterNode() {&lt;br /&gt;		return super.isMasterNode();&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	/**&lt;br /&gt;	 * Called when node is elected as a master node&lt;br /&gt;	 */&lt;br /&gt;	public void startSingleton() {&lt;br /&gt;	&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	/**&lt;br /&gt;	 * Called when node stops acting as a master node&lt;br /&gt;	 */&lt;br /&gt;	public void stopSingleton() {&lt;br /&gt;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	/**&lt;br /&gt;	 * Override this method only if you need to provide &lt;br /&gt;	 * a custom partition wide unique service name. &lt;br /&gt;	 * The default implementation will usually work,&lt;br /&gt;	 * provided that the getServiceName() method returns &lt;br /&gt;	 * a unique canonical MBean name.&lt;br /&gt;	 * &lt;br /&gt;	 */&lt;br /&gt;	public String getServiceHAName() {&lt;br /&gt;		// return super.getServiceHAName();&lt;br /&gt;		return CoordinatorHAService.COORDINATOR_HA_SERVICE_NAME;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	/**&lt;br /&gt;	 * Called when there are topology changes in the cluster.&lt;br /&gt;	 */&lt;br /&gt;	public void partitionTopologyChanged(List newReplicants, &lt;br /&gt;												int newViewID) {&lt;br /&gt;		super.partitionTopologyChanged(newReplicants, &lt;br /&gt;												newViewID);&lt;br /&gt;&lt;br /&gt;		/**&lt;br /&gt;		 * If current service is the master node - &lt;br /&gt;		 * print replicants in the cluster&lt;br /&gt;		 */&lt;br /&gt;		if (this.isMasterNode()) {&lt;br /&gt;			&lt;br /&gt;			List&lt;string&gt; clusterNodeIps = &lt;br /&gt;				new LinkedList&lt;string&gt;(newReplicants);&lt;br /&gt;&lt;br /&gt;			for (String clusterNodeIp : clusterNodeIps) {&lt;br /&gt;				logger.info(&amp;quot;Replicant IP: &amp;quot; + clusterNodeIp);	&lt;br /&gt;			}&lt;br /&gt;		}&lt;br /&gt;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	/**&lt;br /&gt;	 * Gets current node&#039;s IP&lt;br /&gt;	 */&lt;br /&gt;	public String getNodeIp() {&lt;br /&gt;		return nodeIp;&lt;br /&gt;	}&lt;br /&gt;} &lt;/string&gt;&lt;/string&gt;&lt;/pre&gt;
..and this is my &lt;em&gt;jboss-service.xml&lt;/em&gt; below:
&lt;pre class=&#034;xml:firstline[1]&#034; name=&#034;code&#034;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;server&amp;gt;&lt;br /&gt;    &amp;lt;mbean&lt;br /&gt;	code=&amp;quot;com.example.CoordinatorHAService&amp;quot;&lt;br /&gt;	name=&amp;quot;com.example:service=CoordinatorHAService&amp;quot;&amp;gt;&lt;br /&gt;	&amp;lt;constructor&amp;gt;&lt;br /&gt;	&amp;lt;arg type=&amp;quot;java.lang.String&amp;quot;&lt;br /&gt;		value=&amp;quot;${jboss.bind.address:127.0.0.1}&amp;quot; /&amp;gt;&lt;br /&gt;	  &amp;lt;/constructor&amp;gt;&lt;br /&gt;     &amp;lt;/mbean&amp;gt;&lt;br /&gt;&amp;lt;/server&amp;gt;&lt;/pre&gt;
In JBoss clustering architecture, DRM sits on top of HAPartition which abstracts the communication framework.&lt;br /&gt;
&lt;br /&gt;
Maybe this is not the most right way to do it, but I do find DRM useful if I want to manage information about my cluster nodes, and I dont want to rely on HAPartition to provide me with such information. &lt;br /&gt;
&lt;br /&gt;
The moment a new node joins the cluster, I insert its IP to my set of replicants. So I always have accurate and recent information about nodes in my cluster. In case of a dead node, my list of replicants gets updated with IP of the dead node removed from the list. The source code is attached to this post or you can just do copy/paste if you feel like it.&lt;br /&gt;
&lt;br /&gt;
JBoss clustering is a very big topic. So if someone is interested, JBoss group provides a PDF book called &lt;a href=&#034;http://docs.jboss.org/jbossas/clustering/JBossClustering7.pdf&#034; target=&#034;_blank&#034;&gt;JBoss AS Clustering&lt;/a&gt; on their website, its really useful and easy to understand. It walks through and talks about fundamental concepts of clustering. The book is a bit long but worth while to have a look ;)&lt;br /&gt;
&lt;br /&gt;
Any comments or/and flames about this post are welcomed ...&lt;br /&gt;
&lt;br /&gt;
cheers&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;t=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;t=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/27/jboss_security_jmx_console.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Security - JMX Console&#034;&gt;JBoss Security - JMX Console&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/24/drools_tutorial_on_writing_dsl_template.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools - tutorial on writing DSL template&#034;&gt;Drools - tutorial on writing DSL template&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/06/09/drools_stop_executing_current_agenda_group_and_all_rules.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools - Stop executing current agenda group and all rules&#034;&gt;Drools - Stop executing current agenda group and all rules&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/01/using_template_to_deploy_a_jboss_queue.html&#034; rel=&#034;bookmark&#034; title=&#034;Using template to deploy a JBoss queue&#034;&gt;Using template to deploy a JBoss queue&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&#034; rel=&#034;bookmark&#034; title=&#034;Deployment of mbean separately to its interface&#034;&gt;Deployment of mbean separately to its interface&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/08/jboss_clustering_hasingleton_service.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Clustering - HASingleton service&#034;&gt;JBoss Clustering - HASingleton service&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/11/drools_working_with_stateless_session.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools - working with Stateless session&#034;&gt;Drools - working with Stateless session&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&#034; rel=&#034;bookmark&#034; title=&#034;Stateless beans and annotations&#034;&gt;Stateless beans and annotations&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          My understanding of Distributed Replicant Manager (DRM) is that it allows you to attach some serialized data (stub) to a cluster node and manage it.   Examples of this data include the list of stubs for a given RMI server. Each node has a stub to share with other nodes. The DRM enables the sharing of these stubs in ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;t=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;title=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&amp;amp;t=JBoss Clustering Architecture - Distributed Replicant Manager&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <enclosure url="http://javabeans.asia/files/src/jboss_clustering_replicant_manager.zip" length="1737" type="application/zip" />
    <category>clustering</category>
    <category>jboss</category>
    <category>management beans</category>
    <comments>http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html</guid>
    <pubDate>Sat, 31 May 2008 07:37:00 GMT</pubDate>
  </item>
  <item>
    <title>JBoss Clustering - Shared state across cluster partition</title>
    <link>http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html</link>
	 <description>
        Did you know that if you have a JBoss cluster, HA singletons service beans on each can share a common memory state? State is a memory space shared by all HA singletons service beans in a cluster. It is possible save an object to the state using HA singleton service bean on one node, and to retrieve that object on another node.&lt;br /&gt;
&lt;br /&gt;
The implementation is very easy. Lets assume you have two nodes in a cluster, on each node you have HA singleton service bean running. Lets call them &amp;quot;&lt;em&gt;service A&lt;/em&gt;&amp;quot; and &amp;quot;&lt;em&gt;service B&lt;/em&gt;&amp;quot;. Your service beans should extend from &lt;em&gt;HASingletonSupport &lt;/em&gt;class. &lt;em&gt;HASingletonSupport&lt;/em&gt; in its turn extends from &lt;em&gt;HAServiceMBeanSupport. &lt;/em&gt;The latter gives you access to two methods:
&lt;pre class=&#034;codeSample&#034;&gt;public void setDistributedState(String key,&lt;br /&gt;                                Serializable value)&lt;br /&gt;                         throws Exception&lt;br /&gt;&lt;/pre&gt;
and
&lt;pre class=&#034;codeSample&#034;&gt;public Serializable getDistributedState(String key)&lt;br /&gt;&lt;/pre&gt;
These are convenience which allow you to save and retrieve objects from shared state. It can be whatever you want - primitive data types or even POJOs.&lt;br /&gt;
&lt;br /&gt;
Lets say somewhere inside you &lt;em&gt;service A&lt;/em&gt;, you have the following method:
&lt;pre name=&#034;code&#034; class=&#034;java:nocontrols:firstline[1]&#034;&gt;public void setObjectToSharedState()  {&lt;br /&gt;      String key = &amp;quot;test-1&amp;quot;;&lt;br /&gt;      String value = &amp;quot;Testing memory state&amp;quot;;&lt;br /&gt;&lt;br /&gt; 	try {&lt;br /&gt;	    this.setDistributedState(key, value);&lt;br /&gt;	}&lt;br /&gt;	catch (Exception e)  {&lt;br /&gt;		e.printStackTrace();&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;
Now, what has happened is that you, by using your &lt;em&gt;service A&lt;/em&gt; saved into the shared memory a String value, under a key name &amp;quot;&lt;em&gt;test-1&lt;/em&gt;&amp;quot;. This key name you can use in your &lt;em&gt;service B&lt;/em&gt; to retrieve its corresponding value from the shared memory, in this case a String. Lets say the following method is sitting somewhere in your &lt;em&gt;service B&lt;/em&gt; bean, on another node in the cluster:&lt;br /&gt;
&lt;pre name=&#034;code&#034; class=&#034;java:nocontrols:firstline[1]&#034;&gt;public void getObjectFromSharedState()  {&lt;br /&gt;      String key = &amp;quot;test-1&amp;quot;;&lt;br /&gt;      String value = (String) this.getDistributedState(key);&lt;br /&gt;      System.out.println(&amp;quot;The value is: &amp;quot; + value);&lt;br /&gt;}&lt;/pre&gt;
By specifying a key name, you can retrieve back from the shared memory what ever is saved under that key. You just have to know the type to cast it back to. &lt;br /&gt;
Also keep in mind: if you specify wrong key name, the retrieved object will be &lt;em&gt;null&lt;/em&gt;.&lt;br /&gt;
&lt;br /&gt;
Shared memory state is another option, if you want to share something between your nodes, and for some reason you don&#039;t want to use JBoss cache.&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;t=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;t=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/27/jboss_security_jmx_console.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Security - JMX Console&#034;&gt;JBoss Security - JMX Console&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/24/drools_tutorial_on_writing_dsl_template.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools - tutorial on writing DSL template&#034;&gt;Drools - tutorial on writing DSL template&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/06/09/drools_stop_executing_current_agenda_group_and_all_rules.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools - Stop executing current agenda group and all rules&#034;&gt;Drools - Stop executing current agenda group and all rules&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/01/using_template_to_deploy_a_jboss_queue.html&#034; rel=&#034;bookmark&#034; title=&#034;Using template to deploy a JBoss queue&#034;&gt;Using template to deploy a JBoss queue&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&#034; rel=&#034;bookmark&#034; title=&#034;Deployment of mbean separately to its interface&#034;&gt;Deployment of mbean separately to its interface&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/08/jboss_clustering_hasingleton_service.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Clustering - HASingleton service&#034;&gt;JBoss Clustering - HASingleton service&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/11/drools_working_with_stateless_session.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools - working with Stateless session&#034;&gt;Drools - working with Stateless session&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&#034; rel=&#034;bookmark&#034; title=&#034;Stateless beans and annotations&#034;&gt;Stateless beans and annotations&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          Did you know that if you have a JBoss cluster, HA singletons service beans on each can share a common memory state? State is a memory space shared by all HA singletons service beans in a cluster. It is possible save an object to the state using HA singleton service bean on one node, and to retrieve that object on ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;t=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;title=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&amp;amp;t=JBoss Clustering - Shared state across cluster partition&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>clustering</category>
    <category>jboss</category>
    <category>management beans</category>
    <comments>http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html</guid>
    <pubDate>Fri, 16 May 2008 13:15:00 GMT</pubDate>
  </item>
  <item>
    <title>JBoss Clustering - How many nodes in the cluster?</title>
    <link>http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html</link>
	 <description>
        If you want to know how many nodes there are in the current cluster partition, all you have to do is to ask &lt;em&gt;HAPartition&lt;/em&gt; for the node list. &lt;em&gt;HAPartition&lt;/em&gt; represents your cluster partition, and it contains all the information you need to know about your cluster and the nodes: their host names, IPs, position in the cluster view.&lt;br /&gt;
&lt;br /&gt;
Lets assume you have a service bean that extends from &lt;em&gt;HASingletonSupport&lt;/em&gt;. &lt;em&gt;HASingletonSupport &lt;/em&gt;in its turn extends from &lt;em&gt;HAServiceMBeanSupport. &lt;br /&gt;
&lt;br /&gt;
&lt;/em&gt;&lt;em&gt;HAServiceMBeanSupport &lt;/em&gt;is the one who gives you access&lt;em&gt; to HAPartition &lt;/em&gt;object. &lt;br /&gt;
&lt;br /&gt;
The code to request for HAPartition object and node list that you see below , you can put somewhere in your service bean:
&lt;pre class=&#034;codeSample&#034;&gt;HAPartition partition = getPartition();&lt;br /&gt;ClusterNode[] nodes = partition.getClusterNodes();&lt;br /&gt;System.out.println(nodes.length);&lt;br /&gt;&lt;/pre&gt;
&lt;em&gt;ClusterNode&lt;/em&gt; object represents your node in the cluster. It contains information about node&#039;s host name, its internet address and a few more things. &lt;em&gt;getClusterNodes()&lt;/em&gt;, returns to you an array contains as many &lt;em&gt;ClusterNode&lt;/em&gt; objects as you have currently in your cluster. So by getting the value of array length, you will know how many nodes your cluster has.&lt;br /&gt;
&lt;br /&gt;
Another way, is to do practically the same, but to request from a HAPartition a current view of your cluster:
&lt;pre class=&#034;codeSample&#034;&gt;HAPartition partition = getPartition();&lt;br /&gt;Vector v = partition.getCurrentView();&lt;br /&gt;&lt;br /&gt;System.out.println(partition.getCurrentView().size());&lt;br /&gt;&lt;br /&gt;for (Object o : v) {&lt;br /&gt;   System.out.println(o.toString());&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;
The view, which is a Vector contains information about node sockets. When printed, it will return to you a String representation of node ip + port:&amp;nbsp; xxx.xxx.xxx.xxx:port. Also by printing size of the Vector, you will get number of nodes in the cluster. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Important note&lt;/strong&gt;: &lt;br /&gt;
I noticed there is some delay happening from the time when node leaves the cluster to the time when HAPartition returns an updated view. In another words - after node has left the cluster and topology change has occurred, the HAPartition may return to you an old view still containing the dead node. So be careful. &lt;br /&gt;
&lt;br /&gt;
Also, &lt;em&gt;getPartition()&lt;/em&gt; may return null, if &lt;em&gt;super.startService()&lt;/em&gt; hasnt been called. Have a look at implementation of &lt;a href=&#034;http://docs.jboss.org/jbossas/javadoc/4.0.2/org/jboss/ha/jmx/HAServiceMBeanSupport.java.html&#034; target=&#034;_blank&#034;&gt;HAServiceMBeanSupport&lt;/a&gt; and my other post &lt;a href=&#034;http://javabeans.asia/2008/05/08/jboss_clustering_hasingleton_service.html&#034;&gt;JBoss Clustering - HASingleton service&lt;/a&gt;. &lt;br /&gt;
&lt;br /&gt;
Thats it.&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;t=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;t=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/27/jboss_security_jmx_console.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Security - JMX Console&#034;&gt;JBoss Security - JMX Console&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/24/drools_tutorial_on_writing_dsl_template.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools - tutorial on writing DSL template&#034;&gt;Drools - tutorial on writing DSL template&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/06/09/drools_stop_executing_current_agenda_group_and_all_rules.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools - Stop executing current agenda group and all rules&#034;&gt;Drools - Stop executing current agenda group and all rules&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/01/using_template_to_deploy_a_jboss_queue.html&#034; rel=&#034;bookmark&#034; title=&#034;Using template to deploy a JBoss queue&#034;&gt;Using template to deploy a JBoss queue&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&#034; rel=&#034;bookmark&#034; title=&#034;Deployment of mbean separately to its interface&#034;&gt;Deployment of mbean separately to its interface&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/08/jboss_clustering_hasingleton_service.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Clustering - HASingleton service&#034;&gt;JBoss Clustering - HASingleton service&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/11/drools_working_with_stateless_session.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools - working with Stateless session&#034;&gt;Drools - working with Stateless session&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&#034; rel=&#034;bookmark&#034; title=&#034;Stateless beans and annotations&#034;&gt;Stateless beans and annotations&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          If you want to know how many nodes there are in the current cluster partition, all you have to do is to ask HAPartition for the node list. HAPartition represents your cluster partition, and it contains all the information you need to know about your cluster and the nodes: their host names, IPs, position in the ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;t=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;title=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&amp;amp;t=JBoss Clustering - How many nodes in the cluster?&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>clustering</category>
    <category>jboss</category>
    <category>management beans</category>
    <comments>http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html</guid>
    <pubDate>Wed, 14 May 2008 08:36:00 GMT</pubDate>
  </item>
  <item>
    <title>Stateless beans and annotations</title>
    <link>http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html</link>
	 <description>
        Since EJB 3.0, it is possible to use &lt;a target=&#034;_blank&#034; href=&#034;http://java.sun.com/developer/technicalArticles/releases/j2se15/&#034;&gt;JDK 5.0 metadata annotations&lt;/a&gt; to create EJB 3.0 Java beans. This makes the development very easy. The only drawback here as I see it, that in case when you want to change/add/remove annotation you actually have to recompile the class. &lt;br /&gt;
&lt;br /&gt;
The example below shows how to create a stateless enterprise Java bean using annotations. The bean implements remote interface.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;The interface:&lt;/strong&gt;&lt;br /&gt;
&lt;pre class=&#034;java:nocontrols:firstline[1]&#034; name=&#034;code&#034;&gt;package com.test.stateless.interfaces;&lt;br /&gt;&lt;br /&gt;import javax.ejb.Remote;&lt;br /&gt;&lt;br /&gt;@Remote&lt;br /&gt;public interface StatelessTestRemote {&lt;br /&gt;	&lt;br /&gt;	public void doSomething();&lt;br /&gt;}&lt;/pre&gt;
Annotation &amp;quot;&lt;em&gt;Remote&lt;/em&gt;&amp;quot; specifies that the class is remote interface of the bean.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;The bean:&lt;/strong&gt;&lt;br /&gt;
&lt;pre class=&#034;java:nocontrols:firstline[1]&#034; name=&#034;code&#034;&gt;package com.test.stateless.beans;&lt;br /&gt;&lt;br /&gt;import javax.ejb.Stateless;&lt;br /&gt;import org.jboss.annotation.ejb.RemoteBinding;&lt;br /&gt;import com.test.stateless.interfaces.StatelessTestRemote;&lt;br /&gt;&lt;br /&gt;@Stateless&lt;br /&gt;@RemoteBinding(jndiBinding = &lt;br /&gt;    &amp;quot;com/test/stateless/beans/StatelessTestBean/remote&amp;quot;)&lt;br /&gt;&lt;br /&gt;public class StatelessTestBean &lt;br /&gt;		implements StatelessTestRemote {&lt;br /&gt;&lt;br /&gt;	public void doSomething()  {&lt;br /&gt;&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;
Annotation &amp;quot;&lt;em&gt;Stateless&lt;/em&gt;&amp;quot; specifies that the class is stateless bean.&lt;br /&gt;
Annotation &amp;quot;&lt;em&gt;RemoteBinding&lt;/em&gt;&amp;quot; specifies JNDI name for the interface.&lt;br /&gt;
&lt;br /&gt;
Keep in mind, that you can use @Remote in implementation bean itself, and it doesnt have to be inside the interface class. For example:
&lt;pre class=&#034;java:nocontrols:firstline[1]&#034; name=&#034;code&#034;&gt;@Stateless&lt;br /&gt;@Remote ({StatelessTestRemote.class})&lt;br /&gt;@RemoteBinding(jndiBinding = &lt;br /&gt;    &amp;quot;com/test/stateless/beans/StatelessTestBean/remote&amp;quot;)&lt;br /&gt;&lt;br /&gt;public class StatelessTestBean &lt;br /&gt;		   implements StatelessTestRemote {&lt;/pre&gt;
Thats it :)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Update:&lt;br /&gt;
&lt;/strong&gt;As &lt;a href=&#034;http://weblogs.java.net/blog/ljnelson&#034; target=&#034;_blank&#034; title=&#034;http://weblogs.java.net/blog/ljnelson&#034; rel=&#034;nofollow&#034;&gt;Laird Nelson&lt;/a&gt; has pointed out in his response to this post, it is possible to override annotations in the XML descriptor. I looked into it, and yes indeed - EJB 3.0 allows to override the behavior of annotations in the source code. Although there are some limitations which annotations can be overridden. You can refer to article &lt;a href=&#034;http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/partial_deployment_descriptors.html&#034; target=&#034;_blank&#034;&gt;JBoss EJB 3.0 partial deployment descriptors&lt;/a&gt; to find more detailed explanation about it :)&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;t=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;t=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&#034; rel=&#034;bookmark&#034; title=&#034;Deployment of mbean separately to its interface&#034;&gt;Deployment of mbean separately to its interface&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/08/jboss_clustering_hasingleton_service.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Clustering - HASingleton service&#034;&gt;JBoss Clustering - HASingleton service&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Clustering - How many nodes in the cluster?&#034;&gt;JBoss Clustering - How many nodes in the cluster?&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Clustering - Shared state across cluster partition&#034;&gt;JBoss Clustering - Shared state across cluster partition&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Clustering Architecture - Distributed Replicant Manager&#034;&gt;JBoss Clustering Architecture - Distributed Replicant Manager&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          Since EJB 3.0, it is possible to use JDK 5.0 metadata annotations to create EJB 3.0 Java beans. This makes the development very easy. The only drawback here as I see it, that in case when you want to change/add/remove annotation you actually have to recompile the class.   The example below shows how to create a ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;t=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;title=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&amp;amp;t=Stateless beans and annotations&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>beans</category>
    <category>stateless beans</category>
    <comments>http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html</guid>
    <pubDate>Sat, 10 May 2008 16:17:00 GMT</pubDate>
  </item>
  <item>
    <title>Deployment of mbean separately to its interface</title>
    <link>http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html</link>
	 <description>
        Few days ago i came across a little nasty thing during mbean deployment. What i did was separation of my mbean class and its interface in to two archives. So first i would deploy an archive contained my interfaces and then i would deploy an archive contained my bean classes. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt; Why did i do it this way?&lt;/strong&gt;&lt;br /&gt;
Well to minimize chances having &lt;em&gt;ClassCastException. &lt;/em&gt;Since JBoss creates a proxy to the bean from its interface. Having the interfaces deployed seperately from the bean itself, allows me easily to modify business logic in the bean (if needed). Therefore, I will have to redeploy only the bean itself, without the need to redeploy also the interface, which will not affect my proxies to the bean in the system.&lt;br /&gt;
&lt;br /&gt;
To my big surprise i got an exception:
&lt;pre name=&#034;code&#034; class=&#034;java:nocontrols:firstline[1]&#034;&gt;org.jboss.deployment.DeploymentException: &lt;br /&gt;Class does not expose a management interface: &lt;br /&gt;java.lang.Object; - nested throwable: &lt;br /&gt;(javax.management.NotCompliantMBeanException:&lt;br /&gt;Class does not expose a management interface: &lt;br /&gt;java.lang.Object)&lt;/pre&gt;
I could not understand where did I go wrong. I had my mbean class:
&lt;pre name=&#034;code&#034; class=&#034;java:nocontrols:firstline[1]&#034;&gt;public class MyService &lt;br /&gt;	extends ServiceMBeanSupport &lt;br /&gt;		implements MyServiceMBean {&lt;br /&gt;&lt;br /&gt;public void startService() throws Exception {&lt;br /&gt;		...&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;public void stopService() {&lt;br /&gt;		...&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;
I had my interface with extension &#039;MBean&#039;. The interface must have this extension, otherwise, you will receive a &lt;em&gt;Class does not expose a management interface&lt;/em&gt; exception :
&lt;pre name=&#034;code&#034; class=&#034;java:nocontrols:firstline[1]&#034;&gt;public interface MyServiceMBean extends ServiceMBean {&lt;br /&gt;	...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;
I had my jboss-service.xml:
&lt;pre name=&#034;code&#034; class=&#034;xml:nocontrols:firstline[1]&#034;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;server&amp;gt;&lt;br /&gt;  &amp;lt;mbean code=&amp;quot;com.example.MyService&amp;quot; &lt;br /&gt;         name=&amp;quot;com.example:service=MyService&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;/mbean&amp;gt;&lt;br /&gt;&amp;lt;/server&amp;gt;&lt;/pre&gt;
Finally, i discovered that it was because of the way i did the packaging. If you ever going to package mbean and its interface in two separate archives, they (mbean and its interface) must sit under &lt;em&gt;&lt;strong&gt;the same package name&lt;/strong&gt;&lt;/em&gt;! &lt;br /&gt;
&lt;br /&gt;
For example: if I in archive A, put my mbean class under the package name &amp;quot;&lt;em&gt;com.example.test&lt;/em&gt;&amp;quot;, then in archive B I have to put its interface also under&amp;nbsp; &amp;quot;&lt;em&gt;com.example.test&lt;/em&gt;&amp;quot;.&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;t=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;t=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/01/using_template_to_deploy_a_jboss_queue.html&#034; rel=&#034;bookmark&#034; title=&#034;Using template to deploy a JBoss queue&#034;&gt;Using template to deploy a JBoss queue&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/08/jboss_clustering_hasingleton_service.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Clustering - HASingleton service&#034;&gt;JBoss Clustering - HASingleton service&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/11/stateless_beans_and_annotations.html&#034; rel=&#034;bookmark&#034; title=&#034;Stateless beans and annotations&#034;&gt;Stateless beans and annotations&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/14/jboss_clustering_how_many_nodes_in_the_cluster.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Clustering - How many nodes in the cluster?&#034;&gt;JBoss Clustering - How many nodes in the cluster?&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/16/jboss_clustering_shared_state_across_cluster_partition.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Clustering - Shared state across cluster partition&#034;&gt;JBoss Clustering - Shared state across cluster partition&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/31/jboss_clustering_architecture_distributed_replicant_manager.html&#034; rel=&#034;bookmark&#034; title=&#034;JBoss Clustering Architecture - Distributed Replicant Manager&#034;&gt;JBoss Clustering Architecture - Distributed Replicant Manager&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          Few days ago i came across a little nasty thing during mbean deployment. What i did was separation of my mbean class and its interface in to two archives. So first i would deploy an archive contained my interfaces and then i would deploy an archive contained my bean classes.    Why did i do it this way? Well to ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;t=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;title=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html&amp;amp;t=Deployment of mbean separately to its interface&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>beans</category>
    <category>jboss</category>
    <category>management beans</category>
    <comments>http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2008/05/03/deployment_of_mbean_separately_to_its_interface.html</guid>
    <pubDate>Sat, 03 May 2008 09:51:00 GMT</pubDate>
  </item>
  </channel>
</rss>
