Index: cluster/src/main/java/org/jboss/proxy/ejb/ProxyFactoryHA.java =================================================================== --- cluster/src/main/java/org/jboss/proxy/ejb/ProxyFactoryHA.java (revision 104473) +++ cluster/src/main/java/org/jboss/proxy/ejb/ProxyFactoryHA.java (working copy) @@ -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(); } Index: cluster/src/main/java/org/jboss/proxy/generic/ProxyFactoryHA.java =================================================================== --- cluster/src/main/java/org/jboss/proxy/generic/ProxyFactoryHA.java (revision 104473) +++ cluster/src/main/java/org/jboss/proxy/generic/ProxyFactoryHA.java (working copy) @@ -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(); } Index: cluster/src/main/java/org/jboss/ha/jndi/DetachedHANamingService.java =================================================================== --- cluster/src/main/java/org/jboss/ha/jndi/DetachedHANamingService.java (revision 104473) +++ cluster/src/main/java/org/jboss/ha/jndi/DetachedHANamingService.java (working copy) @@ -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 Bill Burke * @author Sacha Labourey * @author Scott.Stark@jboss.org Index: cluster/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxyHA.java =================================================================== --- cluster/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxyHA.java (revision 104473) +++ cluster/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxyHA.java (working copy) @@ -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 Marc Fleury - * @author Scott.Stark@jboss.org - * @author Galder Zamarreno - * @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 colocation = new HashSet(); - public static final Map txFailoverAuthorizations = Collections.synchronizedMap(new WeakHashMap()); - - 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)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 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(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 ------------------------------------------------- -} Index: cluster/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvokerHA.java =================================================================== --- cluster/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvokerHA.java (revision 104473) +++ cluster/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvokerHA.java (working copy) @@ -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 Sacha Labourey. - * @author Scott.Stark@jboss.org - * @author Galder Zamarreno - * @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); - } - - - -} - Index: cluster/src/etc/ha-legacy-jboss-beans.xml =================================================================== --- cluster/src/etc/ha-legacy-jboss-beans.xml (revision 104473) +++ cluster/src/etc/ha-legacy-jboss-beans.xml (working copy) @@ -9,35 +9,6 @@ - - - - - - @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=invoker,type=jrmpha", exposedInterface=org.jboss.invocation.jrmp.server.JRMPInvokerMBean.class, registerDirectly=true) - - - - - - - - - - - - - jboss:service=TransactionManager - HAPartition - - - Index: system/src/resources/tests/conf/jboss-service-VDFDeploymentScanner.xml =================================================================== --- system/src/resources/tests/conf/jboss-service-VDFDeploymentScanner.xml (revision 104473) +++ system/src/resources/tests/conf/jboss-service-VDFDeploymentScanner.xml (working copy) @@ -297,20 +297,6 @@ jboss.remoting:service=Connector,transport=socket - - - 4444 - ${jboss.bind.address} - - jboss:service=TransactionManager - - Index: server/src/assembly/jmx-adaptor-plugin.xml =================================================================== --- server/src/assembly/jmx-adaptor-plugin.xml (revision 104473) +++ server/src/assembly/jmx-adaptor-plugin.xml (working copy) @@ -1,16 +0,0 @@ - - jmx-adaptor-plugin - - jar - - false - - - target/classes - / - - org/jboss/jmx/** - - - - \ No newline at end of file Index: server/src/assembly/jmx-invoker-adaptor-client.xml =================================================================== --- server/src/assembly/jmx-invoker-adaptor-client.xml (revision 104473) +++ server/src/assembly/jmx-invoker-adaptor-client.xml (working copy) @@ -1,18 +0,0 @@ - - jmx-invoker-adaptor-client - - jar - - false - - - target/classes - / - - org/jboss/jmx/adaptor/rmi/RMIAdaptor* - org/jboss/jmx/adaptor/rmi/RMINotificationListener* - org/jboss/jmx/connector/invoker/client/** - - - - \ No newline at end of file Index: server/src/main/java/org/jboss/jmx/adaptor/rmi/RMIAdaptor.java =================================================================== --- server/src/main/java/org/jboss/jmx/adaptor/rmi/RMIAdaptor.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/adaptor/rmi/RMIAdaptor.java (working copy) @@ -1,74 +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.jmx.adaptor.rmi; - -import java.rmi.Remote; -import java.rmi.RemoteException; - -import javax.management.ObjectName; -import javax.management.NotificationFilter; -import javax.management.InstanceNotFoundException; -import javax.management.ListenerNotFoundException; -import javax.management.MBeanServerConnection; - -/** - * RMI Interface for the server side Connector which - * is nearly the same as the MBeanServer Interface but - * has an additional RemoteException. - * - * @version $Revision$ - * @author Rickard Oberg - * @author Andreas Schaefer - * @author Jason Dillon - */ -public interface RMIAdaptor - extends Remote, MBeanServerConnection -{ - /** - * - * @param name - * @param listener - * @param filter - * @param handback - * @throws InstanceNotFoundException - * @throws RemoteException - */ - void addNotificationListener(ObjectName name, - RMINotificationListener listener, - NotificationFilter filter, - Object handback) - throws InstanceNotFoundException, - RemoteException; - - /** - * - * @param name - * @param listener - * @throws InstanceNotFoundException - * @throws ListenerNotFoundException - * @throws RemoteException - */ - void removeNotificationListener(ObjectName name, RMINotificationListener listener) - throws InstanceNotFoundException, - ListenerNotFoundException, - RemoteException; -} Index: server/src/main/java/org/jboss/jmx/adaptor/rmi/RMIAdaptorExt.java =================================================================== --- server/src/main/java/org/jboss/jmx/adaptor/rmi/RMIAdaptorExt.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/adaptor/rmi/RMIAdaptorExt.java (working copy) @@ -1,70 +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.jmx.adaptor.rmi; - -import java.rmi.Remote; -import java.rmi.RemoteException; -import javax.management.ObjectName; -import javax.management.NotificationFilter; -import javax.management.InstanceNotFoundException; -import javax.management.ListenerNotFoundException; -import javax.management.MBeanServerConnection; - -/** An RMI interface extension of the standard MBeanServerConnection - * - * @see javax.management.MBeanServerConnection - * - * @version $Revision$ - * @author Scott.Stark@jboss.org - */ -public interface RMIAdaptorExt - extends Remote, MBeanServerConnection -{ - /** - * - * @param name - * @param listener - * @param filter - * @param handback - * @throws InstanceNotFoundException - * @throws RemoteException - */ - void addNotificationListener(ObjectName name, - RMINotificationListener listener, - NotificationFilter filter, - Object handback) - throws InstanceNotFoundException, - RemoteException; - - /** - * - * @param name - * @param listener - * @throws InstanceNotFoundException - * @throws ListenerNotFoundException - * @throws RemoteException - */ - void removeNotificationListener(ObjectName name, RMINotificationListener listener) - throws InstanceNotFoundException, - ListenerNotFoundException, - RemoteException; -} Index: server/src/main/java/org/jboss/jmx/adaptor/rmi/RMINotificationListener.java =================================================================== --- server/src/main/java/org/jboss/jmx/adaptor/rmi/RMINotificationListener.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/adaptor/rmi/RMINotificationListener.java (working copy) @@ -1,37 +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.jmx.adaptor.rmi; - -import java.rmi.Remote; -import java.rmi.RemoteException; -import javax.management.Notification; - -/** An RMIfied version of the javax.management.NotificationListener. - * - * @author Scott.Stark@jboss.org - * @version $Revision$ - */ -public interface RMINotificationListener extends Remote -{ - public void handleNotification(Notification notification, Object handback) - throws RemoteException; -} Index: server/src/main/java/org/jboss/jmx/adaptor/rmi/NotificationListenerDelegate.java =================================================================== --- server/src/main/java/org/jboss/jmx/adaptor/rmi/NotificationListenerDelegate.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/adaptor/rmi/NotificationListenerDelegate.java (working copy) @@ -1,57 +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.jmx.adaptor.rmi; - -import javax.management.Notification; -import javax.management.NotificationListener; -import org.jboss.logging.Logger; - -/** - * @author Scott.Stark@jboss.org - * @version $Revision$ - */ -public class NotificationListenerDelegate - implements NotificationListener -{ - private static Logger log = Logger.getLogger(NotificationListenerDelegate.class); - /** */ - private RMINotificationListener client; - - public NotificationListenerDelegate(RMINotificationListener client) - { - this.client = client; - } - - public void handleNotification(Notification notification, - Object handback) - { - try - { - log.info("Sending notification to client, event:"+notification); - client.handleNotification(notification, handback); - } - catch(Throwable t) - { - log.warn("Failed to notify client", t); - } - } -} Index: server/src/main/java/org/jboss/jmx/adaptor/rmi/RMIRemoteMBeanProxy.java =================================================================== --- server/src/main/java/org/jboss/jmx/adaptor/rmi/RMIRemoteMBeanProxy.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/adaptor/rmi/RMIRemoteMBeanProxy.java (working copy) @@ -1,158 +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.jmx.adaptor.rmi; - -import java.io.Serializable; -import java.lang.reflect.InvocationHandler; -import javax.management.ObjectName; -import javax.naming.InitialContext; - - -/** - * A factory for producing MBean proxies that run on a distant node and access - * the server through RMI. Most of the code comes from MBeanProxy. - * - * @version $Revision$ - * @author Sacha Labourey. - */ -public class RMIRemoteMBeanProxy - implements Serializable, InvocationHandler -{ - /** The server to proxy invoke calls to. */ - private final RMIAdaptor remoteServer; - - /** The name of the object to invoke. */ - private final ObjectName name; - - /** - * Construct a MBeanProxy. - */ - - RMIRemoteMBeanProxy (final ObjectName name, final javax.management.MBeanServer server) throws Exception - { - this.name = name; - this.remoteServer = getRmiAdaptor (); - } - - /** Used when args is null. */ - private static final Object EMPTY_ARGS[] = {}; - - /** - * Invoke the configured MBean via the target MBeanServer and decode - * any resulting JMX exceptions that are thrown. - */ - public Object invoke (final Object proxy, final java.lang.reflect.Method method, final Object[] args) throws Throwable - { - String methodName = method.getName(); - - // Get attribute - if (methodName.startsWith("get") && args == null) - { - String attrName = methodName.substring(3); - return remoteServer.getAttribute(name, attrName); - } - - // Is attribute - else if (methodName.startsWith("is") && args == null) - { - String attrName = methodName.substring(2); - return remoteServer.getAttribute(name, attrName); - } - - // Set attribute - else if (methodName.startsWith("set") && args != null && args.length == 1) - { - String attrName = methodName.substring(3); - remoteServer.setAttribute(name, new javax.management.Attribute(attrName, args[0])); - return null; - } - - // Operation - - // convert the parameter types to strings for JMX - Class[] types = method.getParameterTypes(); - String[] sig = new String[types.length]; - for (int i = 0; i < types.length; i++) { - sig[i] = types[i].getName(); - } - - // invoke the server and decode JMX exceptions - return remoteServer.invoke(name, methodName, args == null ? EMPTY_ARGS : args, sig); - } - - protected RMIAdaptor getRmiAdaptor () throws Exception - { - InitialContext ctx = new InitialContext(); - return (RMIAdaptor) ctx.lookup("jmx/invoker/RMIAdaptor"); - } - - - /////////////////////////////////////////////////////////////////////////// - // MBeanProxyInstance // - /////////////////////////////////////////////////////////////////////////// - - public final ObjectName getMBeanProxyObjectName() - { - return name; - } - - public final RMIAdaptor getMBeanProxyRMIAdaptor() - { - return remoteServer; - } - - - /////////////////////////////////////////////////////////////////////////// - // Factory Methods // - /////////////////////////////////////////////////////////////////////////// - - /** - * Create an MBean proxy. - * - * @param intf The interface which the proxy will implement. - * @param name A string used to construct the ObjectName of the - * MBean to proxy to. - * @param server The MBeanServer that contains the MBean to proxy to. - * @return A MBean proxy. - * - * @throws Exception Invalid object name. - */ - public static Object create (final Class intf, final String name, final javax.management.MBeanServer server) throws Exception - { - return create(intf, new ObjectName(name), server); - } - - /** - * Create an MBean proxy. - * - * @param intf The interface which the proxy will implement. - * @param name The name of the MBean to proxy invocations to. - * @param server The MBeanServer that contains the MBean to proxy to. - * @return A MBean proxy. - */ - public static Object create (final Class intf, final ObjectName name, final javax.management.MBeanServer server) throws Exception - { - return java.lang.reflect.Proxy.newProxyInstance(Thread.currentThread ().getContextClassLoader (), - new Class[] { intf }, - new RMIRemoteMBeanProxy(name, server)); - } -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/AuthorizationInterceptor.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/AuthorizationInterceptor.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/AuthorizationInterceptor.java (working copy) @@ -1,167 +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.jmx.connector.invoker; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.UndeclaredThrowableException; -import java.security.Principal; -import javax.management.ObjectName; -import javax.security.auth.Subject; - -import org.jboss.mx.interceptor.AbstractInterceptor; -import org.jboss.mx.interceptor.Interceptor; -import org.jboss.mx.server.Invocation; - -/** - * An Interceptor that aids in providing Authorization to JMX Invocations - * at an MBean Operations level. This must be placed after the - * AuthenticationInterceptor to ensure a valid caller context exists - * - * String msg = "Define your own class which has a method authorize with signature"; - msg += "public void authorize( Principal caller, Subject subject, - String objectname,String opname)"; - msg += ". And replace " + azclassname + " its name"; - - * @see AuthenticationInterceptor - * - * @author Anil Saldhana - * @author Scott.Stark@jboss.org - * @version $Revision$ - */ -public class AuthorizationInterceptor extends AbstractInterceptor -{ - private Object authenticator = null; - private Method authorize; - - public AuthorizationInterceptor() - { - super(); - // Install the default - try - { - setAuthorizingClass(RolesAuthorization.class); - } - catch(Exception e) - { - // Can't happen - } - } - - /** - * The Authorizing class must have a method called - * public Boolean authorize( Principal caller, String mbean,String opname ) - * - * @param clazz - */ - public void setAuthorizingClass(Class clazz) - throws Exception - { - authenticator = clazz.newInstance(); - log.debug("Loaded authenticator: "+authenticator); - Class[] sig = {Principal.class, Subject.class, String.class, String.class}; - authorize = clazz.getMethod("authorize", sig); - log.debug("Found authorize(Principal, Subject, String, String)"); - } - - /** - * Intercept the invoke(Invocation) operations - * @param invocation - * @return - * @throws Throwable - */ - public Object invoke(Invocation invocation) throws Throwable - { - String type = invocation.getType(); - if (type == Invocation.OP_INVOKE) - { - String opName = invocation.getName(); - if (opName.equals("invoke")) - { - Object[] args = invocation.getArgs(); - org.jboss.invocation.Invocation inv = (org.jboss.invocation.Invocation) args[0]; - // Authenticate the caller based on the security association - Principal caller = inv.getPrincipal(); - //Get the Method Name - Object[] obj = inv.getArguments(); - //Ignore calls like MBeanCount or getMBeanInfo - if(obj != null && obj.length > 1) - { - ObjectName objname = (ObjectName) obj[0]; - String opname = (String) obj[1]; - - try - { - checkAuthorization(caller, objname.getCanonicalName(), opname); - } - catch(SecurityException e) - { - throw e; - } - catch(Exception e) - { - String msg = "Failed to authorize principal=" + caller - + ",MBean=" + objname + ", Operation=" + opname; - SecurityException ex = new SecurityException(msg); - ex.initCause(e); - throw ex; - } - } - } - } - - Interceptor i = invocation.nextInterceptor(); - return i.invoke(invocation); - } - - /** - * Method that delegates authorization to the custom class - * - * @param caller - * @param objname - * @param opname - * @throws Exception - A SecurityException on authorization failure - */ - private void checkAuthorization(Principal caller, String objname, String opname) - throws Exception - { - // Get the active Subject - Subject subject = SecurityActions.getActiveSubject(); - if( subject == null ) - throw new SecurityException("No active Subject found, add th AuthenticationInterceptor"); - - //We will try to use the authorizing class - try - { - Object[] args = {caller, subject, objname, opname}; - authorize.invoke(authenticator, args); - } - catch(InvocationTargetException e) - { - Throwable t = e.getTargetException(); - if( t instanceof Exception ) - throw (Exception) t; - else - throw new UndeclaredThrowableException(t); - } - } -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/ExternalizableRolesAuthorization.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/ExternalizableRolesAuthorization.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/ExternalizableRolesAuthorization.java (working copy) @@ -1,88 +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.jmx.connector.invoker; - -import java.util.HashSet; -import java.util.Properties; -import java.util.StringTokenizer; - -import org.jboss.logging.Logger; -import org.jboss.security.SimplePrincipal; - -//$Id$ - -/** - * JBAS-3203: Delegate for Authorization Interceptor for RMIAdaptor should have roles configurable - * Authorization Delegate used by the AuthorizationInterceptor - * that gets its predefined roles from a properties file - * @see org.jboss.jmx.connector.invoker.AuthorizationInterceptor - * @author Anil Saldhana - * @since May 10, 2006 - * @version $Revision$ - */ -public class ExternalizableRolesAuthorization extends RolesAuthorization -{ - private static Logger log = Logger.getLogger(ExternalizableRolesAuthorization.class); - private boolean trace = log.isTraceEnabled(); - - public ExternalizableRolesAuthorization() - { - //Load the roles from a properties file - Properties props = new Properties(); - try - { - props.load(getTCL().getResourceAsStream("jmxinvoker-roles.properties")); - this.setRequiredRoles(getSetOfRoles(props.getProperty("roles"))); - } - catch (Exception e) - { - log.error("Error reading roles from jmxinvoker-roles.properties:",e); - } - } - - /** - * Get a HashSet of roles as SimplePrincipal - * - * @param assignedRoles a comma seperated list of roles - * @return - */ - private HashSet getSetOfRoles(String assignedRoles) - { - if(trace) - log.trace("AssignedRolesString="+assignedRoles); - HashSet set = new HashSet(); - StringTokenizer st = new StringTokenizer(assignedRoles,","); - while(st.hasMoreTokens()) - { - String aRole = st.nextToken(); - set.add(new SimplePrincipal(aRole)); - } - if(trace) - log.trace("roles set="+set); - return set; - } - - private ClassLoader getTCL() - { - return Thread.currentThread().getContextClassLoader(); - } -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/MBeanProxyRemote.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/MBeanProxyRemote.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/MBeanProxyRemote.java (working copy) @@ -1,77 +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.jmx.connector.invoker; - -import javax.management.MBeanServerConnection; -import javax.management.ObjectName; - -import org.jboss.deployment.DeploymentException; -import org.jboss.mx.util.MBeanProxyExt; -import org.jboss.system.ServiceMBeanSupport; - -/** - * MBeanProxyRemote. - * - * @author Adrian Brock - * @version $Revision$ - */ -public class MBeanProxyRemote extends ServiceMBeanSupport implements MBeanProxyRemoteMBean -{ - /** The mbeanServer connection */ - private ObjectName mbeanServerConnection; - - /** - * Get the mbeanServerConnection. - * - * @return the mbeanServerConnection. - */ - public ObjectName getMBeanServerConnection() - { - return mbeanServerConnection; - } - - /** - * Set the mbeanServerConnection. - * - * @param mbeanServerConnection the mbeanServerConnection. - */ - public void setMBeanServerConnection(ObjectName mbeanServerConnection) - { - this.mbeanServerConnection = mbeanServerConnection; - } - - protected void startService() throws Exception - { - if (MBeanProxyExt.remote != null) - throw new IllegalStateException("Remote MBeanServerConnection is already set " + MBeanProxyExt.remote); - - Object o = server.getAttribute(mbeanServerConnection, "Proxy"); - if (o instanceof MBeanServerConnection == false) - throw new DeploymentException(mbeanServerConnection + " does not define an MBeanServerConnection"); - MBeanProxyExt.remote = (MBeanServerConnection) o; - } - - protected void stopService() throws Exception - { - MBeanProxyExt.remote = null; - } -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/MBeanProxyRemoteMBean.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/MBeanProxyRemoteMBean.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/MBeanProxyRemoteMBean.java (working copy) @@ -1,49 +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.jmx.connector.invoker; - -import javax.management.ObjectName; - -import org.jboss.system.ServiceMBean; - -/** - * MBeanProxyRemoteMBean. - * - * @author Adrian Brock - * @version $Revision$ - */ -public interface MBeanProxyRemoteMBean extends ServiceMBean -{ - /** - * Get the mbeanServerConnection. - * - * @return the mbeanServerConnection. - */ - ObjectName getMBeanServerConnection(); - - /** - * Set the mbeanServerConnection. - * - * @param mbeanServerConnection the mbeanServerConnection. - */ - void setMBeanServerConnection(ObjectName mbeanServerConnection); -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/RolesAuthorization.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/RolesAuthorization.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/RolesAuthorization.java (working copy) @@ -1,85 +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.jmx.connector.invoker; - -import java.util.HashSet; -import java.util.Set; -import java.util.Iterator; -import java.security.Principal; -import java.security.acl.Group; - -import javax.security.auth.Subject; - -import org.jboss.security.SimplePrincipal; - -/** A default authorization delegate used by the AuthorizationInterceptor. This - * looks for a hard coded JBossAdmin role in the current authenticated Subject. - * - * @author Scott.Stark@jboss.org - * @version $Revision$ - */ -public class RolesAuthorization -{ - private HashSet requiredRoles = new HashSet(); - - public RolesAuthorization() - { - requiredRoles.add(new SimplePrincipal("JBossAdmin")); - } - public void setRequiredRoles(HashSet requiredRoles) - { - this.requiredRoles = requiredRoles; - } - public void authorize(Principal caller, Subject subject, - String objectname, String opname) - { - Set groups = subject.getPrincipals(Group.class); - Group roles = null; - Iterator iter = groups.iterator(); - while( iter.hasNext() ) - { - Group grp = (Group) iter.next(); - if( grp.getName().equals("Roles") ) - { - roles = grp; - break; - } - } - if( roles == null ) - { - throw new SecurityException("Subject has no Roles"); - } - - iter = requiredRoles.iterator(); - boolean hasRole = false; - while( iter.hasNext() && hasRole == false ) - { - Principal p = (Principal) iter.next(); - hasRole = roles.isMember(p); - } - if( hasRole == false ) - { - throw new SecurityException("Authorization failure, requiredRoles="+requiredRoles - +", callerRoles="+roles); - } - } -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/SerializableInterceptor.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/SerializableInterceptor.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/SerializableInterceptor.java (working copy) @@ -1,100 +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.jmx.connector.invoker; - -import org.jboss.invocation.MarshalledInvocation; -import org.jboss.mx.interceptor.AbstractInterceptor; -import org.jboss.mx.server.Invocation; - -/** - * An interceptor that validates the Serializability of responses, - * using plugable policies. - * - * @author Dimitris Andreadis - * @author Fabiano C. de Oliveira - * @version $Revision$ - */ -public class SerializableInterceptor extends AbstractInterceptor -{ - /** The plugable policy to use */ - private SerializablePolicy policy = new NoopPolicy(); - - /** - * Configure a SerializablePolicy class - */ - public void setPolicyClass(String policyClass) throws Exception - { - try - { - // try to load the policy Class - Class clazz = Thread.currentThread().getContextClassLoader().loadClass(policyClass); - policy = (SerializablePolicy)clazz.newInstance(); - } - catch (Exception e) // ClassNotFoundException, IllegalAccessException, InstantiationException - { - // policy class not found. Make a second try using - // the 'org.jboss.jmx.connector.invoker.serializablepolicy.' package prefix - // for the "standard" reponse policies provided with jboss. - // If that fails, too, rethrow the original exception. - try - { - policyClass = "org.jboss.jmx.connector.invoker.serializablepolicy." + policyClass; - Class clazz = Thread.currentThread().getContextClassLoader().loadClass(policyClass); - policy = (SerializablePolicy)clazz.newInstance(); - } - catch (Exception inner) - { - throw e; - } - } - } - - public Object invoke(Invocation invocation) throws Throwable - { - // Invoke the next in the sequence - Object result = invocation.nextInterceptor().invoke(invocation); - - // If the invocation was an 'invoke(MarshalledInvocation)' - // filter the result using the plugable policy - if ("invoke".equals(invocation.getName())) - { - Object[] args = invocation.getArgs(); - if ((args.length == 1) && (args[0] instanceof MarshalledInvocation)) - { - MarshalledInvocation mi = (MarshalledInvocation) args[0]; - result = policy.filter(mi, result); - } - } - return result; - } - - /** - * A noop serializable policy - */ - public class NoopPolicy implements SerializablePolicy - { - public Object filter(MarshalledInvocation input, Object result) throws Throwable - { - return result; - } - } -} \ No newline at end of file Index: server/src/main/java/org/jboss/jmx/connector/invoker/serializablepolicy/StripModelMBeanInfoPolicy.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/serializablepolicy/StripModelMBeanInfoPolicy.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/serializablepolicy/StripModelMBeanInfoPolicy.java (working copy) @@ -1,73 +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.jmx.connector.invoker.serializablepolicy; - -import javax.management.MBeanAttributeInfo; -import javax.management.MBeanInfo; -import javax.management.modelmbean.ModelMBeanInfo; - -import org.jboss.invocation.MarshalledInvocation; -import org.jboss.jmx.connector.invoker.SerializablePolicy; - -/** - * A policy that converts ModelMBeanInfo to MBeanInfo. - * - * @author Dimitris Andreadis - * @author Fabiano C. de Oliveira - * @version $Revision$ - */ -public class StripModelMBeanInfoPolicy implements SerializablePolicy -{ - public Object filter(MarshalledInvocation input, Object result) throws Throwable - { - if ("getMBeanInfo".equals(input.getMethod().getName()) && (result instanceof ModelMBeanInfo)) - { - MBeanInfo info = (MBeanInfo)result; - - result = new MBeanInfo( - info.getClassName(), - info.getDescription(), - deepCopy(info.getAttributes()), // Strip the Descriptors - info.getConstructors(), - info.getOperations(), - info.getNotifications()); - } - return result; - } - - private MBeanAttributeInfo[] deepCopy(MBeanAttributeInfo[] attrs) - { - MBeanAttributeInfo[] copy = new MBeanAttributeInfo[attrs.length]; - for (int i = 0; i < attrs.length; i++) - { - MBeanAttributeInfo attr = attrs[i]; - copy[i] = new MBeanAttributeInfo( - attr.getName(), - attr.getType(), - attr.getDescription(), - attr.isReadable(), - attr.isWritable(), - attr.isIs()); - } - return copy; - } -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/SerializablePolicy.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/SerializablePolicy.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/SerializablePolicy.java (working copy) @@ -1,36 +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.jmx.connector.invoker; - -import org.jboss.invocation.MarshalledInvocation; - -/** - * A serializable policy that filters results to avoid Serialization problems. - * - * @author Dimitris Andreadis - * @author Fabiano C. de Oliveira - * @version $Revision$ - */ -public interface SerializablePolicy -{ - public Object filter(MarshalledInvocation input, Object result) throws Throwable; -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/SecurityActions.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/SecurityActions.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/SecurityActions.java (working copy) @@ -1,234 +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.jmx.connector.invoker; - -import java.security.AccessController; -import java.security.Principal; -import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; - -import javax.security.auth.Subject; - -import org.jboss.security.SecurityAssociation; -import org.jboss.security.SecurityContext; -import org.jboss.security.SecurityContextFactory; -import org.jboss.security.SecurityContextAssociation; - -/** Common PrivilegedAction used by classes in this package. - * - * @author Scott.Stark@jboss.org - * @author Anil.Saldhana@redhat.com - * @version $Revison:$ - */ -class SecurityActions -{ - private static class GetSubjectAction implements PrivilegedAction - { - static PrivilegedAction ACTION = new GetSubjectAction(); - public Object run() - { - Subject subject = SecurityAssociation.getSubject(); - return subject; - } - } - private static class GetTCLAction implements PrivilegedAction - { - static PrivilegedAction ACTION = new GetTCLAction(); - public Object run() - { - ClassLoader loader = Thread.currentThread().getContextClassLoader(); - return loader; - } - } - private static class SetTCLAction implements PrivilegedAction - { - ClassLoader loader; - SetTCLAction(ClassLoader loader) - { - this.loader = loader; - } - public Object run() - { - Thread.currentThread().setContextClassLoader(loader); - loader = null; - return null; - } - } - interface PrincipalInfoAction - { - PrincipalInfoAction PRIVILEGED = new PrincipalInfoAction() - { - public void push(final Principal principal, final Object credential, - final Subject subject) - { - AccessController.doPrivileged( - new PrivilegedAction() - { - public Object run() - { - //SecurityAssociation.pushSubjectContext(subject, principal, credential); - getSecurityContext().getUtil().createSubjectInfo(principal, credential, subject); - return null; - } - } - ); - } - public void pop() - { - AccessController.doPrivileged( - new PrivilegedAction() - { - public Object run() - { - //SecurityAssociation.popSubjectContext(); - SecurityContext sc = getSecurityContext(); - if(sc != null) - { - sc.getUtil().createSubjectInfo(null, null, null); - } - return null; - } - } - ); - } - }; - - PrincipalInfoAction NON_PRIVILEGED = new PrincipalInfoAction() - { - public void push(Principal principal, Object credential, Subject subject) - { - //SecurityAssociation.pushSubjectContext(subject, principal, credential); - getSecurityContext().getUtil().createSubjectInfo(principal, credential, subject); - } - public void pop() - { - //SecurityAssociation.popSubjectContext(); - SecurityContext sc = getSecurityContext(); - if(sc != null) - { - sc.getUtil().createSubjectInfo(null, null, null); - } - } - }; - - void push(Principal principal, Object credential, Subject subject); - void pop(); - } - - static class SetSecurityContextAction implements PrivilegedAction - { - private SecurityContext securityContext; - - SetSecurityContextAction(SecurityContext sc) - { - this.securityContext = sc; - } - - public Object run() - { - SecurityContextAssociation.setSecurityContext(securityContext); - return null; - } - } - - static Subject getActiveSubject() - { - Subject subject = (Subject) AccessController.doPrivileged(GetSubjectAction.ACTION); - return subject; - } - static ClassLoader getContextClassLoader() - { - ClassLoader loader = (ClassLoader) AccessController.doPrivileged(GetTCLAction.ACTION); - return loader; - } - static void setContextClassLoader(ClassLoader loader) - { - PrivilegedAction action = new SetTCLAction(loader); - AccessController.doPrivileged(action); - } - - static void pushSubjectContext(Principal principal, Object credential, - Subject subject) - { - if(System.getSecurityManager() == null) - { - PrincipalInfoAction.NON_PRIVILEGED.push(principal, credential, subject); - } - else - { - PrincipalInfoAction.PRIVILEGED.push(principal, credential, subject); - } - } - static void popSubjectContext() - { - if(System.getSecurityManager() == null) - { - PrincipalInfoAction.NON_PRIVILEGED.pop(); - } - else - { - PrincipalInfoAction.PRIVILEGED.pop(); - } - } - - static SecurityContext createSecurityContext(final String domain) - throws PrivilegedActionException - { - return (SecurityContext)AccessController.doPrivileged( new PrivilegedExceptionAction() - { - - public Object run() throws Exception - { - return SecurityContextFactory.createSecurityContext(domain); - }}); - } - - static SecurityContext getSecurityContext() - { - return (SecurityContext)AccessController.doPrivileged( new PrivilegedAction() - { - - public Object run() - { - return SecurityContextAssociation.getSecurityContext(); - }}); - } - - - static void clearSecurityContext() - { - AccessController.doPrivileged(new PrivilegedAction(){ - - public Object run() - { - SecurityContextAssociation.clearSecurityContext(); - return null; - }}); - } - - static void setSecurityContext(SecurityContext sc) - { - SetSecurityContextAction action = new SetSecurityContextAction(sc); - AccessController.doPrivileged(action); - } -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/InvokerAdaptorService.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/InvokerAdaptorService.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/InvokerAdaptorService.java (working copy) @@ -1,365 +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.jmx.connector.invoker; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.UndeclaredThrowableException; -import java.rmi.RemoteException; -import java.security.Principal; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; - -import javax.management.InstanceNotFoundException; -import javax.management.ListenerNotFoundException; -import javax.management.MBeanServer; -import javax.management.Notification; -import javax.management.NotificationFilter; -import javax.management.NotificationListener; -import javax.management.ObjectName; - -import org.jboss.invocation.Invocation; -import org.jboss.invocation.MarshalledInvocation; -import org.jboss.jmx.adaptor.rmi.RMINotificationListener; -import org.jboss.jmx.connector.invoker.client.InvokerAdaptorException; -import org.jboss.security.SecurityConstants; -import org.jboss.security.SecurityContext; -import org.jboss.system.Registry; -import org.jboss.system.ServiceMBeanSupport; - -/** - * A JBoss service exposes an invoke(Invocation) operation that maps - * calls to the ExposedInterface onto the MBeanServer this service - * is registered with. It is used in conjunction with a proxy factory - * to expose the MBeanServer to remote clients through arbitrary - * protocols.

