[jboss-cvs] JBossAS SVN: r67139 - in trunk/cluster: src/main/org/jboss/ha/framework/interfaces and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Nov 15 11:15:05 EST 2007
Author: bstansberry at jboss.com
Date: 2007-11-15 11:15:04 -0500 (Thu, 15 Nov 2007)
New Revision: 67139
Removed:
trunk/cluster/src/main/org/jboss/ha/framework/interfaces/ClusteringTargetsRepository.java
trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfo.java
trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfoImpl.java
trunk/cluster/src/main/org/jboss/ha/framework/interfaces/GenericClusteringException.java
Modified:
trunk/cluster/.classpath
trunk/cluster/build.xml
trunk/cluster/pom.xml
Log:
[JBAS-4976] Integrate jboss-ha-client.jar
Modified: trunk/cluster/.classpath
===================================================================
--- trunk/cluster/.classpath 2007-11-15 16:14:10 UTC (rev 67138)
+++ trunk/cluster/.classpath 2007-11-15 16:15:04 UTC (rev 67139)
@@ -28,5 +28,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/main"/>
<classpathentry kind="lib" path="/thirdparty/jboss/metadata/lib/jboss-metadata.jar" sourcepath="/thirdparty/jboss/metadata/lib/jboss-metadata-sources.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/ha/lib/jboss-ha-client.jar" sourcepath="/thirdparty/jboss/ha/lib/jboss-ha-client-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/cluster/build.xml
===================================================================
--- trunk/cluster/build.xml 2007-11-15 16:14:10 UTC (rev 67138)
+++ trunk/cluster/build.xml 2007-11-15 16:15:04 UTC (rev 67139)
@@ -78,6 +78,7 @@
<path refid="junit.junit.classpath"/>
<path refid="jgroups.jgroups.classpath"/>
<path refid="jboss.cache.classpath"/>
+ <path refid="jboss.ha.classpath"/>
<path refid="oswego.concurrent.classpath"/>
<path refid="jboss.remoting.classpath"/>
<path refid="jboss.microcontainer.classpath"/>
@@ -293,8 +294,8 @@
</fileset>
</jar>
- <!-- Build the jbossha-client.jar -->
- <jar jarfile="${build.lib}/jbossha-client.jar"
+ <!-- Build the jboss-ha-legacy-client.jar -->
+ <jar jarfile="${build.lib}/jboss-ha-legacy-client.jar"
manifest="${build.etc}/default.mf">
<fileset dir="${build.classes}">
<include name="org/jboss/ha/framework/interfaces/**"/>
Modified: trunk/cluster/pom.xml
===================================================================
--- trunk/cluster/pom.xml 2007-11-15 16:14:10 UTC (rev 67138)
+++ trunk/cluster/pom.xml 2007-11-15 16:15:04 UTC (rev 67139)
@@ -48,6 +48,10 @@
<groupId>jboss</groupId>
<artifactId>jboss-cache</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jboss.cluster</groupId>
+ <artifactId>jboss-ha-client</artifactId>
+ </dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-system-jmx</artifactId>
Deleted: trunk/cluster/src/main/org/jboss/ha/framework/interfaces/ClusteringTargetsRepository.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/framework/interfaces/ClusteringTargetsRepository.java 2007-11-15 16:14:10 UTC (rev 67138)
+++ trunk/cluster/src/main/org/jboss/ha/framework/interfaces/ClusteringTargetsRepository.java 2007-11-15 16:15:04 UTC (rev 67139)
@@ -1,108 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ha.framework.interfaces;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * JVM singleton that associates a list of targets (+ other info)
- * contained in a FamilyClusterInfo to a proxy family. For example
- * All remote proxies for a given EJB in a given cluster are part of the
- * same proxy family. Note that home and remote for a same EJB form *2*
- * proxy families.
- *
- * @see org.jboss.ha.framework.interfaces.FamilyClusterInfo
- * @see org.jboss.ha.framework.interfaces.FamilyClusterInfoImpl
- *
- * @author <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
- * @version $Revision$
- *
- * <p><b>Revisions:</b>
- *
- * <p><b>2002/08/23, Sacha Labourey:</b>
- * <ul>
- * <li> First implementation </li>
- * </ul>
- */
-
-public class ClusteringTargetsRepository
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- protected static Hashtable families = new Hashtable ();
-
- // Static --------------------------------------------------------
-
- public synchronized static FamilyClusterInfo initTarget (String familyName, List targets)
- {
- return initTarget (familyName, targets, 0L);
- }
-
- public synchronized static FamilyClusterInfo initTarget (String familyName, List targets, long viewId)
- {
- // this method must be somehow synchronized to avoid multiple FamilyClusterInfoImpl
- // for the same familyName in multi-threaded app accessing the same bean
- //
- FamilyClusterInfoImpl family = (FamilyClusterInfoImpl)families.get (familyName);
- if (family == null)
- {
- family = new FamilyClusterInfoImpl (familyName, targets, viewId);
- families.put (familyName, family);
- }
- else
- {
- // no need to initialize: it is already done: we keep the same object
- //
- family.updateClusterInfo (targets, viewId); // should not happen: possible if redeploy after undeploy fails
- }
-
- return family;
-
- }
-
- public static FamilyClusterInfo getFamilyClusterInfo (String familyName)
- {
- return (FamilyClusterInfo)families.get (familyName);
- }
-
- // Constructors --------------------------------------------------
-
- private ClusteringTargetsRepository () {}
-
- // Public --------------------------------------------------------
-
- // Z implementation ----------------------------------------------
-
- // Y overrides ---------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted: trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfo.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfo.java 2007-11-15 16:14:10 UTC (rev 67138)
+++ trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfo.java 2007-11-15 16:15:04 UTC (rev 67139)
@@ -1,102 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ha.framework.interfaces;
-
-import java.util.List;
-
-/**
- * Maintain information for a given proxy family. Proxies can statically reference
- * objects implementing this interface: only the content will change as the
- * cluster topology changes, not the FamilyClusterInfo object itself.
- * Proxies or LoadBalancing policy implementations can use the cursor and object
- * attribute to store arbitrary data that is then shared accross all proxies belonging
- * to the same family.
- * Initial access to this object is done through the ClusteringTargetsRepository singleton.
- *
- * @see org.jboss.ha.framework.interfaces.FamilyClusterInfoImpl
- * @see org.jboss.ha.framework.interfaces.ClusteringTargetsRepository
- *
- * @author <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
- * @version $Revision$
- *
- * <p><b>Revisions:</b>
- *
- * <p><b>2002/08/23, Sacha Labourey:</b>
- * <ul>
- * <li> First implementation </li>
- * </ul>
- */
-
-public interface FamilyClusterInfo
-{
- public String getFamilyName ();
-
- /**
- * Gets the list of targets for this family.
- *
- * <strong>NOTE:</strong> Implementations should synchronize on themselves
- * when executing this method (see JBAS-2071).
- */
- public List getTargets ();
- public long getCurrentViewId ();
-
- /**
- * Remove the given target from the list of targets.
- *
- * <strong>NOTE:</strong> Implementations should synchronize on themselves
- * when executing this method (see JBAS-2071).
- *
- * @param target the target
- * @return the updated list of targets
- */
- public List removeDeadTarget(Object target);
-
- /**
- * Updates the targets and the view id.
- *
- * <strong>NOTE:</strong> Implementations should synchronize on themselves
- * when executing this method (see JBAS-2071).
- */
- public List updateClusterInfo (List targets, long viewId);
-
- public boolean currentMembershipInSyncWithViewId();
-
- /**
- * Force a reload of the view at the next invocation.
- *
- * <strong>NOTE:</strong> Implementations should synchronize on themselves
- * when executing this method (see JBAS-2071).
- */
- public void resetView ();
-
- // arbitrary usage by the LoadBalancePolicy implementation
- // We could have used an HashMap but the lookup would have taken
- // much more time and we probably don't need as much flexibility
- // (+ it is slow for a simple int)
- //
- public int getCursor();
- public int setCursor (int cursor);
- public Object getObject ();
- public Object setObject (Object whatever);
-
- public final static int UNINITIALIZED_CURSOR = 999999999;
-}
Deleted: trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfoImpl.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfoImpl.java 2007-11-15 16:14:10 UTC (rev 67138)
+++ trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfoImpl.java 2007-11-15 16:15:04 UTC (rev 67139)
@@ -1,186 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ha.framework.interfaces;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Default implementation of FamilyClusterInfo
- *
- * @see org.jboss.ha.framework.interfaces.FamilyClusterInfo
- * @see org.jboss.ha.framework.interfaces.ClusteringTargetsRepository
- *
- * @author <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
- * @version $Revision$
- */
-public class FamilyClusterInfoImpl implements FamilyClusterInfo
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- public String familyName = null;
- ArrayList targets = null;
- long currentViewId = 0;
- boolean isViewMembersInSyncWithViewId = false;
-
- int cursor = FamilyClusterInfo.UNINITIALIZED_CURSOR;
- Object arbitraryObject = null;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- private FamilyClusterInfoImpl (){ }
-
- protected FamilyClusterInfoImpl (String familyName, List targets, long viewId)
- {
- this.familyName = familyName;
- this.targets = cloneList(targets);
- this.currentViewId = viewId;
-
- this.isViewMembersInSyncWithViewId = false;
- }
-
- // Public --------------------------------------------------------
-
- // FamilyClusterInfo implementation ----------------------------------------------
-
- public String getFamilyName () { return this.familyName; }
-
- /**
- * Returns an unmodifiable view of the target list.
- *
- * @see Collections#unmodifiableList(List)
- */
- public synchronized List getTargets ()
- {
- return Collections.unmodifiableList(this.targets);
- }
- public long getCurrentViewId () { return this.currentViewId; }
- public int getCursor () { return this.cursor; }
- public int setCursor (int cursor) { return (this.cursor = cursor);}
- public Object getObject () { return this.arbitraryObject; }
- public Object setObject (Object whatever) { this.arbitraryObject = whatever; return this.arbitraryObject; }
-
- public List removeDeadTarget(Object target)
- {
- synchronized (this)
- {
- ArrayList tmp = (ArrayList) targets.clone();
- tmp.remove (target);
- this.targets = tmp;
- this.isViewMembersInSyncWithViewId = false;
- return Collections.unmodifiableList(this.targets);
- }
- }
-
- public List updateClusterInfo (List targets, long viewId)
- {
- synchronized (this)
- {
- this.targets = cloneList(targets);
- this.currentViewId = viewId;
- this.isViewMembersInSyncWithViewId = true;
- return Collections.unmodifiableList(this.targets);
- }
- }
-
- public boolean currentMembershipInSyncWithViewId ()
- {
- return this.isViewMembersInSyncWithViewId;
- }
-
- public void resetView ()
- {
- synchronized (this)
- {
- this.currentViewId = -1;
- this.isViewMembersInSyncWithViewId = false;
- }
- }
-
- // Object overrides ---------------------------------------------------
-
- public int hashCode()
- {
- return this.familyName.hashCode ();
- }
-
- public boolean equals (Object o)
- {
- if (o instanceof FamilyClusterInfoImpl)
- {
- FamilyClusterInfoImpl fr = (FamilyClusterInfoImpl)o;
- return fr.familyName == this.familyName;
- }
- else
- return false;
- }
-
- public String toString()
- {
- StringBuffer tmp = new StringBuffer(super.toString());
- tmp.append("{familyName=");
- tmp.append(familyName);
- tmp.append(",targets=");
- tmp.append(targets);
- tmp.append(",currentViewId=");
- tmp.append(currentViewId);
- tmp.append(",isViewMembersInSyncWithViewId=");
- tmp.append(isViewMembersInSyncWithViewId);
- tmp.append(",cursor=");
- tmp.append(cursor);
- tmp.append(",arbitraryObject=");
- tmp.append(arbitraryObject);
- tmp.append("}");
- return tmp.toString();
- }
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
- private static ArrayList cloneList(List toClone)
- {
- if (toClone instanceof ArrayList)
- {
- synchronized (toClone)
- {
- return (ArrayList) ((ArrayList) toClone).clone();
- }
- }
-
- ArrayList clone = new ArrayList(toClone.size());
- synchronized (toClone)
- {
- clone.addAll(toClone);
- }
- return clone;
- }
-}
Deleted: trunk/cluster/src/main/org/jboss/ha/framework/interfaces/GenericClusteringException.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/framework/interfaces/GenericClusteringException.java 2007-11-15 16:14:10 UTC (rev 67138)
+++ trunk/cluster/src/main/org/jboss/ha/framework/interfaces/GenericClusteringException.java 2007-11-15 16:15:04 UTC (rev 67139)
@@ -1,124 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ha.framework.interfaces;
-
-import org.jboss.util.NestedException;
-
-/**
- * Generic clustering exception that can be used to replace other exceptions
- * that occur on the server. Thus, only this class is needed on the client side
- * and some specific server side exceptions class are not needed on the client side
- * (such as JMX exceptions for example).
- * Furhtermore, it has support for "COMPLETED" status flag a la IIOP.
- *
- * @author <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
- * @version $Revision$
- *
- * <p><b>Revisions:</b>
- *
- * <p><b>8 avril 2002 Sacha Labourey:</b>
- * <ul>
- * <li> First implementation </li>
- * </ul>
- */
-
-public class GenericClusteringException
- extends NestedException
-{
- // When an invocation reaches a node, it may be invoked on the actual
- // target or not (or not completely). If COMPLETED_NO and working in
- // a clustered environment, the client proxy is allowed to invoke
- // the same invocation on a different node. Otherwise, it will depend
- // if the target method is idempotent: this is no more the problem of
- // this class but rather the meta-data of the business environment
- // that can give this information
- //
- public final static int COMPLETED_YES = 0;
- public final static int COMPLETED_NO = 1;
- public final static int COMPLETED_MAYBE = 2;
-
- public boolean isDefinitive = true;
-
- // if yes, then the invocation may be retried against another node
- // because the state has not been modified by the current invocation
- //
- public int completed;
-
- public GenericClusteringException ()
- {
- this.completed = this.COMPLETED_MAYBE;
- }
-
- public GenericClusteringException (int CompletionStatus)
- {
- this.completed = CompletionStatus;
- }
-
- public GenericClusteringException (int CompletionStatus, String s)
- {
- super(s);
- this.completed = CompletionStatus;
- }
-
- public GenericClusteringException (int CompletionStatus, String s, boolean isDefinitive)
- {
- super(s);
- this.completed = CompletionStatus;
- this.isDefinitive = isDefinitive;
- }
-
- public GenericClusteringException (int CompletionStatus, Throwable nested, boolean isDefinitive)
- {
- super(nested);
- this.completed = CompletionStatus;
- this.isDefinitive = isDefinitive;
- }
-
- public GenericClusteringException (int CompletionStatus, Throwable nested)
- {
- super(nested);
- this.completed = CompletionStatus;
- }
-
- public int getCompletionStatus ()
- {
- return this.completed;
- }
-
- public void setCompletionStatus (int completionStatus)
- {
- this.completed = completionStatus;
- }
-
- // Indicates if the exception will most probably be repetitive (definitive)
- // or if it is just a temporary failure and new attempts should be tried
- //
- public boolean isDefinitive ()
- {
- return this.isDefinitive;
- }
-
- public void setIsDefinitive (boolean definitive)
- {
- this.isDefinitive = definitive;
- }
-}
More information about the jboss-cvs-commits
mailing list