[jboss-cvs] JBossAS SVN: r72052 - in trunk: aspects/src/main/org/jboss/aspects/remoting and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Apr 11 16:07:56 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-04-11 16:07:56 -0400 (Fri, 11 Apr 2008)
New Revision: 72052
Removed:
trunk/aspects/src/main/org/jboss/aspects/remoting/ClusterChooserInterceptor.java
trunk/aspects/src/main/org/jboss/aspects/remoting/ClusterConstants.java
trunk/aspects/src/main/org/jboss/aspects/remoting/FamilyWrapper.java
trunk/aspects/src/main/org/jboss/aspects/remoting/InvokeRemoteInterceptor.java
trunk/aspects/src/main/org/jboss/aspects/remoting/ReplicantsManagerInterceptor.java
Modified:
trunk/aspects/.classpath
trunk/aspects/build.xml
trunk/aspects/pom.xml
trunk/aspects/src/main/org/jboss/aspects/versioned/DistributedTxCache.java
trunk/component-matrix/pom.xml
Log:
[JBAS-5394] Break Remoting aspects out of AS
[JBAS-5395] Break clustering aspects out of AS
Modified: trunk/aspects/.classpath
===================================================================
--- trunk/aspects/.classpath 2008-04-11 20:07:43 UTC (rev 72051)
+++ trunk/aspects/.classpath 2008-04-11 20:07:56 UTC (rev 72052)
@@ -2,18 +2,40 @@
<classpath>
<classpathentry kind="src" path="src/main"/>
<classpathentry kind="lib" path="src/resources"/>
- <classpathentry exported="true" kind="src" path="/cluster"/>
<classpathentry excluding="org/jboss/test/aop/test/AOPTestSetup.java|org/jboss/test/asynch/" kind="src" path="src/test"/>
<classpathentry kind="src" path="src/test50"/>
+ <classpathentry exported="true" kind="src" path="/j2se"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="lib" path="/thirdparty/jboss/aop/lib/jboss-standalone-aspect-library-jdk50.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jboss/aop/lib/jboss-aop-jboss4-jdk50.jar"/>
- <classpathentry kind="lib" path="/thirdparty/beanshell/lib/bsh.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/aop/lib/jboss-aop-deployer-jdk50.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/aop/lib/jboss-aop-jdk50.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/aop/lib/jboss-aop-jboss4-jdk50.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/javassist/lib/javassist.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/common-core/lib/jboss-common-core.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/common-logging-spi/lib/jboss-logging-spi.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-cl/lib/jboss-classloader.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-cl/lib/jboss-classloading.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-deployers/lib/jboss-deployers-client-spi.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-deployers/lib/jboss-deployers-spi.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-deployers/lib/jboss-deployers-core-spi.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-deployers/lib/jboss-deployers-structure-spi.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-deployers/lib/jboss-deployers-vfs-spi.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-ha-client/lib/jboss-ha-client.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-ha-server-api/lib/jboss-ha-server-api.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-man/lib/jboss-managed.jar" sourcepath="/thirdparty/jboss/jboss-man/lib/jboss-managed.sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-mdr/lib/jboss-mdr.jar" sourcepath="/thirdparty/jboss/jboss-mdr/lib/jboss-mdr.sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/metadata/lib/jboss-metadata.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/remoting/lib/jboss-remoting.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/jboss-vfs/lib/jboss-vfs.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/beanshell/lib/bsh.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
<classpathentry kind="lib" path="/thirdparty/junit/lib/junit.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/test/lib/jboss-test.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jboss/aop/lib/pluggable-instrumentor.jar"/>
- <classpathentry kind="lib" path="/thirdparty/org/jboss/aspects/lib/jboss-remoting-aspects.jar"/>
- <classpathentry kind="lib" path="/thirdparty/org/jboss/aspects/lib/jboss-security-aspects.jar"/>
- <classpathentry kind="lib" path="/thirdparty/org/jboss/aspects/lib/jboss-transaction-aspects.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/jboss/aop/lib/pluggable-instrumentor.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/org/jboss/aspects/lib/jboss-remoting-aspects.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/org/jboss/aspects/lib/jboss-security-aspects.jar"/>
+ <classpathentry exported="true" kind="lib" path="/thirdparty/org/jboss/aspects/lib/jboss-transaction-aspects.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/aspects/build.xml
===================================================================
--- trunk/aspects/build.xml 2008-04-11 20:07:43 UTC (rev 72051)
+++ trunk/aspects/build.xml 2008-04-11 20:07:56 UTC (rev 72052)
@@ -232,6 +232,10 @@
<fileset dir="${build.etc}">
<include name="org/jboss/**/*.xml"/>
</fileset>
+ <!-- include the broken out remoting aspects in the lib -->
+ <zipfileset src="${org.jboss.aspects.lib}/jboss-remoting-aspects.jar">
+ <include name="org/jboss/aspects/remoting/**.class"/>
+ </zipfileset>
<!-- include the broken out security aspects in the lib -->
<zipfileset src="${org.jboss.aspects.lib}/jboss-security-aspects.jar">
<include name="org/jboss/aspects/security/**.class"/>
@@ -241,6 +245,15 @@
<include name="org/jboss/aspects/tx/**.class"/>
<include name="org/jboss/aspects/txlock/**.class"/>
</zipfileset>
+ <!-- Don't include the broken out clustering aspects in the lib
+ TODO: do these belong? They are already on the AS classpath
+ <zipfileset src="${jboss.jboss.ha.client.lib}/jboss-ha-client.jar">
+ <include name="org/jboss/aspects/remoting/**.class"/>
+ </zipfileset>
+ <zipfileset src="${jboss.jboss.ha.server.api.lib}/jboss-ha-server-api.jar">
+ <include name="org/jboss/aspects/remoting/**.class"/>
+ </zipfileset>
+ -->
</jar>
<!-- Build jboss-aop-jboss5.jar -->
@@ -276,14 +289,14 @@
<include name="org/jboss/aspects/asynch/RemotableFuture.class"/>
<include name="org/jboss/aspects/asynch/TimeoutException.class"/>
<include name="org/jboss/aspects/asynch/ThreadPoolExecutor*.class"/>
- <include name="org/jboss/aspects/remoting/ClusterConstants.class"/>
- <include name="org/jboss/aspects/remoting/ClusterChooserInterceptor.class"/>
- <include name="org/jboss/aspects/remoting/FamilyWrapper.class"/>
+ </fileset>
+ <!-- include the broken out remoting aspects in the client lib -->
+ <zipfileset src="${org.jboss.aspects.lib}/jboss-remoting-aspects.jar">
<include name="org/jboss/aspects/remoting/InvokeRemoteInterceptor.class"/>
<include name="org/jboss/aspects/remoting/IsLocalInterceptor.class"/>
<include name="org/jboss/aspects/remoting/MergeMetaDataInterceptor.class"/>
<include name="org/jboss/aspects/remoting/PojiProxy.class"/>
- </fileset>
+ </zipfileset>
<!-- include the broken out security aspects in the client lib -->
<zipfileset src="${org.jboss.aspects.lib}/jboss-security-aspects.jar">
<include name="org/jboss/aspects/security/SecurityClientInterceptor.class"/>
@@ -292,7 +305,11 @@
<!-- include the broken out transaction aspects in the client lib -->
<zipfileset src="${org.jboss.aspects.lib}/jboss-transaction-aspects.jar">
<include name="org/jboss/aspects/tx/ClientTxPropagationInterceptor.class"/>
- </zipfileset>
+ </zipfileset>
+ <!-- include the broken out clustering aspects in the lib -->
+ <zipfileset src="${jboss.jboss.ha.client.lib}/jboss-ha-client.jar">
+ <include name="org/jboss/aspects/remoting/**.class"/>
+ </zipfileset>
</jar>
<copy file="${project.root}/aspects/src/etc/base-aop.xml" tofile="${build.meta.inf}/base-aspects.xml"/>
Modified: trunk/aspects/pom.xml
===================================================================
--- trunk/aspects/pom.xml 2008-04-11 20:07:43 UTC (rev 72051)
+++ trunk/aspects/pom.xml 2008-04-11 20:07:56 UTC (rev 72052)
@@ -48,6 +48,10 @@
<!-- Compile (global dependencies) -->
<dependency>
<groupId>org.jboss.aspects</groupId>
+ <artifactId>jboss-remoting-aspects</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.aspects</groupId>
<artifactId>jboss-security-aspects</artifactId>
</dependency>
<dependency>
@@ -67,10 +71,6 @@
<artifactId>jboss-ha-server-api</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-cluster</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
</dependency>
Deleted: trunk/aspects/src/main/org/jboss/aspects/remoting/ClusterChooserInterceptor.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/remoting/ClusterChooserInterceptor.java 2008-04-11 20:07:43 UTC (rev 72051)
+++ trunk/aspects/src/main/org/jboss/aspects/remoting/ClusterChooserInterceptor.java 2008-04-11 20:07:56 UTC (rev 72052)
@@ -1,178 +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.aspects.remoting;
-
-import org.jboss.aop.DispatcherConnectException;
-import org.jboss.aop.util.PayloadKey;
-import org.jboss.ha.client.loadbalance.LoadBalancePolicy;
-import org.jboss.ha.framework.interfaces.GenericClusteringException;
-import org.jboss.remoting.CannotConnectException;
-import org.jboss.remoting.InvokerLocator;
-
-import java.util.ArrayList;
-
-/**
- * Pick an invocation target
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
-public class ClusterChooserInterceptor implements org.jboss.aop.advice.Interceptor, ClusterConstants, java.io.Serializable
-{
- private static final long serialVersionUID = -8666382019058421135L;
-
- public static final ClusterChooserInterceptor singleton = new ClusterChooserInterceptor();
-
- public String getName()
- {
- return "ClusterChooserInterceptor";
- }
-
- public Object invoke(org.jboss.aop.joinpoint.Invocation invocation)
- throws Throwable
- {
- LoadBalancePolicy lb = (LoadBalancePolicy) invocation.getMetaData(CLUSTERED_REMOTING, LOADBALANCE_POLICY);
- FamilyWrapper family = (FamilyWrapper) invocation.getMetaData(CLUSTERED_REMOTING, CLUSTER_FAMILY_WRAPPER);
-
- // we give the opportunity, to any server interceptor, to know if this a
- // first invocation to a node or if it is a failovered call
- //
- int failoverCounter = 0;
- String familyName = family.get().getFamilyName();
- invocation.getMetaData().addMetaData(CLUSTERED_REMOTING, CLUSTER_FAMILY, familyName, PayloadKey.AS_IS);
- InvokerLocator target = (InvokerLocator) lb.chooseTarget(family.get());
- Throwable lastException = null;
- while (target != null)
- {
- invocation.getMetaData().addMetaData(CLUSTERED_REMOTING, FAILOVER_COUNTER, new Integer(failoverCounter), PayloadKey.AS_IS);
- invocation.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.INVOKER_LOCATOR, target, PayloadKey.AS_IS);
- invocation.getMetaData().addMetaData(CLUSTERED_REMOTING, CLUSTER_VIEW_ID, new Long(family.get().getCurrentViewId()), PayloadKey.AS_IS);
-
- boolean definitivlyRemoveNodeOnFailure = true;
- lastException = null;
- try
- {
-
-
-
- Object rsp = invocation.invokeNext();
- ArrayList newReplicants = (ArrayList) invocation.getResponseAttachment("replicants");
- if (newReplicants != null)
- {
- long newViewId = ((Long) invocation.getResponseAttachment("viewId")).longValue();
- family.get().updateClusterInfo(newReplicants, newViewId);
- }
- return rsp;
- }
- catch(DispatcherConnectException dce)
- {
- //In case of graceful shutdown, the target object will no longer exist in the Dispatcher,
- //fail over to another server if we can...
- //For now remove the node "definitely"
- lastException = dce;
- }
- catch (CannotConnectException ex)
- {
- lastException = ex;
- }
- catch (GenericClusteringException gce)
- {
- lastException = gce;
- // this is a generic clustering exception that contain the
- // completion status: usefull to determine if we are authorized
- // to re-issue a query to another node
- //
- if (gce.getCompletionStatus() == GenericClusteringException.COMPLETED_NO)
- {
- // we don't want to remove the node from the list of failed
- // node UNLESS there is a risk to indefinitively loop
- //
- if (family.get().getTargets().size() >= failoverCounter)
- {
- if (!gce.isDefinitive())
- definitivlyRemoveNodeOnFailure = false;
- }
- }
- else
- {
- throw new RuntimeException("Clustering exception thrown", gce);
- }
- }
- catch (Throwable t)
- {
- // Just in case this get wrapped in a Throwable. This can happen when
- // the exception is generated inside the container and it is wrapped in
- // a ForwardId exception.
- if(t.getCause() instanceof GenericClusteringException)
- {
- GenericClusteringException gce = (GenericClusteringException)t.getCause();
- lastException = gce;
- // this is a generic clustering exception that contain the
- // completion status: usefull to determine if we are authorized
- // to re-issue a query to another node
- //
- if (gce.getCompletionStatus() == GenericClusteringException.COMPLETED_NO)
- {
- // we don't want to remove the node from the list of failed
- // node UNLESS there is a risk to indefinitively loop
- //
- if (family.get().getTargets().size() >= failoverCounter)
- {
- if (!gce.isDefinitive())
- definitivlyRemoveNodeOnFailure = false;
- }
- }
- else
- {
- throw new RuntimeException("Clustering exception thrown", gce);
- }
- } else
- {
- throw t;
- }
- }
-
- // If we reach here, this means that we must fail-over
- family.get().removeDeadTarget(target);
- if (!definitivlyRemoveNodeOnFailure)
- {
- family.get().resetView();
- }
-
- target = (InvokerLocator) lb.chooseTarget(family.get());
- if (target == null)
- {
- if (lastException != null)
- {
- throw new RuntimeException("cluster invocation failed, last exception was: ", lastException);
- }
- else
- {
- throw new RuntimeException("cluster invocation failed");
- }
- }
- failoverCounter++;
- }
- // if we get here this means list was exhausted
- throw new RuntimeException("Unreachable?: Service unavailable.");
- }
-}
Deleted: trunk/aspects/src/main/org/jboss/aspects/remoting/ClusterConstants.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/remoting/ClusterConstants.java 2008-04-11 20:07:43 UTC (rev 72051)
+++ trunk/aspects/src/main/org/jboss/aspects/remoting/ClusterConstants.java 2008-04-11 20:07:56 UTC (rev 72052)
@@ -1,39 +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.aspects.remoting;
-
-/**
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
-
-public interface ClusterConstants
-{
- public static final String CLUSTERED_REMOTING = "CLUSTERED_REMOTING";
- public static final String LOADBALANCE_POLICY = "LOADBALANCE_POLICY";
- public static final String FAILOVER_COUNTER = "FAILOVER_COUNTER";
- public static final String CLUSTER_FAMILY_WRAPPER = "CLUSTER_FAMILY_WRAPPER";
- public static final String CLUSTER_FAMILY = "CLUSTER_FAMILY";
- public static final String CLUSTER_FAMILIES = "CLUSTER_FAMILIES";
- public static final String HA_TARGET = "HA_TARGET";
- public static final String CLUSTER_VIEW_ID = "CLUSTER_VIEW_ID";
-}
Deleted: trunk/aspects/src/main/org/jboss/aspects/remoting/FamilyWrapper.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/remoting/FamilyWrapper.java 2008-04-11 20:07:43 UTC (rev 72051)
+++ trunk/aspects/src/main/org/jboss/aspects/remoting/FamilyWrapper.java 2008-04-11 20:07:56 UTC (rev 72052)
@@ -1,70 +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.aspects.remoting;
-
-import org.jboss.ha.framework.interfaces.ClusteringTargetsRepository;
-import org.jboss.ha.framework.interfaces.FamilyClusterInfo;
-
-import java.io.IOException;
-import java.util.List;
-/**
- * Handles serialization of a {@link FamilyClusterInfo}.
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
-public class FamilyWrapper implements java.io.Externalizable
-{
- private static final long serialVersionUID = 3880844152274576311L;
-
- private FamilyClusterInfo info;
-
- public FamilyWrapper() {}
-
- public FamilyWrapper(String proxyFamilyName, List targets)
- {
- info = ClusteringTargetsRepository.initTarget(proxyFamilyName, targets);
- }
-
- public FamilyClusterInfo get() { return info; }
-
- public void writeExternal(final java.io.ObjectOutput out)
- throws IOException
- {
- out.writeObject(info.getFamilyName());
- out.writeObject(info.getTargets());
- }
-
- /**
- * Un-externalize this instance.
- */
- public void readExternal(final java.io.ObjectInput in)
- throws IOException, ClassNotFoundException
- {
- String proxyFamilyName = (String)in.readObject();
- List targets = (List)in.readObject();
- // keep a reference on our family object
- //
- this.info = ClusteringTargetsRepository.initTarget(proxyFamilyName, targets);
- }
-
-}
Deleted: trunk/aspects/src/main/org/jboss/aspects/remoting/InvokeRemoteInterceptor.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/remoting/InvokeRemoteInterceptor.java 2008-04-11 20:07:43 UTC (rev 72051)
+++ trunk/aspects/src/main/org/jboss/aspects/remoting/InvokeRemoteInterceptor.java 2008-04-11 20:07:56 UTC (rev 72052)
@@ -1,96 +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.aspects.remoting;
-
-import java.io.ObjectStreamException;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-/**
- * Checks to see if this object is local in VM
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
-public class InvokeRemoteInterceptor implements org.jboss.aop.advice.Interceptor, java.io.Serializable
-{
- private static final Logger log = Logger.getLogger(InvokeRemoteInterceptor.class);
-
- private static final long serialVersionUID = -145166951731929406L;
-
- public static final InvokeRemoteInterceptor singleton = new InvokeRemoteInterceptor();
- public static final String REMOTING = "REMOTING";
- public static final String INVOKER_LOCATOR = "INVOKER_LOCATOR";
- public static final String SUBSYSTEM = "SUBSYSTEM";
-
- public String getName() { return "InvokeRemoteInterceptor"; }
-
- public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable
- {
- InvokerLocator locator = (InvokerLocator)invocation.getMetaData(REMOTING, INVOKER_LOCATOR);
- if (locator == null)
- {
- throw new RuntimeException("No InvokerLocator supplied. Can't invoke remotely!");
- }
- String subsystem = (String)invocation.getMetaData(REMOTING, SUBSYSTEM);
- if (subsystem == null) subsystem = "AOP";
- Client client = new Client(locator, subsystem);
-
- try
- {
- client.connect();
- org.jboss.aop.joinpoint.InvocationResponse response = (org.jboss.aop.joinpoint.InvocationResponse)client.invoke(invocation, null);
- invocation.setResponseContextInfo(response.getContextInfo());
- return response.getResponse();
- }
- catch (Exception e)
- {
- StackTraceElement[] serverStackTrace;
- if (e.getCause() != null)
- serverStackTrace = e.getCause().getStackTrace();
- else
- serverStackTrace = e.getStackTrace();
-
- Exception clientException = new Exception();
- StackTraceElement[] clientStackTrace = clientException.getStackTrace();
- StackTraceElement[] completeStackTrace = new StackTraceElement[serverStackTrace.length + clientStackTrace.length];
- System.arraycopy(serverStackTrace, 0, completeStackTrace, 0, serverStackTrace.length);
- System.arraycopy(clientStackTrace, 0, completeStackTrace, serverStackTrace.length, clientStackTrace.length);
-
- if (e.getCause() != null)
- e.getCause().setStackTrace(completeStackTrace);
- else
- e.setStackTrace(completeStackTrace);
-
- throw e;
- }
- finally
- {
- client.disconnect();
- }
- }
-
- Object readResolve() throws ObjectStreamException {
- return singleton;
- }
-}
Deleted: trunk/aspects/src/main/org/jboss/aspects/remoting/ReplicantsManagerInterceptor.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/remoting/ReplicantsManagerInterceptor.java 2008-04-11 20:07:43 UTC (rev 72051)
+++ trunk/aspects/src/main/org/jboss/aspects/remoting/ReplicantsManagerInterceptor.java 2008-04-11 20:07:56 UTC (rev 72052)
@@ -1,73 +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.aspects.remoting;
-
-import org.jboss.ha.framework.server.HATarget;
-
-import java.util.ArrayList;
-import java.util.Map;
-
-/**
- * Checks to see if this object is local in VM
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
-public class ReplicantsManagerInterceptor implements org.jboss.aop.advice.Interceptor, ClusterConstants
-{
- private final Map families;
-
- public ReplicantsManagerInterceptor(Map families)
- {
- this.families = families;
- }
-
- public String getName()
- {
- return this.getClass().getName();
- }
-
- public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable
- {
- Object response = invocation.invokeNext();
- String clientFamily = (String) invocation.getMetaData(CLUSTERED_REMOTING, CLUSTER_FAMILY);
-
- HATarget target = (HATarget) families.get(clientFamily);
- if (target == null)
- {
- return response;
- }
-
- Long clientViewId = (Long) invocation.getMetaData(CLUSTERED_REMOTING, CLUSTER_VIEW_ID);
- if (clientViewId == null)
- {
- // Maybe we're being invoked upon by a non-clustered proxy
- return response;
- }
- if (clientViewId.longValue() != target.getCurrentViewId())
- {
- invocation.addResponseAttachment("replicants", new ArrayList(target.getReplicants()));
- invocation.addResponseAttachment("viewId", new Long(target.getCurrentViewId()));
- }
- return response;
- }
-}
Modified: trunk/aspects/src/main/org/jboss/aspects/versioned/DistributedTxCache.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/versioned/DistributedTxCache.java 2008-04-11 20:07:43 UTC (rev 72051)
+++ trunk/aspects/src/main/org/jboss/aspects/versioned/DistributedTxCache.java 2008-04-11 20:07:56 UTC (rev 72052)
@@ -21,24 +21,15 @@
*/
package org.jboss.aspects.versioned;
import java.io.Serializable;
-import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.Set;
-import javax.management.MBeanServer;
-import javax.management.ObjectInstance;
-import javax.management.Query;
-import javax.management.QueryExp;
-
import org.jboss.aop.InstanceAdvised;
import org.jboss.ha.framework.interfaces.HAPartition;
import org.jboss.ha.framework.interfaces.HAPartition.HAPartitionStateTransfer;
-import org.jboss.ha.framework.server.ClusterPartitionMBean;
+import org.jboss.ha.framework.server.HAPartitionLocator;
import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanProxyExt;
-import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.util.id.GUID;
/**
* This is a LRU cache. The TxCache itself is not transactional
@@ -95,42 +86,7 @@
*/
protected HAPartition findHAPartitionWithName (String name) throws Exception
{
- HAPartition result = null;
- MBeanServer server = MBeanServerLocator.locate();
- // Class name match does not work with the AOP proxy :(
-// QueryExp classEQ = Query.eq(Query.classattr(),
-// Query.value(ClusterPartition.class.getName()));
- QueryExp exp = Query.and(
- Query.match(
- Query.attr("Name"),
- Query.value("ClusterPartition")
- ),
- Query.match(
- Query.attr("PartitionName"),
- Query.value(name)
- )
- );
-
- Set mbeans = server.queryMBeans (null, exp);
- if (mbeans != null && mbeans.size () > 0)
- {
- for (Iterator iter = mbeans.iterator(); iter.hasNext();)
- {
- ObjectInstance inst = (ObjectInstance) iter.next();
- try
- {
- ClusterPartitionMBean cp = (ClusterPartitionMBean) MBeanProxyExt.create (
- ClusterPartitionMBean.class,
- inst.getObjectName (),
- server);
- result = cp.getHAPartition();
- break;
- }
- catch (Exception e) {}
- }
- }
-
- return result;
+ return HAPartitionLocator.getHAPartitionLocator().getHAPartition(name, null);
}
public void create() throws Exception
Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml 2008-04-11 20:07:43 UTC (rev 72051)
+++ trunk/component-matrix/pom.xml 2008-04-11 20:07:56 UTC (rev 72052)
@@ -396,6 +396,11 @@
</dependency>
<dependency>
<groupId>org.jboss.aspects</groupId>
+ <artifactId>jboss-remoting-aspects</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.aspects</groupId>
<artifactId>jboss-security-aspects</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
@@ -931,12 +936,12 @@
<dependency>
<groupId>org.jboss.cluster</groupId>
<artifactId>jboss-ha-client</artifactId>
- <version>1.0.0.GA</version>
+ <version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jboss.cluster</groupId>
<artifactId>jboss-ha-server-api</artifactId>
- <version>1.0.0.GA</version>
+ <version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jboss.deployers</groupId>
More information about the jboss-cvs-commits
mailing list