[jboss-cvs] JBossAS SVN: r71770 - in projects/ejb3/trunk: remoting and 9 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Apr 7 12:21:19 EDT 2008
Author: wolfc
Date: 2008-04-07 12:21:18 -0400 (Mon, 07 Apr 2008)
New Revision: 71770
Added:
projects/ejb3/trunk/remoting/
projects/ejb3/trunk/remoting/.classpath
projects/ejb3/trunk/remoting/.project
projects/ejb3/trunk/remoting/.settings/
projects/ejb3/trunk/remoting/.settings/org.eclipse.jdt.core.prefs
projects/ejb3/trunk/remoting/pom.xml
projects/ejb3/trunk/remoting/src/
projects/ejb3/trunk/remoting/src/main/
projects/ejb3/trunk/remoting/src/main/java/
projects/ejb3/trunk/remoting/src/main/java/org/
projects/ejb3/trunk/remoting/src/main/java/org/jboss/
projects/ejb3/trunk/remoting/src/main/java/org/jboss/aspects/
projects/ejb3/trunk/remoting/src/main/java/org/jboss/aspects/remoting/
projects/ejb3/trunk/remoting/src/main/java/org/jboss/aspects/remoting/InvokeRemoteInterceptor.java
projects/ejb3/trunk/remoting/src/test/
projects/ejb3/trunk/remoting/src/test/java/
Log:
First shot at jboss-remoting-aspects
Property changes on: projects/ejb3/trunk/remoting
___________________________________________________________________
Name: svn:ignore
+ eclipse-target
target
Added: projects/ejb3/trunk/remoting/.classpath
===================================================================
--- projects/ejb3/trunk/remoting/.classpath (rev 0)
+++ projects/ejb3/trunk/remoting/.classpath 2008-04-07 16:21:18 UTC (rev 71770)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" output="eclipse-target/tests-classes" path="src/test/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="eclipse-target/classes"/>
+</classpath>
Added: projects/ejb3/trunk/remoting/.project
===================================================================
--- projects/ejb3/trunk/remoting/.project (rev 0)
+++ projects/ejb3/trunk/remoting/.project 2008-04-07 16:21:18 UTC (rev 71770)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-remoting-aspects</name>
+ <comment>TODO</comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: projects/ejb3/trunk/remoting/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/ejb3/trunk/remoting/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ projects/ejb3/trunk/remoting/.settings/org.eclipse.jdt.core.prefs 2008-04-07 16:21:18 UTC (rev 71770)
@@ -0,0 +1,5 @@
+#Mon Apr 07 18:13:50 CEST 2008
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added: projects/ejb3/trunk/remoting/pom.xml
===================================================================
--- projects/ejb3/trunk/remoting/pom.xml (rev 0)
+++ projects/ejb3/trunk/remoting/pom.xml 2008-04-07 16:21:18 UTC (rev 71770)
@@ -0,0 +1,46 @@
+<!--
+ vi:ts=2:sw=2:expandtab
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-build</artifactId>
+ <version>0.13.0</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-remoting-aspects</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>JBoss Remoting Aspects</name>
+ <url>http://www.jboss.org</url>
+ <description>
+ TODO
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss.remoting</groupId>
+ <artifactId>jboss-remoting</artifactId>
+ <version>2.4.0.CR1</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Copied: projects/ejb3/trunk/remoting/src/main/java/org/jboss/aspects/remoting/InvokeRemoteInterceptor.java (from rev 71685, trunk/aspects/src/main/org/jboss/aspects/remoting/InvokeRemoteInterceptor.java)
===================================================================
--- projects/ejb3/trunk/remoting/src/main/java/org/jboss/aspects/remoting/InvokeRemoteInterceptor.java (rev 0)
+++ projects/ejb3/trunk/remoting/src/main/java/org/jboss/aspects/remoting/InvokeRemoteInterceptor.java 2008-04-07 16:21:18 UTC (rev 71770)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.aspects.remoting;
+
+import java.io.ObjectStreamException;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvokerLocator;
+/**
+ * Checks to see if this object is local in VM
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @version $Revision$
+ */
+public class InvokeRemoteInterceptor implements org.jboss.aop.advice.Interceptor, java.io.Serializable
+{
+ private static final Logger log = Logger.getLogger(InvokeRemoteInterceptor.class);
+
+ private static final long serialVersionUID = -145166951731929406L;
+
+ public static final InvokeRemoteInterceptor singleton = new InvokeRemoteInterceptor();
+ public static final String REMOTING = "REMOTING";
+ public static final String INVOKER_LOCATOR = "INVOKER_LOCATOR";
+ public static final String SUBSYSTEM = "SUBSYSTEM";
+
+ public String getName() { return "InvokeRemoteInterceptor"; }
+
+ public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable
+ {
+ InvokerLocator locator = (InvokerLocator)invocation.getMetaData(REMOTING, INVOKER_LOCATOR);
+ if (locator == null)
+ {
+ throw new RuntimeException("No InvokerLocator supplied. Can't invoke remotely!");
+ }
+ String subsystem = (String)invocation.getMetaData(REMOTING, SUBSYSTEM);
+ if (subsystem == null) subsystem = "AOP";
+ Client client = new Client(locator, subsystem);
+
+ try
+ {
+ client.connect();
+ org.jboss.aop.joinpoint.InvocationResponse response = (org.jboss.aop.joinpoint.InvocationResponse)client.invoke(invocation, null);
+ invocation.setResponseContextInfo(response.getContextInfo());
+ return response.getResponse();
+ }
+ catch (Exception e)
+ {
+ StackTraceElement[] serverStackTrace;
+ if (e.getCause() != null)
+ serverStackTrace = e.getCause().getStackTrace();
+ else
+ serverStackTrace = e.getStackTrace();
+
+ Exception clientException = new Exception();
+ StackTraceElement[] clientStackTrace = clientException.getStackTrace();
+ StackTraceElement[] completeStackTrace = new StackTraceElement[serverStackTrace.length + clientStackTrace.length];
+ System.arraycopy(serverStackTrace, 0, completeStackTrace, 0, serverStackTrace.length);
+ System.arraycopy(clientStackTrace, 0, completeStackTrace, serverStackTrace.length, clientStackTrace.length);
+
+ if (e.getCause() != null)
+ e.getCause().setStackTrace(completeStackTrace);
+ else
+ e.setStackTrace(completeStackTrace);
+
+ throw e;
+ }
+ finally
+ {
+ client.disconnect();
+ }
+ }
+
+ Object readResolve() throws ObjectStreamException {
+ return singleton;
+ }
+}
More information about the jboss-cvs-commits
mailing list