[jboss-cvs] JBossAS SVN: r73146 - trunk/aspects/src/main/org/jboss/aspects/remoting.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu May 8 05:01:08 EDT 2008
Author: dimitris at jboss.org
Date: 2008-05-08 05:01:08 -0400 (Thu, 08 May 2008)
New Revision: 73146
Removed:
trunk/aspects/src/main/org/jboss/aspects/remoting/IsLocalInterceptor.java
trunk/aspects/src/main/org/jboss/aspects/remoting/MergeMetaDataInterceptor.java
trunk/aspects/src/main/org/jboss/aspects/remoting/PojiProxy.java
trunk/aspects/src/main/org/jboss/aspects/remoting/Remoting.java
Log:
JBAS-5410, Remove remoting classes from jbossas/trunk/aspects when jboss-aspects is released
Deleted: trunk/aspects/src/main/org/jboss/aspects/remoting/IsLocalInterceptor.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/remoting/IsLocalInterceptor.java 2008-05-08 08:50:55 UTC (rev 73145)
+++ trunk/aspects/src/main/org/jboss/aspects/remoting/IsLocalInterceptor.java 2008-05-08 09:01:08 UTC (rev 73146)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.aspects.remoting;
-
-import org.jboss.aop.Dispatcher;
-/**
- * Checks to see if this object is local in VM
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
-public class IsLocalInterceptor implements org.jboss.aop.advice.Interceptor, java.io.Serializable
-{
- private static final long serialVersionUID = 8067347185395345001L;
-
- public static final IsLocalInterceptor singleton = new IsLocalInterceptor();
-
- public String getName() { return "IsLocalInterceptor"; }
-
- public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable
- {
- Object oid = invocation.getMetaData(Dispatcher.DISPATCHER, Dispatcher.OID);
- if (Dispatcher.singleton.isRegistered(oid))
- {
- org.jboss.aop.joinpoint.InvocationResponse response = Dispatcher.singleton.invoke(invocation);
- invocation.setResponseContextInfo(response.getContextInfo());
- return response.getResponse();
- }
- return invocation.invokeNext();
- }
-}
Deleted: trunk/aspects/src/main/org/jboss/aspects/remoting/MergeMetaDataInterceptor.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/remoting/MergeMetaDataInterceptor.java 2008-05-08 08:50:55 UTC (rev 73145)
+++ trunk/aspects/src/main/org/jboss/aspects/remoting/MergeMetaDataInterceptor.java 2008-05-08 09:01:08 UTC (rev 73146)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.aspects.remoting;
-
-import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.aop.joinpoint.InvocationBase;
-import org.jboss.aop.metadata.MetaDataResolver;
-import org.jboss.aop.metadata.SimpleMetaData;
-/**
- * Prepare Metadata to be marshalled across the wire.
- * This interceptor iterates through an Invocation's
- * metadata resolver list to pull out transportable
- * metadata and stuff it into the invocation
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
-public class MergeMetaDataInterceptor implements org.jboss.aop.advice.Interceptor, java.io.Serializable
-{
- private static final long serialVersionUID = 2424149906770308705L;
-
- public static final MergeMetaDataInterceptor singleton = new MergeMetaDataInterceptor();
-
- public String getName() { return "MergeMetaDataInterceptor"; }
-
- protected org.jboss.aop.metadata.SimpleMetaData merge(Invocation invocation, MetaDataResolver resolver, SimpleMetaData merged)
- {
- if (resolver == null) return merged;
- org.jboss.aop.metadata.SimpleMetaData metadata = resolver.getAllMetaData(invocation);
- if (metadata == null) return merged;
- if (merged == null)
- {
- merged = new org.jboss.aop.metadata.SimpleMetaData();
- }
- merged.mergeIn(metadata);
- return merged;
- }
-
- public Object invoke(Invocation invocation) throws Throwable
- {
- org.jboss.aop.metadata.SimpleMetaData merged = null;
- merged = merge(invocation, ((InvocationBase)invocation).getInstanceResolver(), merged);
-
- org.jboss.aop.metadata.MetaDataResolver threadMetaData = org.jboss.aop.metadata.ThreadMetaData.instance().getAllMetaData(invocation);
- merged = merge(invocation, threadMetaData, merged);
-
- if (merged != null)
- {
- // Invocation data should override all merged data
- merged.mergeIn(invocation.getMetaData());
-
- // replace invocation's metadata with merged
- invocation.setMetaData(merged);
- }
- return invocation.invokeNext();
- }
-}
Deleted: trunk/aspects/src/main/org/jboss/aspects/remoting/PojiProxy.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/remoting/PojiProxy.java 2008-05-08 08:50:55 UTC (rev 73145)
+++ trunk/aspects/src/main/org/jboss/aspects/remoting/PojiProxy.java 2008-05-08 09:01:08 UTC (rev 73146)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.aspects.remoting;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import org.jboss.aop.Dispatcher;
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.joinpoint.MethodInvocation;
-import org.jboss.aop.util.MethodHashing;
-import org.jboss.aop.util.PayloadKey;
-import org.jboss.remoting.InvokerLocator;
-
-/**
- * comment
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- */
-public class PojiProxy implements java.io.Serializable, InvocationHandler
-{
- private static final long serialVersionUID = 8054816523858555978L;
-
- private Object oid;
- private InvokerLocator uri;
- private Interceptor[] interceptors;
-
- public PojiProxy(Object oid, InvokerLocator uri, Interceptor[] interceptors)
- {
- this.oid = oid;
- this.uri = uri;
- this.interceptors = interceptors;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- long hash = MethodHashing.calculateHash(method);
- MethodInvocation sri = new MethodInvocation(interceptors, hash, method, method, null);
- sri.setArguments(args);
- sri.getMetaData().addMetaData(Dispatcher.DISPATCHER, Dispatcher.OID, oid, PayloadKey.AS_IS);
- sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.INVOKER_LOCATOR, uri, PayloadKey.AS_IS);
- sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.SUBSYSTEM, "AOP", PayloadKey.AS_IS);
- return sri.invokeNext();
- }
-}
Deleted: trunk/aspects/src/main/org/jboss/aspects/remoting/Remoting.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/remoting/Remoting.java 2008-05-08 08:50:55 UTC (rev 73145)
+++ trunk/aspects/src/main/org/jboss/aspects/remoting/Remoting.java 2008-05-08 09:01:08 UTC (rev 73146)
@@ -1,191 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.aspects.remoting;
-
-import org.jboss.aop.Dispatcher;
-import org.jboss.aop.InstanceAdvised;
-import org.jboss.aop.InstanceAdvisor;
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.proxy.ClassProxy;
-import org.jboss.aop.proxy.ClassProxyFactory;
-import org.jboss.aop.proxy.ProxyFactory;
-import org.jboss.aop.util.PayloadKey;
-import org.jboss.aspects.security.SecurityClientInterceptor;
-import org.jboss.aspects.tx.ClientTxPropagationInterceptor;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.util.id.GUID;
-
-import java.lang.reflect.Proxy;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Remoting proxy utility methods.
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class Remoting
-{
- public static ClassProxy createRemoteProxy(Object objectId, Class clazz, String uri)
- throws Exception
- {
- return createRemoteProxy(objectId, clazz, new InvokerLocator(uri));
- }
-
- public static ClassProxy createRemoteProxy(Object objectId, Class clazz, InvokerLocator locator)
- throws Exception
- {
- ClassProxy proxy = ClassProxyFactory.newInstance(clazz);
- makeRemotable(proxy, locator, objectId);
-
- return proxy;
- }
-
- /**
- * Create a remote proxy for the given ifaces, Dispatch.OID, locator.
- * @param objectId
- * @param loader
- * @param ifaces
- * @param locator
- * @return the remote enabled proxy
- * @throws Exception
- */
- public static org.jboss.aop.proxy.Proxy createRemoteProxy(Object objectId, ClassLoader loader,
- Class[] ifaces, InvokerLocator locator)
- throws Exception
- {
- GUID guid = new GUID();
- org.jboss.aop.proxy.Proxy proxy = ProxyFactory.createInterfaceProxy(guid, loader, ifaces);
- Remoting.makeRemotable(proxy, locator, objectId);
- return proxy;
- }
- /**
- * Create a remote proxy for the given ifaces, Dispatch.OID, locator, interceptors
- * and subsystem.
- *
- * @param objectId
- * @param loader
- * @param ifaces
- * @param locator
- * @param interceptors
- * @param subsystem
- * @return the remote enabled proxy
- * @throws Exception
- */
- public static org.jboss.aop.proxy.Proxy createRemoteProxy(Object objectId, ClassLoader loader,
- Class[] ifaces, InvokerLocator locator,
- List<Interceptor> interceptors, String subsystem)
- throws Exception
- {
- GUID guid = new GUID();
- org.jboss.aop.proxy.Proxy proxy = ProxyFactory.createInterfaceProxy(guid, loader, ifaces);
- Remoting.makeRemotable(proxy, locator, objectId, interceptors, subsystem);
- return proxy;
- }
-
- /**
- * Does'nt propagate security/tx
- * @param oid
- * @param interfaces
- * @param uri
- * @return
- * @throws Exception
- */
- public static Object createPojiProxy(Object oid, Class[] interfaces, String uri) throws Exception
- {
- InvokerLocator locator = new InvokerLocator(uri);
- Interceptor[] interceptors = {IsLocalInterceptor.singleton, InvokeRemoteInterceptor.singleton};
- PojiProxy proxy = new PojiProxy(oid, locator, interceptors);
- return Proxy.newProxyInstance(interfaces[0].getClassLoader(), interfaces, proxy);
-
- }
-
- /**
- *
- * @param oid
- * @param interfaces
- * @param uri
- * @return
- * @throws Exception
- */
- public static Object createPojiProxy(Object oid, Class[] interfaces, String uri, Interceptor[] interceptors) throws Exception
- {
- InvokerLocator locator = new InvokerLocator(uri);
- PojiProxy proxy = new PojiProxy(oid, locator, interceptors);
- return Proxy.newProxyInstance(interfaces[0].getClassLoader(), interfaces, proxy);
-
- }
-
-
- /**
- * Create a remote proxy given the advised proxy, locator and Dispatcher.OID.
- * This uses a default interceptor stack and AOP substem handler.
- *
- * @param proxy
- * @param locator
- * @param objectId
- */
- public static void makeRemotable(InstanceAdvised proxy, InvokerLocator locator,
- Object objectId)
- {
- ArrayList<Interceptor> interceptors = new ArrayList<Interceptor>();
- interceptors.add(IsLocalInterceptor.singleton);
- interceptors.add(SecurityClientInterceptor.singleton);
- interceptors.add(ClientTxPropagationInterceptor.singleton);
- interceptors.add(MergeMetaDataInterceptor.singleton);
- interceptors.add(InvokeRemoteInterceptor.singleton);
- makeRemotable(proxy, locator, objectId, interceptors, "AOP");
- }
- /**
- * Create a remote proxy given the advised proxy, locator, Dispatcher.OID,
- * interceptors and remoting subystem.
- *
- * @param proxy
- * @param locator
- * @param objectId
- * @param interceptors
- * @param subsystem
- */
- public static void makeRemotable(InstanceAdvised proxy, InvokerLocator locator,
- Object objectId, List<Interceptor> interceptors, String subsystem)
- {
- InstanceAdvisor advisor = proxy._getInstanceAdvisor();
- for(Interceptor i : interceptors)
- advisor.insertInterceptor(i);
- advisor.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING,
- InvokeRemoteInterceptor.INVOKER_LOCATOR,
- locator,
- PayloadKey.AS_IS);
- advisor.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING,
- InvokeRemoteInterceptor.SUBSYSTEM,
- subsystem,
- PayloadKey.AS_IS);
- advisor.getMetaData().addMetaData(Dispatcher.DISPATCHER,
- Dispatcher.OID,
- objectId,
- PayloadKey.AS_IS);
- }
-
-
-}
More information about the jboss-cvs-commits
mailing list