[jboss-cvs] JBossAS SVN: r104583 - in trunk: cluster/src/etc and 20 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri May 7 17:20:54 EDT 2010
Author: smarlow at redhat.com
Date: 2010-05-07 17:20:52 -0400 (Fri, 07 May 2010)
New Revision: 104583
Removed:
trunk/cluster/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxyHA.java
trunk/cluster/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvokerHA.java
trunk/server/src/assembly/jmx-adaptor-plugin.xml
trunk/server/src/assembly/jmx-invoker-adaptor-client.xml
trunk/server/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxy.java
trunk/server/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvoker.java
trunk/server/src/main/java/org/jboss/jmx/
trunk/server/src/resources/jmx-invoker-adaptor/
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaTransactionStickyUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaMockUtils.java
trunk/testsuite/src/resources/test-configs/jrmp-invoker/
Modified:
trunk/build/build.xml
trunk/cluster/src/etc/ha-legacy-jboss-beans.xml
trunk/cluster/src/main/java/org/jboss/ha/jndi/DetachedHANamingService.java
trunk/cluster/src/main/java/org/jboss/proxy/ejb/ProxyFactoryHA.java
trunk/cluster/src/main/java/org/jboss/proxy/generic/ProxyFactoryHA.java
trunk/connector/src/main/java/org/jboss/resource/adapter/jdbc/remote/WrapperDataSourceService.java
trunk/server/pom.xml
trunk/server/src/etc/deploy/legacy-invokers-service.xml
trunk/server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactory.java
trunk/server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactoryMBean.java
trunk/system/src/resources/tests/conf/jboss-service-VDFDeploymentScanner.xml
trunk/testsuite/build.xml
trunk/testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml
trunk/testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml
trunk/testsuite/src/main/org/jboss/test/binding/BindingServiceUnitTestCase.java
Log:
JBAS-7563 Remove JRMPInvoker and JRMPInvokerHA. Removed related RMIAdapter and other classes/resources as well
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/build/build.xml 2010-05-07 21:20:52 UTC (rev 104583)
@@ -891,18 +891,12 @@
<copy file="${server.module.output}/jboss-as-server-jboss.jar"
tofile="${install.common.lib}/jboss.jar" filtering="no"/>
- <copy file="${server.module.output}/jboss-as-server-jmx-adaptor-plugin.jar"
- tofile="${install.common.lib}/jmx-adaptor-plugin.jar" filtering="no"/>
-
<!-- Copy the generated client libraries -->
<mkdir dir="${install.client}"/>
<copy file="${server.module.output}/jboss-as-server-client.jar"
tofile="${install.client}/jboss-client.jar" filtering="no"/>
- <copy file="${server.module.output}/jboss-as-server-jmx-invoker-adaptor-client.jar"
- tofile="${install.client}/jmx-invoker-adaptor-client.jar" filtering="no"/>
-
<!-- Copy the generated scripts & runnable jars -->
<mkdir dir="${install.bin}"/>
<copy todir="${install.bin}" filtering="no">
Modified: trunk/cluster/src/etc/ha-legacy-jboss-beans.xml
===================================================================
--- trunk/cluster/src/etc/ha-legacy-jboss-beans.xml 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/cluster/src/etc/ha-legacy-jboss-beans.xml 2010-05-07 21:20:52 UTC (rev 104583)
@@ -9,35 +9,6 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<!-- ==================================================================== -->
- <!-- HA Detached Invoker using JRMP for transport -->
- <!-- ==================================================================== -->
-
- <bean name="JRMPInvokerHA"
- class="org.jboss.invocation.jrmp.server.JRMPInvokerHA">
-
- <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=invoker,type=jrmpha", exposedInterface=org.jboss.invocation.jrmp.server.JRMPInvokerMBean.class, registerDirectly=true)</annotation>
-
- <property name="serverAddress">
- <!-- Get the interface from the ServiceBindingManager -->
- <value-factory bean="ServiceBindingManager" method="getStringBinding"
- parameter="jboss:service=invoker,type=jrmpha"/>
- </property>
- <property name="RMIObjectPort">
- <!-- Get the port from the ServiceBindingManager -->
- <value-factory bean="ServiceBindingManager" method="getIntBinding"
- parameter="jboss:service=invoker,type=jrmpha"/>
- </property>
-
- <!--
- <property name="RMIClientSocketFactory">custom</property>
- <property name="RMIServerSocketFactory">custom</property>
- -->
-
- <depends>jboss:service=TransactionManager</depends>
- <depends>HAPartition</depends>
- </bean>
-
- <!-- ==================================================================== -->
<!-- HA Detached Invoker using JBoss Remoting for transport -->
<!-- ==================================================================== -->
Modified: trunk/cluster/src/main/java/org/jboss/ha/jndi/DetachedHANamingService.java
===================================================================
--- trunk/cluster/src/main/java/org/jboss/ha/jndi/DetachedHANamingService.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/cluster/src/main/java/org/jboss/ha/jndi/DetachedHANamingService.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -58,7 +58,7 @@
/**
* Management Bean for the protocol independent HA-JNDI service. This allows the
* naming service transport layer to be provided by a detached invoker service
- * like JRMPInvokerHA + ProxyFactoryHA.
+ * like ProxyFactoryHA.
* @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
* @author <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>
* @author Scott.Stark at jboss.org
Deleted: trunk/cluster/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxyHA.java
===================================================================
--- trunk/cluster/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxyHA.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/cluster/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxyHA.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -1,422 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.invocation.jrmp.interfaces;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.rmi.MarshalledObject;
-import java.rmi.RemoteException;
-import java.rmi.ServerException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import javax.transaction.SystemException;
-import javax.transaction.TransactionRolledbackException;
-
-import org.jboss.ha.framework.interfaces.ClusteringTargetsRepository;
-import org.jboss.ha.framework.interfaces.FamilyClusterInfo;
-import org.jboss.ha.framework.interfaces.GenericClusteringException;
-import org.jboss.ha.framework.interfaces.HARMIResponse;
-import org.jboss.ha.framework.interfaces.LoadBalancePolicy;
-import org.jboss.invocation.Invocation;
-import org.jboss.invocation.Invoker;
-import org.jboss.invocation.InvokerInterceptor;
-import org.jboss.invocation.InvokerProxyHA;
-import org.jboss.invocation.MarshalledInvocation;
-import org.jboss.invocation.PayloadKey;
-import org.jboss.invocation.ServiceUnavailableException;
-import org.jboss.logging.Logger;
-
-/**
- * An extension of the JRMPInvokerProxy that supports failover and load
- * balancing among a
- *
- * @author <a href="mailto:marc.fleury at jboss.org">Marc Fleury</a>
- * @author Scott.Stark at jboss.org
- * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
- * @version $Revision$
- */
-public class JRMPInvokerProxyHA
- extends JRMPInvokerProxy
- implements InvokerProxyHA, Externalizable
-{
- // Public --------------------------------------------------------
- /** The serialVersionUID
- * @since 1.7.2.8
- */
- private static final long serialVersionUID = -967671822225981666L;
- private static final Logger log = Logger.getLogger(JRMPInvokerProxyHA.class);
- public static final HashSet<Object> colocation = new HashSet<Object>();
- public static final Map<Object, Object> txFailoverAuthorizations = Collections.synchronizedMap(new WeakHashMap<Object, Object>());
-
- protected LoadBalancePolicy loadBalancePolicy;
- protected String proxyFamilyName = null;
-
- FamilyClusterInfo familyClusterInfo = null;
- //protected transient long currentViewId = 0;
- /** Trace level logging flag only set when the proxy is created or read from JNDI */
- protected transient boolean trace = false;
-
- public JRMPInvokerProxyHA() {}
-
- public JRMPInvokerProxyHA(List<?> targets, LoadBalancePolicy policy,
- String proxyFamilyName, long viewId)
- {
- this.familyClusterInfo = ClusteringTargetsRepository.initTarget (proxyFamilyName, targets, viewId);
- this.loadBalancePolicy = policy;
- this.proxyFamilyName = proxyFamilyName;
- this.trace = log.isTraceEnabled();
- if( trace )
- log.trace("Init, cluterInfo: "+familyClusterInfo+", policy="+loadBalancePolicy);
- }
-
- public String getProxyFamilyName()
- {
- return proxyFamilyName;
- }
-
- public void updateClusterInfo (List<?> targets, long viewId)
- {
- if (familyClusterInfo != null)
- this.familyClusterInfo.updateClusterInfo (targets, viewId);
- }
-
- public FamilyClusterInfo getFamilyClusterInfo()
- {
- return familyClusterInfo;
- }
-
- public void forbidTransactionFailover(Object tpc)
- {
- txFailoverAuthorizations.put(tpc, null);
- }
-
- public Object getRemoteTarget()
- {
- return getRemoteTarget(null);
- }
- public Object getRemoteTarget(Invocation invocationBasedRouting)
- {
- return loadBalancePolicy.chooseTarget(this.familyClusterInfo, invocationBasedRouting);
- }
-
- public void remoteTargetHasFailed(Object target)
- {
- removeDeadTarget(target);
- }
-
- protected void removeDeadTarget(Object target)
- {
- //System.out.println("Removing a dead target: Size before : " + Integer.toString(this.familyClusterInfo.getTargets ().size()));
- if (this.familyClusterInfo != null)
- this.familyClusterInfo.removeDeadTarget (target);
- }
-
- protected int totalNumberOfTargets ()
- {
- if (this.familyClusterInfo != null)
- return this.familyClusterInfo.getTargets ().size ();
- else
- return 0;
- }
-
- protected void resetView ()
- {
- this.familyClusterInfo.resetView ();
- }
-
- /**
- * Returns wether we are local to the originating container or not.
- */
- public boolean isLocal(Invocation invocation)
- {
- return colocation.contains(invocation.getObjectName());
- }
-
- public boolean txContextAllowsFailover (Invocation invocation)
- {
- Object tpc = getTransactionPropagationContext();
- if (tpc != null)
- {
- if (trace)
- {
- log.trace("Checking tx failover authorisation map with tpc " + tpc);
- }
-
- /* If the map contains the tpc, then we can't allow a failover */
- return ! txFailoverAuthorizations.containsKey(tpc);
- }
-
- return true;
- }
-
- public void invocationHasReachedAServer (Invocation invocation)
- {
- Object tpc = getTransactionPropagationContext();
- if (tpc != null)
- {
- forbidTransactionFailover(tpc);
- }
- }
-
- /**
- * The invocation on the delegate, calls the right invoker. Remote if we are remote, local if we
- * are local.
- */
- public Object invoke(Invocation invocation)
- throws Exception
- {
- // 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;
- invocation.setValue ("FAILOVER_COUNTER", new Integer(failoverCounter), PayloadKey.AS_IS);
-
- // optimize if calling another bean in same EJB-application
- if (isLocal(invocation))
- {
- return InvokerInterceptor.getLocal().invoke(invocation);
- }
- else
- {
- // We are going to go through a Remote invocation, switch to a Marshalled Invocation
- MarshalledInvocation mi = new MarshalledInvocation(invocation);
-
- // Set the transaction propagation context
- mi.setTransactionPropagationContext(getTransactionPropagationContext());
- mi.setValue("CLUSTER_VIEW_ID", new Long(this.familyClusterInfo.getCurrentViewId ()));
- Invoker target = (Invoker)getRemoteTarget(invocation);
-
- boolean failoverAuthorized = true;
- Exception lastException = null;
- while (target != null && failoverAuthorized)
- {
- boolean definitivlyRemoveNodeOnFailure = true;
- try
- {
- if( trace )
- log.trace("Invoking on target="+target);
- Object rtnObj = target.invoke(mi);
- HARMIResponse rsp = null;
- if (rtnObj instanceof MarshalledObject<?>)
- {
- @SuppressWarnings("unchecked")
- HARMIResponse unsafe = ((MarshalledObject<HARMIResponse>)rtnObj).get();
- rsp = unsafe;
- }
- else
- {
- rsp = (HARMIResponse)rtnObj;
- }
- if (rsp.newReplicants != null)
- {
- if( trace )
- {
- log.trace("newReplicants: "+rsp.newReplicants);
- }
- updateClusterInfo (rsp.newReplicants, rsp.currentViewId);
- }
- //else System.out.println("Static set of replicants: " + this.familyClusterInfo.getCurrentViewId () + " (me = " + this + ")");
-
- invocationHasReachedAServer (invocation);
-
- return rsp.response;
- }
- catch (java.net.ConnectException e)
- {
- lastException = e;
- }
- catch (java.net.UnknownHostException e)
- {
- lastException = e;
- }
- catch (java.rmi.ConnectException e)
- {
- lastException = e;
- if(e.getCause() != null && e.getCause() instanceof java.io.EOFException)
- {
- // don't failover as we may of reached the target
- invocationHasReachedAServer (invocation);
- throw e;
- }
- }
- catch (java.rmi.ConnectIOException e)
- {
- lastException = e;
- }
- catch (java.rmi.NoSuchObjectException e)
- {
- lastException = e;
- }
- catch (java.rmi.UnknownHostException e)
- {
- lastException = e;
- }
- catch (GenericClusteringException e)
- {
- lastException = e;
- // 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 (e.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 (totalNumberOfTargets() >= failoverCounter)
- {
- if (!e.isDefinitive ())
- definitivlyRemoveNodeOnFailure = false;
- }
- }
- else
- {
- invocationHasReachedAServer (invocation);
- throw new ServerException("Clustering error", e);
- }
- }
- catch (ServerException e)
- {
- //Why do NoSuchObjectExceptions get ignored for a retry here
- //unlike in the non-HA case?
- invocationHasReachedAServer (invocation);
- if (e.detail instanceof TransactionRolledbackException)
- {
- throw (TransactionRolledbackException) e.detail;
- }
- if (e.detail instanceof RemoteException)
- {
- throw (RemoteException) e.detail;
- }
- throw e;
- }
- catch (Exception e)
- {
- lastException = e;
- invocationHasReachedAServer (invocation);
- throw e;
- }
-
- if( trace )
- log.trace("Invoke failed, target="+target, lastException);
-
- // If we reach here, this means that we must fail-over
- remoteTargetHasFailed(target);
- if (!definitivlyRemoveNodeOnFailure)
- {
- resetView ();
- }
-
- failoverAuthorized = txContextAllowsFailover (invocation);
- target = (Invoker)getRemoteTarget(invocation);
-
- failoverCounter++;
- mi.setValue ("FAILOVER_COUNTER", new Integer(failoverCounter), PayloadKey.AS_IS);
- }
- // if we get here this means list was exhausted
- String msg = "Service unavailable.";
- if (failoverAuthorized == false)
- {
- msg = "Service unavailable (failover not possible inside a user transaction).";
- }
- throw new ServiceUnavailableException(msg, lastException);
- }
- }
-
- /**
- * Externalize this instance.
- *
- * If this instance lives in a different VM than its container
- * invoker, the remote interface of the container invoker is
- * not externalized.
- */
- public void writeExternal(final ObjectOutput out)
- throws IOException
- {
- // JBAS-2071 - sync on FCI to ensure targets and vid are consistent
- ArrayList<Object> targets = null;
- long vid = 0;
- synchronized (this.familyClusterInfo)
- {
- // JBAS-6345 -- write an ArrayList for compatibility with AS 3.x/4.x clients
- targets = new ArrayList<Object>(this.familyClusterInfo.getTargets ());
- vid = this.familyClusterInfo.getCurrentViewId ();
- }
- out.writeObject(targets);
- out.writeObject(this.loadBalancePolicy);
- out.writeObject (this.proxyFamilyName);
- out.writeLong (vid);
- }
-
- /**
- * Un-externalize this instance.
- *
- * We check timestamps of the interfaces to see if the instance is in the original VM of creation
- */
- public void readExternal(final ObjectInput in)
- throws IOException, ClassNotFoundException
- {
- List<?> targets = (List<?>) in.readObject();
- this.loadBalancePolicy = (LoadBalancePolicy)in.readObject();
- this.proxyFamilyName = (String)in.readObject();
- long vid = in.readLong ();
-
- // keep a reference on our family object
- //
- this.familyClusterInfo = ClusteringTargetsRepository.initTarget (this.proxyFamilyName, targets, vid);
- this.trace = log.isTraceEnabled();
- if( trace )
- log.trace("Init, clusterInfo: "+familyClusterInfo+", policy="+loadBalancePolicy);
- }
-
-
- /**
- * Overriden method to rethrow any potential SystemException arising from it.
- * Looking at the parent implementation, none of the methods called actually
- * throw SystemException.
- */
- public Object getTransactionPropagationContext()
- {
- Object tpc;
- try
- {
- tpc = super.getTransactionPropagationContext();
- }
- catch (SystemException e)
- {
- throw new RuntimeException("Unable to retrieve transaction propagation context", e);
- }
-
- return tpc;
- }
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted: trunk/cluster/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvokerHA.java
===================================================================
--- trunk/cluster/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvokerHA.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/cluster/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvokerHA.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -1,249 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.invocation.jrmp.server;
-
-import java.rmi.MarshalledObject;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-
-import org.jboss.ha.framework.interfaces.GenericClusteringException;
-import org.jboss.ha.framework.interfaces.HARMIResponse;
-import org.jboss.ha.framework.interfaces.LoadBalancePolicy;
-import org.jboss.ha.framework.server.HATarget;
-import org.jboss.invocation.Invocation;
-import org.jboss.invocation.Invoker;
-import org.jboss.invocation.InvokerHA;
-import org.jboss.invocation.MarshalledInvocation;
-import org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxyHA;
-import org.jboss.system.Registry;
-
-
-/**
- * The JRMPInvokerHA is an HA-RMI implementation that can generate Invocations from RMI/JRMP
- * into the JMX base
- *
- * @author <a href="mailto:bill at burkecentral.com>Bill Burke</a>
- * @author <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
- * @author Scott.Stark at jboss.org
- * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
- * @version $Revision$
- */
-public class JRMPInvokerHA
- extends JRMPInvoker
- implements InvokerHA
-{
- /** @since v4.2.3 */
- private static final long serialVersionUID = -7657305823982668529L;
-
- protected HashMap beanMap = new HashMap();
-
- protected ObjectName serviceName;
-
- /**
- * Explicit no-args constructor.
- */
- public JRMPInvokerHA()
- {
- super();
- }
-
- // JRMPInvoker.createService() does the right thing
-
- protected void startService() throws Exception
- {
- loadCustomSocketFactories();
-
- if (log.isDebugEnabled())
- {
- log.debug("RMI Port='" + (rmiPort == ANONYMOUS_PORT ?
- "Anonymous" : Integer.toString(rmiPort)+"'"));
- log.debug("Client SocketFactory='" + (clientSocketFactory == null ?
- "Default" : clientSocketFactory.toString()+"'"));
- log.debug("Server SocketFactory='" + (serverSocketFactory == null ?
- "Default" : serverSocketFactory.toString()+"'"));
- log.debug("Server SocketAddr='" + (serverAddress == null ?
- "Default" : serverAddress+"'"));
- log.debug("SecurityDomain='" + (sslDomain == null ?
- "None" : sslDomain+"'"));
- }
-
- exportCI();
- Registry.bind(getServiceName(), this);
- }
-
- protected void stopService() throws Exception
- {
- unexportCI();
- }
-
- // JRMPInvoker.destroyService() does the right thing
-
- public void registerBean(ObjectName beanName, HATarget target) throws Exception
- {
- Integer hash = new Integer(beanName.hashCode());
- log.debug("registerBean: "+beanName);
-
- if (beanMap.containsKey(hash))
- {
- // FIXME [oleg] In theory this is possible!
- log.debug("Trying to register target " + target + " using an existing hashCode. Already registered: " + hash + "=" + beanMap.get(hash));
- throw new IllegalStateException("Trying to register target using an existing hashCode.");
- }
- beanMap.put(hash, target);
- }
-
- public Invoker createProxy(ObjectName beanName, LoadBalancePolicy policy,
- String proxyFamilyName) throws Exception
- {
- Integer hash = new Integer(beanName.hashCode());
- HATarget target = (HATarget) beanMap.get(hash);
- if (target == null)
- {
- throw new IllegalStateException("The bean hashCode not found");
- }
-
- String familyName = proxyFamilyName;
- if (familyName == null)
- familyName= target.getAssociatedPartition().getPartitionName() + "/" + beanName;
-
- return createProxy(target.getReplicants(), policy, familyName, target.getCurrentViewId ());
- }
-
- public void unregisterBean(ObjectName beanName) throws Exception
- {
- Integer hash = new Integer(beanName.hashCode());
- beanMap.remove(hash);
- }
-
- /**
- * Invoke a Remote interface method.
- */
- public Object invoke(Invocation invocation)
- throws Exception
- {
- ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
-
- try
- {
- // Deserialize the transaction if it is there
- invocation.setTransaction(importTPC(((MarshalledInvocation) invocation).getTransactionPropagationContext()));
-
- // Extract the ObjectName, the rest is still marshalled
- ObjectName mbean = (ObjectName) Registry.lookup(invocation.getObjectName());
- long clientViewId = ((Long)invocation.getValue("CLUSTER_VIEW_ID")).longValue();
-
- HATarget target = (HATarget)beanMap.get(invocation.getObjectName());
- if (target == null)
- {
- // We could throw IllegalStateException but we have a race condition that could occur:
- // when we undeploy a bean, the cluster takes some time to converge
- // and to recalculate a new viewId and list of replicant for each HATarget.
- // Consequently, a client could own an up-to-date list of the replicants
- // (before the cluster has converged) and try to perform an invocation
- // on this node where the HATarget no more exist, thus receiving a
- // wrong exception and no failover is performed with an IllegalStateException
- //
- throw new GenericClusteringException(GenericClusteringException.COMPLETED_NO,
- "target is not/no more registered on this node");
- }
-
- if (!target.invocationsAllowed ())
- throw new GenericClusteringException(GenericClusteringException.COMPLETED_NO,
- "invocations are currently not allowed on this target");
-
- // The cl on the thread should be set in another interceptor
- Object rtn = support.getServer().invoke(mbean,
- "invoke",
- new Object[] { invocation },
- Invocation.INVOKE_SIGNATURE);
-
- HARMIResponse rsp = new HARMIResponse();
-
- if (clientViewId != target.getCurrentViewId())
- {
- rsp.newReplicants = new ArrayList(target.getReplicants());
- rsp.currentViewId = target.getCurrentViewId();
- }
- rsp.response = rtn;
-
- return new MarshalledObject(rsp);
- }
- catch (InstanceNotFoundException e)
- {
- throw new GenericClusteringException(GenericClusteringException.COMPLETED_NO, e);
- }
- catch (ReflectionException e)
- {
- throw new GenericClusteringException(GenericClusteringException.COMPLETED_NO, e);
- }
- catch (Exception e)
- {
- org.jboss.mx.util.JMXExceptionDecoder.rethrow(e);
-
- // the compiler does not know an exception is thrown by the above
- throw new org.jboss.util.UnreachableStatementException();
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(oldCl);
- }
- }
-
- public ObjectName getServiceName()
- {
- return (serviceName == null ? support.getServiceName() : serviceName);
- }
-
- public void setServiceName(ObjectName serviceName)
- {
- this.serviceName = serviceName;
- }
-
- @Override
- public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
- {
- ObjectName result = super.preRegister(server, name);
-
- if (!result.equals(getServiceName()))
- throw new IllegalStateException("JMX registration (" + result +
- ") differs from our configured service name (" +
- getServiceName() +")");
-
- return result;
- }
-
- protected Invoker createProxy(List<?> targets, LoadBalancePolicy policy,
- String proxyFamilyName, long viewId)
- {
- return new JRMPInvokerProxyHA(targets, policy, proxyFamilyName, viewId);
- }
-
-
-
-}
-
Modified: trunk/cluster/src/main/java/org/jboss/proxy/ejb/ProxyFactoryHA.java
===================================================================
--- trunk/cluster/src/main/java/org/jboss/proxy/ejb/ProxyFactoryHA.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/cluster/src/main/java/org/jboss/proxy/ejb/ProxyFactoryHA.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -26,7 +26,6 @@
import javax.naming.InitialContext;
import org.jboss.system.Registry;
import org.jboss.logging.Logger;
-import org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxyHA;
import org.jboss.ha.framework.interfaces.LoadBalancePolicy;
import org.jboss.ha.framework.interfaces.DistributedReplicantManager;
import org.jboss.ha.framework.interfaces.HAPartition;
@@ -172,8 +171,6 @@
// The bean invoker
beanInvoker
);
-
- JRMPInvokerProxyHA.colocation.add(new Integer(jmxNameHash));
}
@@ -203,7 +200,6 @@
{
try
{
- JRMPInvokerProxyHA.colocation.remove(new Integer(jmxNameHash));
jrmp.unregisterBean(jmxName);
target.destroy();
}
Modified: trunk/cluster/src/main/java/org/jboss/proxy/generic/ProxyFactoryHA.java
===================================================================
--- trunk/cluster/src/main/java/org/jboss/proxy/generic/ProxyFactoryHA.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/cluster/src/main/java/org/jboss/proxy/generic/ProxyFactoryHA.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -124,8 +124,6 @@
policy = (LoadBalancePolicy)clazz.newInstance();
invoker = invokerHA.createProxy(getServiceName(), policy, clusterFamilyName + "H");
- // JRMPInvokerProxyHA.colocation.add(new Integer(jmxNameHash));
-
super.startService();
}
@@ -140,7 +138,6 @@
try
{
- // JRMPInvokerProxyHA.colocation.remove(new Integer(jmxNameHash));
invokerHA.unregisterBean(getServiceName());
target.destroy();
}
Modified: trunk/connector/src/main/java/org/jboss/resource/adapter/jdbc/remote/WrapperDataSourceService.java
===================================================================
--- trunk/connector/src/main/java/org/jboss/resource/adapter/jdbc/remote/WrapperDataSourceService.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/connector/src/main/java/org/jboss/resource/adapter/jdbc/remote/WrapperDataSourceService.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -270,7 +270,7 @@
*/
protected void createProxy() throws Exception
{
- /* Create an JRMPInvokerProxy that will be associated with a naming JMX
+ /* Create Invoker that will be associated with a naming JMX
invoker given by the jmxInvokerName.
*/
delegateInvoker = (Invoker) Registry.lookup(jmxInvokerName);
Modified: trunk/server/pom.xml
===================================================================
--- trunk/server/pom.xml 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/server/pom.xml 2010-05-07 21:20:52 UTC (rev 104583)
@@ -92,8 +92,6 @@
<descriptor>src/assembly/client.xml</descriptor>
<descriptor>src/assembly/jboss.xml</descriptor>
<descriptor>src/assembly/jboss-minimal.xml</descriptor>
- <descriptor>src/assembly/jmx-adaptor-plugin.xml</descriptor>
- <descriptor>src/assembly/jmx-invoker-adaptor-client.xml</descriptor>
</descriptors>
</configuration>
</execution>
Deleted: trunk/server/src/assembly/jmx-adaptor-plugin.xml
===================================================================
--- trunk/server/src/assembly/jmx-adaptor-plugin.xml 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/server/src/assembly/jmx-adaptor-plugin.xml 2010-05-07 21:20:52 UTC (rev 104583)
@@ -1,16 +0,0 @@
-<assembly>
- <id>jmx-adaptor-plugin</id>
- <formats>
- <format>jar</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>target/classes</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>org/jboss/jmx/**</include>
- </includes>
- </fileSet>
- </fileSets>
-</assembly>
\ No newline at end of file
Deleted: trunk/server/src/assembly/jmx-invoker-adaptor-client.xml
===================================================================
--- trunk/server/src/assembly/jmx-invoker-adaptor-client.xml 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/server/src/assembly/jmx-invoker-adaptor-client.xml 2010-05-07 21:20:52 UTC (rev 104583)
@@ -1,18 +0,0 @@
-<assembly>
- <id>jmx-invoker-adaptor-client</id>
- <formats>
- <format>jar</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>target/classes</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>org/jboss/jmx/adaptor/rmi/RMIAdaptor*</include>
- <include>org/jboss/jmx/adaptor/rmi/RMINotificationListener*</include>
- <include>org/jboss/jmx/connector/invoker/client/**</include>
- </includes>
- </fileSet>
- </fileSets>
-</assembly>
\ No newline at end of file
Modified: trunk/server/src/etc/deploy/legacy-invokers-service.xml
===================================================================
--- trunk/server/src/etc/deploy/legacy-invokers-service.xml 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/server/src/etc/deploy/legacy-invokers-service.xml 2010-05-07 21:20:52 UTC (rev 104583)
@@ -2,29 +2,8 @@
<!-- $Id$ -->
-<!-- ======================================================================= -->
-<!-- Legacy invokers to the JMX node -->
-<!-- ======================================================================= -->
<server>
- <!-- RMI/JRMP invoker -->
- <mbean code="org.jboss.invocation.jrmp.server.JRMPInvoker"
- name="jboss:service=invoker,type=jrmp">
- <attribute name="RMIObjectPort">
- <value-factory bean="ServiceBindingManager" method="getIntBinding" parameter="jboss:service=invoker,type=jrmp"/>
- </attribute>
- <attribute name="ServerAddress">
- <value-factory bean="ServiceBindingManager" method="getStringBinding" parameter="jboss:service=invoker,type=jrmp"/>
- </attribute>
- <!--
- <attribute name="RMIClientSocketFactory">custom</attribute>
- <attribute name="RMIServerSocketFactory">custom</attribute>
- <attribute name="RMIServerSocketAddr">custom</attribute>
- <attribute name="SecurityDomain">ssl-domain-name</attribute>
- -->
- <depends>jboss:service=TransactionManager</depends>
- </mbean>
-
<mbean code="org.jboss.invocation.local.LocalInvoker"
name="jboss:service=invoker,type=local">
Deleted: trunk/server/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxy.java
===================================================================
--- trunk/server/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxy.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/server/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxy.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -1,199 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.invocation.jrmp.interfaces;
-
-import java.io.IOException;
-import java.io.Externalizable;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.rmi.ConnectException;
-import java.rmi.MarshalledObject;
-import java.rmi.NoSuchObjectException;
-import java.rmi.RemoteException;
-import java.rmi.ServerException;
-import java.rmi.server.RemoteObject;
-import java.rmi.server.RemoteStub;
-import javax.transaction.TransactionRolledbackException;
-import javax.transaction.SystemException;
-
-import org.jboss.invocation.Invocation;
-import org.jboss.invocation.Invoker;
-import org.jboss.invocation.MarshalledInvocation;
-import org.jboss.tm.TransactionPropagationContextFactory;
-import org.jboss.tm.TransactionPropagationContextUtil;
-
-/**
- * JRMPInvokerProxy, local to the proxy and is capable of delegating to
- * the JRMP implementations
- *
- * @author <a href="mailto:marc.fleury at jboss.org">Marc Fleury</a>
- * @author <a href="mailto:scott.stark at jboss.org">Scott Stark</a>
- * @version $Revision$
- */
-public class JRMPInvokerProxy
- implements Invoker, Externalizable
-{
- /** Serial Version Identifier. @since 1.7.2.4 */
- private static final long serialVersionUID = -3713605626489646730L;
- // Attributes ----------------------------------------------------
-
- // Invoker to the remote JMX node
- protected Invoker remoteInvoker;
-
- /**
- * max retries on a ConnectException.
- */
- public static int MAX_RETRIES = 10;
-
- /**
- * Exposed for externalization.
- */
- public JRMPInvokerProxy()
- {
- super();
- }
-
- /**
- * Create a new Proxy.
- *
- * @param container The remote interface of the container invoker of the
- * container we proxy for.
- */
- public JRMPInvokerProxy(final Invoker remoteInvoker)
- {
- this.remoteInvoker = remoteInvoker;
- }
-
- /**
- * The name of of the server.
- */
- public String getServerHostName() throws Exception
- {
- return remoteInvoker.getServerHostName();
- }
-
- /**
- * ???
- *
- * @todo: MOVE TO TRANSACTION
- *
- * @return the transaction propagation context of the transaction
- * associated with the current thread.
- * Returns <code>null</code> if the transaction manager was never
- * set, or if no transaction is associated with the current thread.
- */
- public Object getTransactionPropagationContext()
- throws SystemException
- {
- TransactionPropagationContextFactory tpcFactory = TransactionPropagationContextUtil.getTPCFactoryClientSide();
- return (tpcFactory == null) ? null : tpcFactory.getTransactionPropagationContext();
- }
-
- /**
- * The invocation on the delegate, calls the right invoker. Remote if we are remote,
- * local if we are local.
- * @todo Shouldn't we unwrap _ALL_ RemoteExceptions?
- */
- public Object invoke(Invocation invocation)
- throws Exception
- {
- // We are going to go through a Remote invocation, switch to a Marshalled Invocation
- MarshalledInvocation mi = new MarshalledInvocation(invocation);
-
- // Set the transaction propagation context
- // @todo: MOVE TO TRANSACTION
- mi.setTransactionPropagationContext(getTransactionPropagationContext());
-
- // RMI seems to make a connection per invocation.
- // If too many clients are making an invocation
- // at same time, ConnectionExceptions happen
- for (int i = 0; i < MAX_RETRIES; i++)
- {
- try
- {
- MarshalledObject result = (MarshalledObject) remoteInvoker.invoke(mi);
- return result.get();
- }
- catch (ConnectException ce)
- {
- if (i + 1 < MAX_RETRIES)
- {
- Thread.sleep(1);
- continue;
- }
- throw ce;
- }
- catch (ServerException ex)
- {
- // Suns RMI implementation wraps NoSuchObjectException in
- // a ServerException. We cannot have that if we want
- // to comply with the spec, so we unwrap here.
- if (ex.detail instanceof NoSuchObjectException)
- {
- throw (NoSuchObjectException) ex.detail;
- }
- if (ex.detail instanceof TransactionRolledbackException)
- {
- throw (TransactionRolledbackException) ex.detail;
- }
- if (ex.detail instanceof RemoteException)
- {
- throw (RemoteException) ex.detail;
- }
- throw ex;
- }
- }
- throw new Exception("Unreachable statement");
- }
-
- /**
- * Externalize this instance and handle obtaining the remoteInvoker stub
- */
- public void writeExternal(final ObjectOutput out)
- throws IOException
- {
- /** We need to handle obtaining the RemoteStub for the remoteInvoker
- * since this proxy may be serialized in contexts that are not JRMP
- * aware.
- */
- if( remoteInvoker instanceof RemoteStub )
- {
- out.writeObject(remoteInvoker);
- }
- else
- {
- Object replacement = RemoteObject.toStub(remoteInvoker);
- out.writeObject(replacement);
- }
- }
-
- /**
- * Un-externalize this instance.
- *
- */
- public void readExternal(final ObjectInput in)
- throws IOException, ClassNotFoundException
- {
- remoteInvoker = (Invoker) in.readObject();
- }
-}
-
Deleted: trunk/server/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvoker.java
===================================================================
--- trunk/server/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvoker.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/server/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvoker.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -1,873 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.invocation.jrmp.server;
-
-import java.lang.reflect.Method;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.io.Serializable;
-import java.rmi.server.RemoteServer;
-import java.rmi.server.UnicastRemoteObject;
-import java.rmi.server.RMIServerSocketFactory;
-import java.rmi.server.RMIClientSocketFactory;
-import java.rmi.server.RemoteStub;
-import java.rmi.MarshalledObject;
-import java.security.PrivilegedAction;
-import java.security.AccessController;
-import java.security.PrivilegedExceptionAction;
-import java.security.PrivilegedActionException;
-
-import javax.management.ObjectName;
-import javax.management.MBeanRegistration;
-import javax.management.MBeanServer;
-import javax.naming.Name;
-import javax.naming.InitialContext;
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.NameNotFoundException;
-import javax.transaction.Transaction;
-
-import org.jboss.beans.metadata.api.annotations.Create;
-import org.jboss.beans.metadata.api.annotations.Destroy;
-import org.jboss.beans.metadata.api.annotations.Start;
-import org.jboss.beans.metadata.api.annotations.Stop;
-import org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy;
-import org.jboss.invocation.Invocation;
-import org.jboss.invocation.Invoker;
-import org.jboss.invocation.MarshalledInvocation;
-import org.jboss.invocation.MarshalledValueInputStream;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.JMXExceptionDecoder;
-import org.jboss.net.sockets.DefaultSocketFactory;
-import org.jboss.security.SecurityDomain;
-import org.jboss.system.Registry;
-import org.jboss.system.ServiceMBeanSupport;
-import org.jboss.tm.TransactionPropagationContextUtil;
-
-/**
- * The JRMPInvoker is an RMI implementation that can generate Invocations
- * from RMI/JRMP into the JMX base.
- *
- * @author <a href="mailto:marc.fleury at jboss.org>Marc Fleury</a>
- * @author <a href="mailto:scott.stark at jboss.org>Scott Stark</a>
- * @version $Revision$
- * @jmx.mbean extends="org.jboss.system.ServiceMBean"
- */
-public class JRMPInvoker
- extends RemoteServer
- implements Invoker, JRMPInvokerMBean, MBeanRegistration, KernelControllerContextAware
-{
- /** @since 4.2.0 */
- static final long serialVersionUID = 3110972460891691492L;
-
- /**
- * Identifer to instruct the usage of an anonymous port.
- */
- public static final int ANONYMOUS_PORT = 0;
-
- /**
- * Instance logger.
- */
- protected Logger log;
-
- /**
- * Service MBean support delegate.
- */
- protected ServiceMBeanSupport support;
-
- /**
- * The port the container will be exported on
- */
- protected int rmiPort = ANONYMOUS_PORT;
-
- /**
- * An optional custom client socket factory
- */
- protected RMIClientSocketFactory clientSocketFactory;
-
- /**
- * An optional custom server socket factory
- */
- protected RMIServerSocketFactory serverSocketFactory;
-
- /**
- * The class name of the optional custom client socket factory
- */
- protected String clientSocketFactoryName;
-
- /**
- * The class name of the optional custom server socket factory
- */
- protected String serverSocketFactoryName;
-
- /**
- * The address to bind the rmi port on
- */
- protected String serverAddress;
- /**
- * The name of the security domain to use with server sockets that support SSL
- */
- protected String sslDomain;
-
- protected RemoteStub invokerStub;
- /**
- * The socket accept backlog
- */
- protected int backlog = 200;
- /**
- * A flag to enable caching of classes in the MarshalledValueInputStream
- */
- protected boolean enableClassCaching = false;
- /**
- * A priviledged actions for MBeanServer.invoke when running with sec mgr
- */
- private MBeanServerAction serverAction = new MBeanServerAction();
-
- public JRMPInvoker()
- {
- final JRMPInvoker delegate = this;
-
- // adapt the support delegate to invoke our state methods
- support = new ServiceMBeanSupport(getClass())
- {
- protected void startService() throws Exception
- {
- delegate.startService();
- }
- protected void stopService() throws Exception
- {
- delegate.stopService();
- }
- protected void destroyService() throws Exception
- {
- delegate.destroyService();
- }
- };
-
- // Setup logging from delegate
- log = support.getLog();
- }
-
- /**
- * @jmx.managed-attribute
- */
- public int getBacklog()
- {
- return backlog;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public void setBacklog(int back)
- {
- backlog = back;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public boolean getEnableClassCaching()
- {
- return enableClassCaching;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public void setEnableClassCaching(boolean flag)
- {
- enableClassCaching = flag;
- MarshalledValueInputStream.useClassCache(enableClassCaching);
- }
-
- /**
- * @return The localhost name or null.
- */
- public String getServerHostName()
- {
- try
- {
- return InetAddress.getLocalHost().getHostName();
- }
- catch (Exception ignored)
- {
- return null;
- }
- }
-
- /**
- * @jmx.managed-attribute
- */
- public void setRMIObjectPort(final int rmiPort)
- {
- this.rmiPort = rmiPort;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public int getRMIObjectPort()
- {
- return rmiPort;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public void setRMIClientSocketFactory(final String name)
- {
- clientSocketFactoryName = name;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public String getRMIClientSocketFactory()
- {
- return clientSocketFactoryName;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public void setRMIClientSocketFactoryBean(final RMIClientSocketFactory bean)
- {
- clientSocketFactory = bean;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public RMIClientSocketFactory getRMIClientSocketFactoryBean()
- {
- return clientSocketFactory;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public void setRMIServerSocketFactory(final String name)
- {
- serverSocketFactoryName = name;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public String getRMIServerSocketFactory()
- {
- return serverSocketFactoryName;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public void setRMIServerSocketFactoryBean(final RMIServerSocketFactory bean)
- {
- serverSocketFactory = bean;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public RMIServerSocketFactory getRMIServerSocketFactoryBean()
- {
- return serverSocketFactory;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public void setServerAddress(final String address)
- {
- serverAddress = address;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public String getServerAddress()
- {
- return serverAddress;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public void setSecurityDomain(String domainName)
- {
- this.sslDomain = domainName;
- }
-
- /**
- * @jmx.managed-attribute
- */
- public String getSecurityDomain()
- {
- return sslDomain;
- }
-
- public Serializable getStub()
- {
- return this.invokerStub;
- }
-
- protected void startService() throws Exception
- {
- loadCustomSocketFactories();
-
- log.debug("RMI Port='" +
- (rmiPort == ANONYMOUS_PORT ? "Anonymous" :
- Integer.toString(rmiPort)) + "'");
-
- log.debug("Client SocketFactory='" +
- (clientSocketFactory == null ? "Default" :
- clientSocketFactory.toString()) + "'");
-
- log.debug("Server SocketFactory='" +
- (serverSocketFactory == null ? "Default" :
- serverSocketFactory.toString()) + "'");
-
- log.debug("Server SocketAddr='" +
- (serverAddress == null ? "Default" :
- serverAddress) + "'");
- log.debug("SecurityDomain='" +
- (sslDomain == null ? "Default" :
- sslDomain) + "'");
-
- InitialContext ctx = new InitialContext();
-
- // Validate that there is a TransactionPropagationContextImporter
- // bound in JNDI
- TransactionPropagationContextUtil.getTPCImporter();
-
- // Set the transaction manager and transaction propagation
- // context factory of the GenericProxy class
-
- Invoker delegateInvoker = createDelegateInvoker();
-
- // Make the remote invoker proxy available for use by the proxy factory
- Registry.bind(support.getServiceName(), delegateInvoker);
-
- // Export CI
- exportCI();
-
- log.debug("Bound JRMP invoker for JMX node");
-
- ctx.close();
- }
-
- protected void stopService() throws Exception
- {
- InitialContext ctx = new InitialContext();
-
- try
- {
- unexportCI();
- }
- finally
- {
- ctx.close();
- }
- this.clientSocketFactory = null;
- this.serverSocketFactory = null;
- this.invokerStub = null;
- }
-
- protected void destroyService() throws Exception
- {
- // Export references to the bean
- Registry.unbind(support.getServiceName());
- }
-
- /**
- * Invoke a Remote interface method.
- */
- public Object invoke(Invocation invocation)
- throws Exception
- {
- ClassLoader oldCl = TCLAction.UTIL.getContextClassLoader();
- ObjectName mbean = null;
- try
- {
- // Deserialize the transaction if it is there
- MarshalledInvocation mi = (MarshalledInvocation) invocation;
- invocation.setTransaction(importTPC(mi.getTransactionPropagationContext()));
-
- mbean = (ObjectName) Registry.lookup(invocation.getObjectName());
-
- // The cl on the thread should be set in another interceptor
- Object obj = serverAction.invoke(mbean,
- "invoke",
- new Object[]{invocation},
- Invocation.INVOKE_SIGNATURE);
- return new MarshalledObject(obj);
- }
- catch (Exception e)
- {
- Throwable th = JMXExceptionDecoder.decode(e);
- if (log.isTraceEnabled())
- log.trace("Failed to invoke on mbean: " + mbean, th);
-
- if (th instanceof Exception)
- e = (Exception) th;
-
- throw e;
- }
- finally
- {
- TCLAction.UTIL.setContextClassLoader(oldCl);
- }
- }
-
- protected Invoker createDelegateInvoker()
- {
- return new JRMPInvokerProxy(this);
- }
-
- protected void exportCI() throws Exception
- {
- this.invokerStub = (RemoteStub) UnicastRemoteObject.exportObject
- (this, rmiPort, clientSocketFactory, serverSocketFactory);
- }
-
- protected void unexportCI() throws Exception
- {
- UnicastRemoteObject.unexportObject(this, true);
- }
-
- protected void rebind(Context ctx, String name, Object val)
- throws NamingException
- {
- // Bind val to name in ctx, and make sure that all
- // intermediate contexts exist
-
- Name n = ctx.getNameParser("").parse(name);
- while (n.size() > 1)
- {
- String ctxName = n.get(0);
- try
- {
- ctx = (Context) ctx.lookup(ctxName);
- }
- catch (NameNotFoundException e)
- {
- ctx = ctx.createSubcontext(ctxName);
- }
- n = n.getSuffix(1);
- }
-
- ctx.rebind(n.get(0), val);
- }
-
- /**
- * Load and instantiate the clientSocketFactory, serverSocketFactory using
- * the TCL and set the bind address and SSL domain if the serverSocketFactory
- * supports it.
- */
- protected void loadCustomSocketFactories()
- {
- ClassLoader loader = TCLAction.UTIL.getContextClassLoader();
-
- if( clientSocketFactory == null )
- {
- try
- {
- if (clientSocketFactoryName != null)
- {
- Class csfClass = loader.loadClass(clientSocketFactoryName);
- clientSocketFactory = (RMIClientSocketFactory) csfClass.newInstance();
- }
- }
- catch (Exception e)
- {
- log.error("Failed to load client socket factory", e);
- clientSocketFactory = null;
- }
- }
-
- if( serverSocketFactory == null )
- {
- try
- {
- if (serverSocketFactoryName != null)
- {
- Class ssfClass = loader.loadClass(serverSocketFactoryName);
- serverSocketFactory = (RMIServerSocketFactory) ssfClass.newInstance();
- if (serverAddress != null)
- {
- // See if the server socket supports setBindAddress(String)
- try
- {
- Class[] parameterTypes = {String.class};
- Method m = ssfClass.getMethod("setBindAddress", parameterTypes);
- Object[] args = {serverAddress};
- m.invoke(serverSocketFactory, args);
- }
- catch (NoSuchMethodException e)
- {
- log.warn("Socket factory does not support setBindAddress(String)");
- // Go with default address
- }
- catch (Exception e)
- {
- log.warn("Failed to setBindAddress=" + serverAddress + " on socket factory", e);
- // Go with default address
- }
- }
- /* See if the server socket supports setSecurityDomain(SecurityDomain)
- if an sslDomain was specified
- */
- if (sslDomain != null)
- {
- try
- {
- InitialContext ctx = new InitialContext();
- SecurityDomain domain = (SecurityDomain) ctx.lookup(sslDomain);
- Class[] parameterTypes = {SecurityDomain.class};
- Method m = ssfClass.getMethod("setSecurityDomain", parameterTypes);
- Object[] args = {domain};
- m.invoke(serverSocketFactory, args);
- }
- catch (NoSuchMethodException e)
- {
- log.error("Socket factory does not support setSecurityDomain(SecurityDomain)");
- }
- catch (Exception e)
- {
- log.error("Failed to setSecurityDomain=" + sslDomain + " on socket factory", e);
- }
- }
- }
- // If a bind address was specified create a DefaultSocketFactory
- else if (serverAddress != null)
- {
- DefaultSocketFactory defaultFactory = new DefaultSocketFactory(backlog);
- serverSocketFactory = defaultFactory;
- try
- {
- defaultFactory.setBindAddress(serverAddress);
- }
- catch (UnknownHostException e)
- {
- log.error("Failed to setBindAddress=" + serverAddress + " on socket factory", e);
- }
- }
- }
- catch (Exception e)
- {
- log.error("operation failed", e);
- serverSocketFactory = null;
- }
- }
- }
-
- /**
- * Import a transaction propagation context into the local VM, and
- * return the corresponding <code>Transaction</code>.
- *
- * @return A transaction or null if no tpc.
- */
- protected Transaction importTPC(Object tpc)
- {
- if (tpc != null)
- return TransactionPropagationContextUtil.importTPC(tpc);
- return null;
- }
-
- //
- // Delegate the ServiceMBean details to our support delegate
- //
-
- public String getName()
- {
- return support.getName();
- }
-
- public MBeanServer getServer()
- {
- return support.getServer();
- }
-
- public int getState()
- {
- return support.getState();
- }
-
- public String getStateString()
- {
- return support.getStateString();
- }
-
- public void create() throws Exception
- {
- support.create();
- }
-
- public void start() throws Exception
- {
- support.start();
- }
-
- public void stop()
- {
- support.stop();
- }
-
- public void destroy()
- {
- support.destroy();
- }
-
- public void jbossInternalLifecycle(String method) throws Exception
- {
- support.jbossInternalLifecycle(method);
- }
-
- public ObjectName preRegister(MBeanServer server, ObjectName name)
- throws Exception
- {
- return support.preRegister(server, name);
- }
-
- public void postRegister(Boolean registrationDone)
- {
- support.postRegister(registrationDone);
- }
-
- public void preDeregister() throws Exception
- {
- support.preDeregister();
- }
-
- public void postDeregister()
- {
- support.postDeregister();
- }
-
- public void setKernelControllerContext(KernelControllerContext context) throws Exception
- {
- support.setKernelControllerContext(context);
- }
-
- public void unsetKernelControllerContext(KernelControllerContext context) throws Exception
- {
- support.unsetKernelControllerContext(context);
- }
-
- @Create
- public void pojoCreate() throws Exception
- {
- support.pojoCreate();
- }
-
- @Start
- public void pojoStart() throws Exception
- {
- support.pojoStart();
- }
-
- @Stop
- public void pojoStop() throws Exception
- {
- support.pojoStop();
- }
-
- @Destroy
- public void pojoDestroy() throws Exception
- {
- support.pojoDestroy();
- }
-
- interface TCLAction
- {
- class UTIL
- {
- static TCLAction getTCLAction()
- {
- return System.getSecurityManager() == null ? NON_PRIVILEGED : PRIVILEGED;
- }
-
- static ClassLoader getContextClassLoader()
- {
- return getTCLAction().getContextClassLoader();
- }
-
- static ClassLoader getContextClassLoader(Thread thread)
- {
- return getTCLAction().getContextClassLoader(thread);
- }
-
- static void setContextClassLoader(ClassLoader cl)
- {
- getTCLAction().setContextClassLoader(cl);
- }
-
- static void setContextClassLoader(Thread thread, ClassLoader cl)
- {
- getTCLAction().setContextClassLoader(thread, cl);
- }
- }
-
- TCLAction NON_PRIVILEGED = new TCLAction()
- {
- public ClassLoader getContextClassLoader()
- {
- return Thread.currentThread().getContextClassLoader();
- }
-
- public ClassLoader getContextClassLoader(Thread thread)
- {
- return thread.getContextClassLoader();
- }
-
- public void setContextClassLoader(ClassLoader cl)
- {
- Thread.currentThread().setContextClassLoader(cl);
- }
-
- public void setContextClassLoader(Thread thread, ClassLoader cl)
- {
- thread.setContextClassLoader(cl);
- }
- };
-
- TCLAction PRIVILEGED = new TCLAction()
- {
- private final PrivilegedAction getTCLPrivilegedAction = new PrivilegedAction()
- {
- public Object run()
- {
- return Thread.currentThread().getContextClassLoader();
- }
- };
-
- public ClassLoader getContextClassLoader()
- {
- return (ClassLoader) AccessController.doPrivileged(getTCLPrivilegedAction);
- }
-
- public ClassLoader getContextClassLoader(final Thread thread)
- {
- return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- return thread.getContextClassLoader();
- }
- });
- }
-
- public void setContextClassLoader(final ClassLoader cl)
- {
- AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- Thread.currentThread().setContextClassLoader(cl);
- return null;
- }
- });
- }
-
- public void setContextClassLoader(final Thread thread, final ClassLoader cl)
- {
- AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- thread.setContextClassLoader(cl);
- return null;
- }
- });
- }
- };
-
- ClassLoader getContextClassLoader();
-
- ClassLoader getContextClassLoader(Thread thread);
-
- void setContextClassLoader(ClassLoader cl);
-
- void setContextClassLoader(Thread thread, ClassLoader cl);
- }
-
- /**
- * Perform the MBeanServer.invoke op in a PrivilegedExceptionAction if
- * running with a security manager.
- */
- class MBeanServerAction implements PrivilegedExceptionAction
- {
- private ObjectName target;
- String method;
- Object[] args;
- String[] sig;
-
- MBeanServerAction()
- {
- }
-
- MBeanServerAction(ObjectName target, String method, Object[] args, String[] sig)
- {
- this.target = target;
- this.method = method;
- this.args = args;
- this.sig = sig;
- }
-
- public Object run() throws Exception
- {
- Object rtnValue = support.getServer().invoke(target, method, args, sig);
- return rtnValue;
- }
-
- Object invoke(ObjectName target, String method, Object[] args, String[] sig)
- throws Exception
- {
- SecurityManager sm = System.getSecurityManager();
- Object rtnValue = null;
- if (sm == null)
- {
- // Direct invocation on MBeanServer
- rtnValue = support.getServer().invoke(target, method, args, sig);
- }
- else
- {
- try
- {
- // Encapsulate the invocation in a PrivilegedExceptionAction
- MBeanServerAction action = new MBeanServerAction(target, method, args, sig);
- rtnValue = AccessController.doPrivileged(action);
- }
- catch (PrivilegedActionException e)
- {
- Exception ex = e.getException();
- throw ex;
- }
- }
- return rtnValue;
- }
- }
-}
Modified: trunk/server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactory.java
===================================================================
--- trunk/server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactory.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactory.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -40,11 +40,13 @@
import org.jboss.metadata.MetaData;
import org.w3c.dom.Element;
-/** Create an interface proxy that uses RMI/JRMP to communicate with the server
+/** Create an interface proxy that communicates with the server
* side object that exposes the corresponding JMX invoke operation. Requests
- * make through the proxy are sent to the JRMPInvoker instance the proxy
- * is bound to.
+ * make through the proxy are sent to the Invoker instance the proxy
+ * is bound to.
*
+ * TODO: Remove JRMP from name of JRMPProxyFactory class as this is no longer tied to JRMP
+ *
* @author Scott.Stark at jboss.org
* @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
* @version $Revision$
@@ -52,7 +54,7 @@
public class JRMPProxyFactory extends ServiceMBeanSupport
implements JRMPProxyFactoryMBean
{
- /** The server side JRMPInvoker mbean that will handle RMI/JRMP transport */
+ /** The server side mbean */
private ObjectName invokerName;
/** The server side mbean that exposes the invoke operation for the
exported interface */
@@ -188,7 +190,7 @@
protected void startService() throws Exception
{
/* Create a binding between the invoker name hash and the jmx name
- This is used by the JRMPInvoker to map from the Invocation ObjectName
+ This is used by the Invoker to map from the Invocation ObjectName
hash value to the target JMX ObjectName.
*/
Integer nameHash = new Integer(getServiceName().hashCode());
Modified: trunk/server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactoryMBean.java
===================================================================
--- trunk/server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactoryMBean.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactoryMBean.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -58,14 +58,14 @@
/** Set the JNDI name under which the HttpInvokerProxy will be bound */
public void setJndiName(String jndiName);
- /** Get the RMI compatible interface that the JRMPInvokerProxy implements */
+ /** Get the RMI compatible interface that the InvokerProxy implements */
public Class getExportedInterface();
- /** Set the RMI compatible interface that the JRMPInvokerProxy implements */
+ /** Set the RMI compatible interface that the InvokerProxy implements */
public void setExportedInterface(Class exportedInterface);
- /** Get the RMI compatible interface that the JRMPInvokerProxy implements */
+ /** Get the RMI compatible interface that the InvokerProxy implements */
public Class[] getExportedInterfaces();
- /** Set the RMI compatible interface that the JRMPInvokerProxy implements */
+ /** Set the RMI compatible interface that the InvokerProxy implements */
public void setExportedInterfaces(Class[] exportedInterface);
/** Get the proxy client side interceptor configuration
Modified: trunk/system/src/resources/tests/conf/jboss-service-VDFDeploymentScanner.xml
===================================================================
--- trunk/system/src/resources/tests/conf/jboss-service-VDFDeploymentScanner.xml 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/system/src/resources/tests/conf/jboss-service-VDFDeploymentScanner.xml 2010-05-07 21:20:52 UTC (rev 104583)
@@ -297,20 +297,6 @@
<depends>jboss.remoting:service=Connector,transport=socket</depends>
</mbean>
- <!-- RMI/JRMP invoker -->
- <mbean code="org.jboss.invocation.jrmp.server.JRMPInvoker"
- name="jboss:service=invoker,type=jrmp">
- <attribute name="RMIObjectPort">4444</attribute>
- <attribute name="ServerAddress">${jboss.bind.address}</attribute>
- <!--
- <attribute name="RMIClientSocketFactory">custom</attribute>
- <attribute name="RMIServerSocketFactory">custom</attribute>
- <attribute name="RMIServerSocketAddr">custom</attribute>
- <attribute name="SecurityDomain">ssl-domain-name</attribute>
- -->
- <depends>jboss:service=TransactionManager</depends>
- </mbean>
-
<mbean code="org.jboss.invocation.local.LocalInvoker"
name="jboss:service=invoker,type=local">
Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/testsuite/build.xml 2010-05-07 21:20:52 UTC (rev 104583)
@@ -999,28 +999,6 @@
</patternset>
<patternset id="jbossxb.excludes">
</patternset>
- <!-- Tests needing jrmp invoker -->
- <patternset id="jrmp-invoker.includes">
- <include name="org/jboss/test/cts/test/BmpUnitTestCase.class"/>
- <!--include name="org/jboss/test/cts/test/ClientCallbackImpl.class"/-->
- <include name="org/jboss/test/cts/test/CmpUnitTestCase.class"/>
- <include name="org/jboss/test/cts/test/CtsCmp2UnitTestCase.class"/>
- <include name="org/jboss/test/cts/test/IndependentJarsUnitTestCase.class"/>
- <include name="org/jboss/test/cts/test/LocalEjbTestCase.class"/>
- <include name="org/jboss/test/cts/test/LongWaitStatefulSessionUnitTestCase.class"/>
- <!--include name="org/jboss/test/cts/test/MDBInvoker.class"/-->
- <!--include name="org/jboss/test/cts/test/MDBUnitTestCase.class"/-->
- <!--include name="org/jboss/test/cts/test/SessionInvoker.class"/-->
- <include name="org/jboss/test/cts/test/StatefulSessionLocalUnitTestCase.class"/>
- <include name="org/jboss/test/cts/test/StatefulSessionUnitTestCase.class"/>
- <include name="org/jboss/test/cts/test/StatelessSessionStressTestCase.class"/>
- <include name="org/jboss/test/cts/test/StatelessSessionUnitTestCase.class"/>
- <include name="org/jboss/test/bank/test/BankEJB20StressTestCase.class"/>
- <include name="org/jboss/test/testbean/test/BeanUnitTestCase.class"/>
- </patternset>
- <patternset id="jrmp-invoker.excludes">
- <exclude name="org/jboss/test/bank/test/*"/>
- </patternset>
<!-- A patternset for that require a security config -->
<patternset id="security.includes">
<include name="**/test/naming/test/Security*"/>
@@ -1270,7 +1248,6 @@
<antcall target="tests-hornetq" inheritRefs="true"/>
<!-- JBAS-7154 <antcall target="tests-compatibility" inheritRefs="true"/> -->
<antcall target="tests-aop-scoped" inheritRefs="true"/>
- <antcall target="jrmp-invoker-tests" inheritRefs="true"/>
<antcall target="tests-clustered-profileservice" inheritRefs="true"/>
<!-- JBAS-7680 the current 'web' profile is not an EE6 web profile and doesn't include JPA, so these WebJPA tests are disabled
<antcall target="tests-web-profile" inheritRefs="true"/>
@@ -1568,28 +1545,6 @@
</target>
<!--
- | Tests ejb calls using the jrmp invoker
- -->
- <target name="jrmp-invoker-tests" depends="init"
- description="EJB tests using the jrmp invoker">
- <!-- Create the jrmp invoker enabled config -->
- <create-config baseconf="default" newconf="jrmp-invoker">
- <patternset>
- <include name="conf/**"/>
- <include name="deployers/**"/>
- <include name="deploy/**"/>
- <include name="lib/**"/>
- </patternset>
- </create-config>
- <server:start name="jrmp-invoker"/>
-
- <run-junit junit.patternset="jrmp-invoker.includes"
- junit.configuration="JRMP-Invoker" />
-
- <server:stop name="jrmp-invoker"/>
- </target>
-
- <!--
| Tests DeploymentService
-->
<target name="deployment-service-tests"
Modified: trunk/testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml
===================================================================
--- trunk/testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml 2010-05-07 21:20:52 UTC (rev 104583)
@@ -255,20 +255,6 @@
<!-- Invokers to the JMX node -->
<!-- ==================================================================== -->
- <!-- RMI/JRMP invoker -->
- <mbean code="org.jboss.invocation.jrmp.server.JRMPInvoker"
- name="jboss:service=invoker,type=jrmp">
- <attribute name="RMIObjectPort">4444</attribute>
- <attribute name="ServerAddress">${jboss.bind.address}</attribute>
- <!--
- <attribute name="RMIClientSocketFactory">custom</attribute>
- <attribute name="RMIServerSocketFactory">custom</attribute>
- <attribute name="RMIServerSocketAddr">custom</attribute>
- <attribute name="SecurityDomain">ssl-domain-name</attribute>
- -->
- <depends>jboss:service=TransactionManager</depends>
- </mbean>
-
<mbean code="org.jboss.invocation.local.LocalInvoker"
name="jboss:service=invoker,type=local">
Modified: trunk/testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml
===================================================================
--- trunk/testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml 2010-05-07 21:20:52 UTC (rev 104583)
@@ -255,20 +255,6 @@
<!-- Invokers to the JMX node -->
<!-- ==================================================================== -->
- <!-- RMI/JRMP invoker -->
- <mbean code="org.jboss.invocation.jrmp.server.JRMPInvoker"
- name="jboss:service=invoker,type=jrmp">
- <attribute name="RMIObjectPort">4444</attribute>
- <attribute name="ServerAddress">${jboss.bind.address}</attribute>
- <!--
- <attribute name="RMIClientSocketFactory">custom</attribute>
- <attribute name="RMIServerSocketFactory">custom</attribute>
- <attribute name="RMIServerSocketAddr">custom</attribute>
- <attribute name="SecurityDomain">ssl-domain-name</attribute>
- -->
- <depends>jboss:service=TransactionManager</depends>
- </mbean>
-
<mbean code="org.jboss.invocation.local.LocalInvoker"
name="jboss:service=invoker,type=local">
Modified: trunk/testsuite/src/main/org/jboss/test/binding/BindingServiceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/binding/BindingServiceUnitTestCase.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/testsuite/src/main/org/jboss/test/binding/BindingServiceUnitTestCase.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -33,7 +33,6 @@
import javax.naming.Context;
import javax.naming.InitialContext;
-//import org.jboss.jmx.adaptor.rmi.RMIAdaptorExt;
import org.jboss.management.j2ee.StateManageable;
import org.jboss.system.BarrierController;
import org.jboss.system.ServiceMBean;
Deleted: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaTransactionStickyUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaTransactionStickyUnitTestCase.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaTransactionStickyUnitTestCase.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.test.cluster.defaultcfg.test;
-
-import java.util.List;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.jboss.invocation.InvokerHA;
-import org.jboss.test.cluster.defaultcfg.test.JRMPInvokerHaUnitTestCase.JRMPInvokerHaFactory;
-import org.jboss.test.cluster.invokerha.AbstractInvokerHaTransactionSticky;
-
-/**
- * JRMPInvokerHaTransactionStickyUnitTestCase.
- *
- * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
- */
-public class JRMPInvokerHaTransactionStickyUnitTestCase extends AbstractInvokerHaTransactionSticky
-{
- @Override
- protected void setUp() throws Exception
- {
- setUp(2, new JRMPInvokerHaTransactionStickyFactory());
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- @Override
- protected List undeployChosenTargetNode(Object chosenTarget)
- {
- List<? extends InvokerHA> replicants = infrastructure.getReplicants();
- replicants.remove(chosenTarget);
- return replicants;
- }
-
- public static class JRMPInvokerHaTransactionStickyFactory extends JRMPInvokerHaFactory
- {
- @Override
- public String getChosenTargetKey()
- {
- return "TX_STICKY_TARGET";
- }
- }
-
- public static Test suite()
- {
- /* No transactions to be run for JRMP invoker version of transaction
- * sticky functionality because this old legacy invoker is no longer
- * supported for transaction sticky functionality. */
- return new TestSuite();
- }
-}
Deleted: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaUnitTestCase.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaUnitTestCase.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.test.cluster.defaultcfg.test;
-
-import java.util.Map;
-
-import org.jboss.invocation.InvokerHA;
-import org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxyHA;
-import org.jboss.test.cluster.invokerha.AbstractInvokerHa;
-import org.jboss.test.cluster.invokerha.InvokerHaInfrastructure;
-import org.jboss.test.cluster.invokerha.InvokerHaInfrastructure.InvokerHaFactory;
-import org.jboss.test.cluster.invokerha.JRMPInvokerHaMockUtils.MockJRMPInvokerHA;
-
-/**
- * Unit test case for jrmp invoker ha proxy and invoker at the other side.
- *
- * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
- */
-public class JRMPInvokerHaUnitTestCase extends AbstractInvokerHa
-{
- @Override
- protected void setUp() throws Exception
- {
- setUp(2, new JRMPInvokerHaFactory());
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- /** Classes **/
-
- public static class JRMPInvokerHaFactory implements InvokerHaFactory
- {
- public String getInvokerTypeName()
- {
- return "JRMPInvokerHa";
- }
-
- public InvokerHaInfrastructure getInvokerHaInfrastructure(int serverCount)
- {
- return new InvokerHaInfrastructure(serverCount, this);
- }
-
- public Map getTxFailoverAuthorizationsMap()
- {
- return JRMPInvokerProxyHA.txFailoverAuthorizations;
- }
-
- public InvokerHA createInvokerHaServer(String serverName, int serverNumber)
- {
- return new MockJRMPInvokerHA(getInvokerTypeName() + "-" + serverName + "-" + serverNumber);
- }
-
- public String getChosenTargetKey()
- {
- return "TEST_CHOSEN_TARGET";
- }
- }
-}
Deleted: trunk/testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaMockUtils.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaMockUtils.java 2010-05-07 20:42:16 UTC (rev 104582)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaMockUtils.java 2010-05-07 21:20:52 UTC (rev 104583)
@@ -1,128 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.test.cluster.invokerha;
-
-import java.util.List;
-
-import org.jboss.ha.framework.interfaces.LoadBalancePolicy;
-import org.jboss.invocation.Invocation;
-import org.jboss.invocation.Invoker;
-import org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxyHA;
-import org.jboss.invocation.jrmp.server.JRMPInvokerHA;
-
-/**
- * JrmpInvokerHaMockUtils.
- *
- * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
- */
-public class JRMPInvokerHaMockUtils
-{
- /**
- * Mock version of JRMPInvokerHA that eases debugging and swallows an
- * exception being thrown when unregistering the invoker ha mbean.
- *
- * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
- */
- public static class MockJRMPInvokerHA extends JRMPInvokerHA
- {
- /** The serialVersionUID */
- private static final long serialVersionUID = -4557124707606766661L;
-
- private String name;
-
- public MockJRMPInvokerHA(String name)
- {
- this.name = name;
- }
-
- /**
- * Override postDeregister() to avoid the following exception being
- * thrown on tearDown():
- *
- * javax.management.InstanceNotFoundException: jboss.system:service=ServiceController
- * at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1010)
- * at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:804)
- * at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
- * at org.jboss.system.ServiceMBeanSupport.postDeregister(ServiceMBeanSupport.java:424)
- * at org.jboss.invocation.jrmp.server.JRMPInvoker.postDeregister(JRMPInvoker.java:665)
- */
- @Override
- public void postDeregister()
- {
- }
-
- /**
- * Override toString because in absence of RemoteRef
- * java.rmi.server.RemoteObject's toString implementation prints just
- * the class name which makes it pretty ackward for assertions and
- * debugging.
- */
- @Override
- public String toString()
- {
- return name;
- }
-
- @Override
- protected Invoker createProxy(List<?> targets, LoadBalancePolicy policy, String proxyFamilyName,
- long viewId)
- {
- return new MockJRMPInvokerProxyHA(targets, policy, proxyFamilyName, viewId);
- }
-
- @Override
- public Object invoke(Invocation invocation) throws Exception
- {
- InvokerHaFailureType failureType = (InvokerHaFailureType)invocation.getValue("FAILURE_TYPE");
- if (failureType != null)
- {
- failureType.injectFailureIfExistsAfterServer((Integer)invocation.getAsIsValue("FAILOVER_COUNTER"));
- }
-
- return super.invoke(invocation);
- }
-
- }
-
- public static class MockJRMPInvokerProxyHA extends JRMPInvokerProxyHA
- {
-
- public MockJRMPInvokerProxyHA(List<?> targets, LoadBalancePolicy policy, String proxyFamilyName, long viewId)
- {
- super(targets, policy, proxyFamilyName, viewId);
- }
-
-
- @Override
- public boolean txContextAllowsFailover(Invocation invocation)
- {
- return super.txContextAllowsFailover(invocation);
- }
-
- @Override
- public Object invoke(Invocation invocation) throws Exception
- {
- return super.invoke(invocation);
- }
- }
-
-}
More information about the jboss-cvs-commits
mailing list