- * - * It sets up the correct classloader before unmarshalling the - * arguments, this relies on the ObjectName being seperate from - * from the other method arguments to avoid unmarshalling them - * before the classloader is determined from the ObjectName.

- * - * The interface is configurable, it must be similar to MBeanServer, - * though not necessarily derived from it

- * - * The invoker is configurable and must be specified - * - * @author Adrian Brock - * @author Scott.Stark@jboss.org - * @version $Revision$ - * - * @jmx:mbean name="jboss.jmx:type=adaptor,protocol=INVOKER" - * extends="org.jboss.system.ServiceMBean" - **/ -public class InvokerAdaptorService - extends ServiceMBeanSupport - implements InvokerAdaptorServiceMBean -{ - /** */ - private Map marshalledInvocationMapping = new HashMap(); - /** */ - private Class[] exportedInterfaces; - /** A HashSet addNotificationListener methods */ - private HashSet addNotificationListeners = new HashSet(); - /** A HashSet removeNotificationListener methods */ - private HashSet removeNotificationListeners = new HashSet(); - /** A HashSet for the - registered listeners */ - protected HashMap remoteListeners = new HashMap(); - - public InvokerAdaptorService() - { - } - - /** - * @jmx:managed-attribute - */ - public Class[] getExportedInterfaces() - { - return exportedInterfaces; - } - /** - * @jmx:managed-attribute - */ - public void setExportedInterfaces(Class[] exportedInterfaces) - { - this.exportedInterfaces = exportedInterfaces; - } - - protected void startService() - throws Exception - { - // Build the interface method map - HashMap tmpMap = new HashMap(61); - for(int n = 0; n < exportedInterfaces.length; n ++) - { - Class iface = exportedInterfaces[n]; - Method[] methods = iface.getMethods(); - for(int m = 0; m < methods.length; m ++) - { - Method method = methods[m]; - Long hash = new Long(MarshalledInvocation.calculateHash(method)); - tmpMap.put(hash, method); - } - /* Look for a void addNotificationListener(ObjectName name, - RMINotificationListener listener, NotificationFilter filter, - Object handback) - */ - try - { - Class[] sig = {ObjectName.class, RMINotificationListener.class, - NotificationFilter.class, Object.class}; - Method addNotificationListener = iface.getMethod( - "addNotificationListener", sig); - addNotificationListeners.add(addNotificationListener); - } - catch(Exception e) - { - log.debug(iface+"No addNotificationListener(ObjectName, RMINotificationListener)"); - } - - /* Look for a void removeNotificationListener(ObjectName, - RMINotificationListener) - */ - try - { - Class[] sig = {ObjectName.class, RMINotificationListener.class}; - Method removeNotificationListener = iface.getMethod( - "removeNotificationListener", sig); - removeNotificationListeners.add(removeNotificationListener); - } - catch(Exception e) - { - log.debug(iface+"No removeNotificationListener(ObjectName, RMINotificationListener)"); - } - } - marshalledInvocationMapping = Collections.unmodifiableMap(tmpMap); - - // Place our ObjectName hash into the Registry so invokers can resolve it - Registry.bind(new Integer(serviceName.hashCode()), serviceName); - } - - protected void stopService() - throws Exception - { - // Remove the method hashses - if( exportedInterfaces != null ) - { - for(int n = 0; n < exportedInterfaces.length; n ++) - MarshalledInvocation.removeHashes(exportedInterfaces[n]); - } - marshalledInvocationMapping = null; - remoteListeners.clear(); - Registry.unbind(new Integer(serviceName.hashCode())); - } - - /** - * Expose the service interface mapping as a read-only attribute - * - * @jmx:managed-attribute - * - * @return A Map of the MBeanServer - */ - public Map getMethodMap() - { - return marshalledInvocationMapping; - } - - /** - * Expose the MBeanServer service via JMX to invokers. - * - * @jmx:managed-operation - * - * @param invocation A pointer to the invocation object - * @return Return value of method invocation. - * - * @throws Exception Failed to invoke method. - */ - public Object invoke(Invocation invocation) - throws Exception - { - try - { - // Make sure we have the correct classloader before unmarshalling - ClassLoader oldCL = SecurityActions.getContextClassLoader(); - - ClassLoader newCL = null; - // Get the MBean this operation applies to - ObjectName objectName = (ObjectName) invocation.getValue("JMX_OBJECT_NAME"); - if (objectName != null) - { - newCL = server.getClassLoaderFor(objectName); - } - - if (newCL != null && newCL != oldCL) - SecurityActions.setContextClassLoader(newCL); - - //JBAS-6449: Cache the incoming security context to be retained on exit - SecurityContext previousSecurityContext = SecurityActions.getSecurityContext(); - - try - { - // Set the method hash to Method mapping - if (invocation instanceof MarshalledInvocation) - { - MarshalledInvocation mi = (MarshalledInvocation) invocation; - mi.setMethodMap(marshalledInvocationMapping); - } - // Invoke the MBeanServer method via reflection - Method method = invocation.getMethod(); - Object[] args = invocation.getArguments(); - Principal principal = invocation.getPrincipal(); - Object credential = invocation.getCredential(); - Object value = null; - SecurityContext sc = SecurityActions.createSecurityContext(SecurityConstants.DEFAULT_APPLICATION_POLICY); - SecurityActions.setSecurityContext(sc); - // Associate the method - SecurityActions.pushSubjectContext(principal, credential, null); - - try - { - if( addNotificationListeners.contains(method) ) - { - ObjectName name = (ObjectName) args[0]; - RMINotificationListener listener = (RMINotificationListener) - args[1]; - NotificationFilter filter = (NotificationFilter) args[2]; - Object handback = args[3]; - addNotificationListener(name, listener, filter, handback); - } - else if( removeNotificationListeners.contains(method) ) - { - ObjectName name = (ObjectName) args[0]; - RMINotificationListener listener = (RMINotificationListener) - args[1]; - removeNotificationListener(name, listener); - } - else - { - String name = method.getName(); - Class[] paramTypes = method.getParameterTypes(); - Method mbeanServerMethod = MBeanServer.class.getMethod(name, - paramTypes); - value = mbeanServerMethod.invoke(server, args); - } - } - catch(InvocationTargetException e) - { - Throwable t = e.getTargetException(); - if( t instanceof Exception ) - throw (Exception) t; - else - throw new UndeclaredThrowableException(t, method.toString()); - } - - return value; - } - finally - { - // Restore the input security context - SecurityActions.popSubjectContext(); - if(previousSecurityContext != null) - SecurityActions.setSecurityContext(previousSecurityContext); - else - SecurityActions.clearSecurityContext(); - // Restore the input class loader - if (newCL != null && newCL != oldCL) - SecurityActions.setContextClassLoader(oldCL); - } - } - catch (Throwable t) - { - throw new InvokerAdaptorException(t); - } - } - - public void addNotificationListener(ObjectName name, - RMINotificationListener listener, NotificationFilter filter, - Object handback) - throws InstanceNotFoundException, RemoteException - { - if( log.isTraceEnabled() ) - log.trace("addNotificationListener, name="+name+", listener="+listener); - NotificationListenerDelegate delegate = - new NotificationListenerDelegate(listener, name); - remoteListeners.put(listener, delegate); - getServer().addNotificationListener(name, delegate, filter, handback); - } - - public void removeNotificationListener(ObjectName name, - RMINotificationListener listener) - throws InstanceNotFoundException, ListenerNotFoundException, - RemoteException - { - if( log.isTraceEnabled() ) - log.trace("removeNotificationListener, name="+name+", listener="+listener); - NotificationListenerDelegate delegate = (NotificationListenerDelegate) - remoteListeners.remove(listener); - if( delegate == null ) - throw new ListenerNotFoundException("No listener matches: "+listener); - getServer().removeNotificationListener(name, delegate); - } - - private class NotificationListenerDelegate - implements NotificationListener - { - /** The remote client */ - private RMINotificationListener client; - /** The mbean the client is monitoring */ - private ObjectName targetName; - - public NotificationListenerDelegate(RMINotificationListener client, - ObjectName targetName) - { - this.client = client; - this.targetName = targetName; - } - - public void handleNotification(Notification notification, - Object handback) - { - try - { - if( log.isTraceEnabled() ) - { - log.trace("Sending notification to client, event:"+notification); - } - client.handleNotification(notification, handback); - } - catch(Throwable t) - { - log.debug("Failed to notify client, unregistering listener", t); - try - { - removeNotificationListener(targetName, client); - } - catch(Exception e) - { - log.debug("Failed to unregister listener", e); - } - } - } - } - -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/InvokerAdaptorServiceMBean.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/InvokerAdaptorServiceMBean.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/InvokerAdaptorServiceMBean.java (working copy) @@ -1,48 +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.jmx.connector.invoker; - -/** - * MBean interface. - */ -public interface InvokerAdaptorServiceMBean extends org.jboss.system.ServiceMBean { - - //default object name - public static final javax.management.ObjectName OBJECT_NAME = org.jboss.mx.util.ObjectNameFactory.create("jboss.jmx:type=adaptor,protocol=INVOKER"); - - java.lang.Class[] getExportedInterfaces() ; - - void setExportedInterfaces(java.lang.Class[] exportedInterfaces) ; - - /** - * Expose the service interface mapping as a read-only attribute - * @return A Map of the MBeanServer */ - java.util.Map getMethodMap() ; - - /** - * Expose the MBeanServer service via JMX to invokers. - * @param invocation A pointer to the invocation object - * @return Return value of method invocation. - * @throws Exception Failed to invoke method. */ - java.lang.Object invoke(org.jboss.invocation.Invocation invocation) throws java.lang.Exception; - -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/client/InvokerAdaptorClientInterceptor.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/client/InvokerAdaptorClientInterceptor.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/client/InvokerAdaptorClientInterceptor.java (working copy) @@ -1,100 +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.jmx.connector.invoker.client; - -import org.jboss.invocation.Invocation; -import org.jboss.invocation.PayloadKey; -import org.jboss.proxy.Interceptor; - -import javax.management.ObjectName; - -/** -* An Interceptor that plucks the object name out of the arguments -* into an unmarshalled part of the payload. -* -* @author Adrian Brock -* @version $Revision$ -*/ -public class InvokerAdaptorClientInterceptor - extends Interceptor -{ - // Constants ----------------------------------------------------- - - // Attributes ---------------------------------------------------- - - // Constructors -------------------------------------------------- - - public InvokerAdaptorClientInterceptor() - { - // For externalization to work - } - - // Public -------------------------------------------------------- - - /** - * Invoke using the invoker for remote invocations - */ - public Object invoke(Invocation invocation) - throws Throwable - { - // Retrieve any relevent object name for this invocation - ObjectName objectName = getObjectNameFromArguments(invocation); - if (objectName != null) - invocation.setValue("JMX_OBJECT_NAME", objectName, PayloadKey.AS_IS); - - try - { - return getNext().invoke(invocation); - } - catch (InvokerAdaptorException e) - { - throw e.getWrapped(); - } - } - - /** - * Return any target object name relevent for this invocation.

- * - * Methods that don't pass arguments that could be custom classes are ignored.

- * - * Classloading and registerMBean are ignored, - * they shouldn't be available remotely - */ - public ObjectName getObjectNameFromArguments(Invocation invocation) - { - String method = invocation.getMethod().getName(); - if (method.equals("invoke") || - method.equals("setAttribute") || - method.equals("setAttributes") || - method.equals("addNotificationListener") || - method.equals("removeNotificationListener")) - { - return (ObjectName) invocation.getArguments()[0]; - } - - return null; - } - - // Private ------------------------------------------------------- - - // Inner classes ------------------------------------------------- -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/client/InvokerAdaptorException.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/client/InvokerAdaptorException.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/client/InvokerAdaptorException.java (working copy) @@ -1,66 +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.jmx.connector.invoker.client; - -import java.io.Serializable; - -/** - * An exception for holding jmx exception so the invokers - * don't unwrap them. - * - * @author Adrian Brock - * @version $Revision$ - */ -public class InvokerAdaptorException extends Exception implements Serializable -{ - // Constants ----------------------------------------------------- - - private static final long serialVersionUID = 24842201105890823L; - - // Attributes ---------------------------------------------------- - - /** The wrapped exception */ - private Throwable wrapped; - - // Constructors -------------------------------------------------- - - public InvokerAdaptorException() - { - // For serialization - } - - public InvokerAdaptorException(Throwable wrapped) - { - this.wrapped = wrapped; - } - - // Public -------------------------------------------------------- - - public Throwable getWrapped() - { - return wrapped; - } - - // Private ------------------------------------------------------- - - // Inner classes ------------------------------------------------- -} Index: server/src/main/java/org/jboss/jmx/connector/invoker/AuthenticationInterceptor.java =================================================================== --- server/src/main/java/org/jboss/jmx/connector/invoker/AuthenticationInterceptor.java (revision 104473) +++ server/src/main/java/org/jboss/jmx/connector/invoker/AuthenticationInterceptor.java (working copy) @@ -1,133 +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.jmx.connector.invoker; - -import java.security.Principal; - -import javax.naming.InitialContext; -import javax.security.auth.Subject; - -import org.jboss.mx.interceptor.AbstractInterceptor; -import org.jboss.mx.interceptor.Interceptor; -import org.jboss.mx.server.Invocation; -import org.jboss.security.SecurityConstants; -import org.jboss.security.SecurityContext; -import org.jboss.security.SubjectSecurityManager; - -/** A security interceptor that requires an authorized user for invoke(Invocation) - * operation calls when the SecurityDomain and SecurityMgr attributes are - * specified. Access to attributes and the MBeanInfo are not intercepted. - * - * @see Interceptor - * - * @author Juha Lindfors. - * @author Scott.Stark@jboss.org - * @version $Revision$ - * - */ -public final class AuthenticationInterceptor extends AbstractInterceptor -{ - private SubjectSecurityManager securityMgr; - - private String securityDomain; - - private boolean initialized = false; - - public void setSecurityDomain(String securityDomain) throws Exception - { - this.securityDomain = securityDomain; - } - - /** - * - * @param invocation - * @return - * @throws Throwable - */ - public Object invoke(Invocation invocation) throws Throwable - { - SecurityContext previousSC = null; - String type = invocation.getType(); - Subject subject = null; - if (!initialized) - initialize(); - if (type == Invocation.OP_INVOKE && securityMgr != null) - { - String opName = invocation.getName(); - if (opName.equals("invoke")) - { - Object[] args = invocation.getArgs(); - org.jboss.invocation.Invocation inv = (org.jboss.invocation.Invocation) args[0]; - // Authenticate the caller based on the security association - Principal caller = inv.getPrincipal(); - Object credential = inv.getCredential(); - subject = new Subject(); - boolean isValid = securityMgr.isValid(caller, credential, subject); - if (isValid == false) - { - String msg = "Failed to authenticate principal=" + caller + ", securityDomain=" - + securityMgr.getSecurityDomain(); - throw new SecurityException(msg); - - } - String securityDomain = SecurityConstants.DEFAULT_APPLICATION_POLICY; - if (securityMgr != null) - securityDomain = securityMgr.getSecurityDomain(); - // store current security context - previousSC = SecurityActions.getSecurityContext(); - SecurityContext sc = SecurityActions.createSecurityContext(securityDomain); - SecurityActions.setSecurityContext(sc); - // Push the caller security context - SecurityActions.pushSubjectContext(caller, credential, subject); - } - } - - try - { - Interceptor i = invocation.nextInterceptor(); - return i.invoke(invocation); - } - finally - { - // restore previous security context - if (subject != null) - SecurityActions.setSecurityContext(previousSC); - } - } - - private void initialize() - { - try - { - InitialContext ctx = new InitialContext(); - securityMgr = (SubjectSecurityManager) ctx.lookup(securityDomain); - } - catch (Exception e) - { - - } - if (securityMgr == null) - log.warn("Unable to locate security domain " + securityDomain - + ". The AuthenticationInterceptor will have no effect"); - initialized = true; - } -} Index: server/src/main/java/org/jboss/jmx/package.html =================================================================== --- server/src/main/java/org/jboss/jmx/package.html (revision 104473) +++ server/src/main/java/org/jboss/jmx/package.html (working copy) @@ -1,44 +0,0 @@ - - - - - - - - -

Package description goes here. - -

Package Specification

- - -

Related Documentation

- - -

Package Status

-
    -
  • STABLE -
- - - - - - Index: server/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxy.java =================================================================== --- server/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxy.java (revision 104473) +++ server/src/main/java/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxy.java (working copy) @@ -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 Marc Fleury - * @author Scott Stark - * @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 null 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(); - } -} - Index: server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactory.java =================================================================== --- server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactory.java (revision 104473) +++ server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactory.java (working copy) @@ -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@jboss.org * @author Galder Zamarreno * @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()); Index: server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactoryMBean.java =================================================================== --- server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactoryMBean.java (revision 104473) +++ server/src/main/java/org/jboss/invocation/jrmp/server/JRMPProxyFactoryMBean.java (working copy) @@ -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 Index: server/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvoker.java =================================================================== --- server/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvoker.java (revision 104473) +++ server/src/main/java/org/jboss/invocation/jrmp/server/JRMPInvoker.java (working copy) @@ -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 Scott Stark - * @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 Transaction. - * - * @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; - } - } -} Index: server/src/resources/jmx-invoker-adaptor/META-INF/jboss-service.xml =================================================================== --- server/src/resources/jmx-invoker-adaptor/META-INF/jboss-service.xml (revision 104473) +++ server/src/resources/jmx-invoker-adaptor/META-INF/jboss-service.xml (working copy) @@ -1,117 +0,0 @@ - - - - - - - - - jboss:service=invoker,type=jrmp - - jboss.jmx:type=adaptor,name=Invoker - - jmx/invoker/RMIAdaptor - - org.jboss.jmx.adaptor.rmi.RMIAdaptor, - org.jboss.jmx.adaptor.rmi.RMIAdaptorExt - - - - org.jboss.proxy.ClientMethodInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor - org.jboss.invocation.InvokerInterceptor - - - jboss:service=Naming - - - - - jboss.jmx:type=adaptor,name=Invoker,protocol=jrmp,service=proxyFactory - - - - - - The JMX Detached Invoker Service - org.jboss.jmx.connector.invoker.InvokerAdaptorService - - - - The class name of the MBean - Name - java.lang.String - - - The status of the MBean - State - int - - - The status of the MBean in text form - StateString - java.lang.String - - - The interfaces the invoker proxy supports - ExportedInterfaces - [Ljava.lang.Class; - - - Map(Long hash, Method) of the proxy interface methods - MethodMap - java.util.Map - - - - The start lifecycle operation - start - - - The stop lifecycle operation - stop - - - The detyped lifecycle operation (for internal use only) - jbossInternalLifecycle - - The lifecycle operation - method - java.lang.String - - void - - - - The detached invoker entry point - invoke - - The method invocation context - invocation - org.jboss.invocation.Invocation - - java.lang.Object - - - - - - - - - - - - Index: server/src/etc/deploy/legacy-invokers-service.xml =================================================================== --- server/src/etc/deploy/legacy-invokers-service.xml (revision 104473) +++ server/src/etc/deploy/legacy-invokers-service.xml (working copy) @@ -2,29 +2,8 @@ - - - - - - - - - - - - - jboss:service=TransactionManager - - Index: server/pom.xml =================================================================== --- server/pom.xml (revision 104473) +++ server/pom.xml (working copy) @@ -92,8 +92,6 @@ src/assembly/client.xml src/assembly/jboss.xml src/assembly/jboss-minimal.xml - src/assembly/jmx-adaptor-plugin.xml - src/assembly/jmx-invoker-adaptor-client.xml Index: testsuite/local.properties =================================================================== --- testsuite/local.properties (revision 104473) +++ testsuite/local.properties (working copy) @@ -49,12 +49,12 @@ # (even at the same machine). Actually what we needed are just node0 and node1 # ips and the rest are optional. # -#node0=${env.MYTESTIP_1} +node0=${env.MYTESTIP_1} #node0.http.url=http://192.168.1.103:8080 #node0.jndiurl=jnp://192.168.1.103:1099 #node0.hajndi.url=jnp://192.168.1.103:1100 -#node1=${env.MYTESTIP_2} +node1=${env.MYTESTIP_2} #node1.http.url=http://192.168.1.113:8080 #node1.jndiurl=jnp://192.168.1.113:1099 #node1.hajndi.url=jnp://192.168.1.113:1100 Index: testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaMockUtils.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaMockUtils.java (revision 104473) +++ testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaMockUtils.java (working copy) @@ -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 Galder Zamarreno - */ -public class JRMPInvokerHaMockUtils -{ - /** - * Mock version of JRMPInvokerHA that eases debugging and swallows an - * exception being thrown when unregistering the invoker ha mbean. - * - * @author Galder Zamarreno - */ - 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); - } - } - -} Index: testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaTransactionStickyUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaTransactionStickyUnitTestCase.java (revision 104473) +++ testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaTransactionStickyUnitTestCase.java (working copy) @@ -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 Galder Zamarreno - */ -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 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(); - } -} Index: testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaUnitTestCase.java (revision 104473) +++ testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/JRMPInvokerHaUnitTestCase.java (working copy) @@ -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 Galder Zamarreno - */ -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"; - } - } -} Index: testsuite/src/main/org/jboss/test/binding/BindingServiceUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/binding/BindingServiceUnitTestCase.java (revision 104473) +++ testsuite/src/main/org/jboss/test/binding/BindingServiceUnitTestCase.java (working copy) @@ -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; Index: testsuite/src/resources/test-configs/jrmp-invoker/conf/standardjboss.xml =================================================================== --- testsuite/src/resources/test-configs/jrmp-invoker/conf/standardjboss.xml (revision 104473) +++ testsuite/src/resources/test-configs/jrmp-invoker/conf/standardjboss.xml (working copy) @@ -1,1111 +0,0 @@ - - - - - - - - - - - - true - - anonymous - - - - - entity-unified-invoker - jboss:service=invoker,type=jrmp - org.jboss.proxy.ejb.ProxyFactory - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.EntityInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.ListEntityInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - clustered-entity-rmi-invoker - jboss:service=invoker,type=jrmpha - org.jboss.proxy.ejb.ProxyFactoryHA - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.EntityInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.ListEntityInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - stateless-unified-invoker - jboss:service=invoker,type=jrmp - org.jboss.proxy.ejb.ProxyFactory - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.StatelessSessionInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - clustered-stateless-rmi-invoker - jboss:service=invoker,type=jrmpha - org.jboss.proxy.ejb.ProxyFactoryHA - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.StatelessSessionInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - stateful-unified-invoker - jboss:service=invoker,type=jrmp - org.jboss.proxy.ejb.ProxyFactory - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.StatefulSessionInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - clustered-stateful-rmi-invoker - jboss:service=invoker,type=jrmpha - org.jboss.proxy.ejb.ProxyFactoryHA - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.StatefulSessionInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.ejb.SecurityContextInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - message-driven-bean - default - org.jboss.ejb.plugins.jms.JMSContainerInvoker - - DefaultJMSProvider - StdJMSPool - false - - 1 - 15 - 30000 - 1 - - 10 - - queue/DLQ - 10 - 0 - - - - - - - - - singleton-message-driven-bean - default - org.jboss.ejb.plugins.jms.JMSContainerInvoker - - DefaultJMSProvider - StdJMSPool - false - - 1 - 1 - 30000 - 1 - - 10 - - queue/DLQ - 10 - 0 - - - - - - - message-inflow-driven-bean - default - org.jboss.ejb.plugins.inflow.JBossMessageEndpointFactory - - - org.jboss.proxy.ClientMethodInterceptor - org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - - - - - - iiop - jboss:service=invoker,type=iiop - org.jboss.proxy.ejb.IORFactory - - org.jboss.iiop.WebCL - per-servant - true - iiop - false - - - - - jms-message-inflow-driven-bean - default - org.jboss.ejb.plugins.inflow.JBossJMSMessageEndpointFactory - - - - providerAdapterJNDI - DefaultJMSProvider - - - minSession - 1 - - - maxSession - 15 - - - keepAlive - 60000 - - - maxMessages - 1 - - - reconnectInterval - 10 - - - useDLQ - true - - - DLQHandler - org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler - - - DLQJNDIName - queue/DLQ - - - DLQMaxResent - 10 - - - - org.jboss.proxy.ClientMethodInterceptor - org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - - - - - - - - - Standard Pessimistic CMP 2.x EntityBean - false - entity-unified-invoker - false - false - true - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.InvalidableEntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - B - - - - - cmp2.x jdbc2 pm - false - entity-unified-invoker - false - true - true - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - org.jboss.ejb.plugins.cmp.jdbc2.RelationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.PerTxEntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc2.JDBCStoreManager2 - org.jboss.ejb.plugins.lock.NoLock - - - 500 - 10000 - - - - 10 - - - - - - 100 - - C - - - - Clustered CMP 2.x EntityBean - false - clustered-entity-rmi-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.CleanShutdownInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.EntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - B - - ${jboss.partition.name:DefaultPartition} - org.jboss.ha.framework.interfaces.RoundRobin - org.jboss.ha.framework.interfaces.FirstAvailable - - - - - Standard CMP 2.x EntityBean with cache invalidation - false - entity-unified-invoker - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - org.jboss.cache.invalidation.triggers.EntityBeanCacheBatchInvalidatorInterceptor - org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.InvalidableEntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - A - - - - Instance Per Transaction CMP 2.x EntityBean - false - entity-unified-invoker - false - false - true - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.PerTxEntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.NoLock - - - 100 - - C - - - - Standard CMP 2.x EntityBean - - - - Standard Pessimistic CMP EntityBean - false - entity-unified-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.EntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - A - - - - Clustered CMP EntityBean - false - clustered-entity-rmi-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.CleanShutdownInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.EntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - A - - ${jboss.partition.name:DefaultPartition} - org.jboss.ha.framework.interfaces.RoundRobin - org.jboss.ha.framework.interfaces.FirstAvailable - - - - - Instance Per Transaction CMP EntityBean - false - entity-unified-invoker - false - false - true - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.PerTxEntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.NoLock - - - 100 - - C - - - - Standard CMP EntityBean - - - - Standard Stateless SessionBean - false - stateless-unified-invoker - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor - - org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor - org.jboss.ejb.plugins.TxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - - org.jboss.ejb.plugins.StatelessSessionInstancePool - - - - 100 - - - - - Clustered Stateless SessionBean - false - clustered-stateless-rmi-invoker - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.CleanShutdownInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor - - org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor - org.jboss.ejb.plugins.TxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - - org.jboss.ejb.plugins.StatelessSessionInstancePool - - - - 100 - - - ${jboss.partition.name:DefaultPartition} - org.jboss.ha.framework.interfaces.RoundRobin - org.jboss.ha.framework.interfaces.RoundRobin - - - - - - Standard Stateful SessionBean - false - stateful-unified-invoker - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor - - org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor - org.jboss.ejb.plugins.TxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.StatefulSessionSecurityInterceptor - - org.jboss.ejb.plugins.StatefulSessionInstanceCache - org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager - - org.jboss.ejb.plugins.LRUStatefulContextCachePolicy - - 50 - 1000000 - 1800 - 1800 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - - - - Clustered Stateful SessionBean - false - clustered-stateful-rmi-invoker - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.CleanShutdownInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor - - org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor - org.jboss.ejb.plugins.TxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.StatefulSessionSecurityInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.StatefulHASessionSynchronisationInterceptor - - org.jboss.ejb.plugins.StatefulHASessionInstanceCache - org.jboss.ejb.plugins.StatefulHASessionPersistenceManager - - org.jboss.ejb.plugins.LRUStatefulContextCachePolicy - - 50 - 1000000 - 1800 - 1800 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - - ${jboss.partition.name:DefaultPartition} - org.jboss.ha.framework.interfaces.RoundRobin - org.jboss.ha.framework.interfaces.FirstAvailable - /HASessionState/Default - - - - - Standard Pessimistic BMP EntityBean - false - entity-unified-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.EntityInstanceCache - org.jboss.ejb.plugins.BMPPersistenceManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - A - - - - Clustered BMP EntityBean - false - clustered-entity-rmi-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.CleanShutdownInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.EntityInstanceCache - org.jboss.ejb.plugins.BMPPersistenceManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - A - - ${jboss.partition.name:DefaultPartition} - org.jboss.ha.framework.interfaces.RoundRobin - org.jboss.ha.framework.interfaces.FirstAvailable - - - - - Instance Per Transaction BMP EntityBean - false - entity-unified-invoker - false - false - true - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.security.PreSecurityInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.PerTxEntityInstanceCache - org.jboss.ejb.plugins.BMPPersistenceManager - org.jboss.ejb.plugins.lock.NoLock - - - 100 - - C - - - - Standard BMP EntityBean - - - - Standard Message Driven Bean - false - message-driven-bean - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.RunAsSecurityInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor - - org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor - org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - - org.jboss.ejb.plugins.MessageDrivenInstancePool - - - - 100 - - - - - Singleton Message Driven Bean - false - singleton-message-driven-bean - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.RunAsSecurityInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor - - org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor - org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - - org.jboss.ejb.plugins.MessageDrivenInstancePool - - - - 100 - - - - - Standard Message Inflow Driven Bean - false - message-inflow-driven-bean - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.RunAsSecurityInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor - - org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor - org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - - org.jboss.ejb.plugins.MessageDrivenInstancePool - - - - 100 - - - - - - Index: testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml =================================================================== --- testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml (revision 104473) +++ testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml (working copy) @@ -255,20 +255,6 @@ - - - 4444 - ${jboss.bind.address} - - jboss:service=TransactionManager - - Index: testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml =================================================================== --- testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml (revision 104473) +++ testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml (working copy) @@ -255,20 +255,6 @@ - - - 4444 - ${jboss.bind.address} - - jboss:service=TransactionManager - - Index: testsuite/build.xml =================================================================== --- testsuite/build.xml (revision 104473) +++ testsuite/build.xml (working copy) @@ -999,28 +999,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -1270,7 +1248,6 @@ - - - - - - - - - - - - - - - - - - - - - - -