[jboss-cvs] JBossAS SVN: r63972 - in trunk/cluster/src: main/org/jboss/ha/framework/server and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jul 11 10:58:36 EDT 2007
Author: jerrygauth
Date: 2007-07-11 10:58:35 -0400 (Wed, 11 Jul 2007)
New Revision: 63972
Modified:
trunk/cluster/src/etc/farm-beans.xml
trunk/cluster/src/etc/farm-service.xml
trunk/cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java
trunk/cluster/src/main/org/jboss/ha/framework/server/FarmMemberServiceMBean.java
Log:
JBAS-4276, partition injection changes for FarmMemberService
Modified: trunk/cluster/src/etc/farm-beans.xml
===================================================================
--- trunk/cluster/src/etc/farm-beans.xml 2007-07-11 14:14:21 UTC (rev 63971)
+++ trunk/cluster/src/etc/farm-beans.xml 2007-07-11 14:58:35 UTC (rev 63972)
@@ -9,8 +9,8 @@
<depends>HAPartition</depends>
- <property name="clusterPartition"><inject bean="HAPartition"/></property>
- <property name="deployer">jboss.system:service=MainDeployer</property>
+ <property name="HAPartition"><inject bean="HAPartition"/></property>
+ <property name="deployer">jboss.system:service=MainDeployer</property>
<!-- The URLComparator can be used to specify a deployment ordering
for deployments found in a scanned directory. The class specified
Modified: trunk/cluster/src/etc/farm-service.xml
===================================================================
--- trunk/cluster/src/etc/farm-service.xml 2007-07-11 14:14:21 UTC (rev 63971)
+++ trunk/cluster/src/etc/farm-service.xml 2007-07-11 14:58:35 UTC (rev 63972)
@@ -10,9 +10,7 @@
<mbean code="org.jboss.ha.framework.server.FarmMemberService" name="jboss:service=FarmMember,partition=DefaultPartition" >
- <!-- We now inject the partition into the HAJNDI service instead
- of requiring that the partition name be passed -->
- <depends optional-attribute-name="ClusterPartition"
+ <depends optional-attribute-name="HAPartition"
proxy-type="attribute">jboss:service=${jboss.partition.name:DefaultPartition}</depends>
<!-- TODO Why was this here?
Modified: trunk/cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java 2007-07-11 14:14:21 UTC (rev 63971)
+++ trunk/cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java 2007-07-11 14:58:35 UTC (rev 63972)
@@ -50,9 +50,8 @@
*/
public class FarmMemberService extends URLDeploymentScanner implements FarmMemberServiceMBean
{
- protected ClusterPartitionMBean mClusterPartition = null;
+ protected HAPartition mClusterPartition = null;
protected String mBackgroundPartition = ServerConfigUtil.getDefaultPartitionName();
- protected HAPartition mHAPartition;
private File mTempDirectory;
private ClusterFileTransfer mFileTransfer;
@@ -66,18 +65,13 @@
{
return mBackgroundPartition;
}
-
- public void setPartitionName( String pPartitionName )
- {
- log.warn("setPartitionName does nothing; use setClusterPartition");
- }
- public ClusterPartitionMBean getClusterPartition()
+ public HAPartition getHAPartition()
{
return mClusterPartition;
}
- public void setClusterPartition(ClusterPartitionMBean clusterPartition)
+ public void setHAPartition(HAPartition clusterPartition)
{
if( ( getState () != STARTED ) && ( getState () != STARTING ) )
{
@@ -129,22 +123,20 @@
throws Exception
{
try
- {
- log.debug( "registerRPCHandler" );
-
+ {
if (mClusterPartition == null)
{
- throw new IllegalStateException("Must set the ClusterPartition property before calling start");
+ throw new IllegalStateException("HAPartition property must be set before starting FarmMember service");
}
- mHAPartition = mClusterPartition.getHAPartition();
- mBackgroundPartition = mHAPartition.getPartitionName();
+ mBackgroundPartition = mClusterPartition.getPartitionName();
- mHAPartition.registerRPCHandler( SERVICE_NAME, this );
+ log.debug( "registerRPCHandler" );
+ mClusterPartition.registerRPCHandler( SERVICE_NAME, this );
- mFileTransfer = new ClusterFileTransfer(mHAPartition, buildParentFolderMapping());
+ mFileTransfer = new ClusterFileTransfer(mClusterPartition, buildParentFolderMapping());
- ArrayList response = mHAPartition.callMethodOnCoordinatorNode(
+ ArrayList response = mClusterPartition.callMethodOnCoordinatorNode(
SERVICE_NAME,
"farmDeployments",
new Object[] {}, new Class[] {},
@@ -158,7 +150,7 @@
if ( map != null && map instanceof HashMap )
{
HashMap farmed = (HashMap) map;
- pullNewDeployments(mHAPartition, farmed);
+ pullNewDeployments(mClusterPartition, farmed);
}
}
@@ -376,8 +368,8 @@
try
{
- // We check if we must do a remote call or not: maybe the deploy
- // is already the consequence of a farm call! (avoid recusivity!)
+ // We check if we must do a remote call or not; maybe the deploy
+ // is already the consequence of a farm call! (avoid recursivity!)
//
boolean consequenceOfRemoteCall = false;
synchronized (remotelyDeployed)
@@ -393,7 +385,7 @@
this.mFileTransfer.push(file, parent.getName(), true);
- mHAPartition.callMethodOnCluster(
+ mClusterPartition.callMethodOnCluster(
SERVICE_NAME,
"farmDeploy",
new Object[] {parent.getName(), file, fileDate},
@@ -443,7 +435,7 @@
if (!consequenceOfRemoteCall)
{
- mHAPartition.callMethodOnCluster(
+ mClusterPartition.callMethodOnCluster(
SERVICE_NAME,
"farmUndeploy",
new Object[] {parentName, fileName},
@@ -459,7 +451,7 @@
}
/**
- * Go through the myriad of nested JMX exception to pull out the true
+ * Go through the myriad of nested JMX exceptions to pull out the true
* exception if possible and log it.
*
* @param e The exception to be logged.
Modified: trunk/cluster/src/main/org/jboss/ha/framework/server/FarmMemberServiceMBean.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/framework/server/FarmMemberServiceMBean.java 2007-07-11 14:14:21 UTC (rev 63971)
+++ trunk/cluster/src/main/org/jboss/ha/framework/server/FarmMemberServiceMBean.java 2007-07-11 14:58:35 UTC (rev 63972)
@@ -21,12 +21,10 @@
*/
package org.jboss.ha.framework.server;
-import java.net.MalformedURLException;
-
import javax.management.ObjectName;
+import org.jboss.ha.framework.interfaces.HAPartition;
import org.jboss.mx.util.ObjectNameFactory;
-import org.jboss.deployment.scanner.URLDeploymentScannerMBean;
/**
* MBean interface for FarmMemberService
@@ -45,27 +43,19 @@
ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss:service=FarmMember");
/**
- * Gets the name of the HAPartition used by this service.
+ * Gets the name of the partition used by this service. This is a
+ * convenience method as the partition name is an attribute of HAPartition.
*
* @return the name of the partition
- *
- * @deprecated use {@link #getClusterPartition()}
*/
String getPartitionName();
-
+
/**
- * Backward compatibility, but ignored as it does nothing.
- *
- * @deprecated use {@link #setClusterPartition(ClusterPartitionMBean)}
- */
- void setPartitionName(String name);
-
- /**
* Get the underlying partition used by this service.
*
* @return the partition
*/
- ClusterPartitionMBean getClusterPartition();
+ HAPartition getHAPartition();
/**
* Sets the underlying partition used by this service.
@@ -73,5 +63,5 @@
*
* @param clusterPartition the partition
*/
- void setClusterPartition(ClusterPartitionMBean clusterPartition);
+ void setHAPartition(HAPartition clusterPartition);
}
More information about the jboss-cvs-commits
mailing list