[jboss-svn-commits] JBL Code SVN: r28038 - in labs/jbossesb/trunk/product/services: soap and 11 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jul 15 05:15:23 EDT 2009
Author: kevin.conner at jboss.com
Date: 2009-07-15 05:15:23 -0400 (Wed, 15 Jul 2009)
New Revision: 28038
Added:
labs/jbossesb/trunk/product/services/soap/aop/
labs/jbossesb/trunk/product/services/soap/aop/java/
labs/jbossesb/trunk/product/services/soap/aop/java/org/
labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/
labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/
labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/
labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/esb/
labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/
labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/
labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodParameterMappingAspect.java
labs/jbossesb/trunk/product/services/soap/aop/resources/
labs/jbossesb/trunk/product/services/soap/aop/resources/META-INF/
labs/jbossesb/trunk/product/services/soap/aop/resources/META-INF/jboss-aop.xml
Modified:
labs/jbossesb/trunk/product/services/base-project-build.xml
labs/jbossesb/trunk/product/services/soap/build.xml
Log:
Base invocation/results on WS meta data: JBESB-2744
Modified: labs/jbossesb/trunk/product/services/base-project-build.xml
===================================================================
--- labs/jbossesb/trunk/product/services/base-project-build.xml 2009-07-15 09:09:04 UTC (rev 28037)
+++ labs/jbossesb/trunk/product/services/base-project-build.xml 2009-07-15 09:15:23 UTC (rev 28038)
@@ -12,6 +12,7 @@
-->
<dirname property="services.dir" file="${ant.file.base-build}"/>
<property name="esb.root.dir" location="../.."/>
+ <property name="lib.excludes" value=""/>
<target name="clean">
<delete dir="build" />
</target>
@@ -64,25 +65,35 @@
</condition>
</target>
- <target name="compile" depends="prepare">
+ <target name="compile" depends="base-compile, service-compile"/>
+
+ <target name="base-compile" depends="prepare">
<javac srcdir="src/main/java" destdir="build/classes" debug="on" >
<classpath refid="classpath" />
</javac>
</target>
-
- <target name="jar" depends="compile,check.for.files" unless="dir_empty">
+
+ <target name="service-compile"/>
+
+ <target name="jar" depends="base-jar, service-jar"/>
+
+ <target name="base-jar" depends="compile,check.for.files" unless="dir_empty">
<jar basedir="build/classes" destfile="build/jbossesb-${ant.project.name}.jar" includes="**/*.class"/>
</target>
- <target name="esb" depends="jar, service-specific-assemblies">
+ <target name="service-jar"/>
+
+ <target name="esb" depends="base-esb,service-esb"/>
+
+ <target name="base-esb" depends="jar">
<copy todir="build/${ant.project.name}.esb/" >
- <fileset dir="lib/ext" includes="*.jar"/>
+ <fileset dir="lib/ext" includes="*.jar" excludes="${lib.excludes}"/>
<fileset dir="src/main/resources/" includes="**/*"/>
<fileset dir="build" includes="*.jar"/>
</copy>
</target>
- <target name="service-specific-assemblies"/>
+ <target name="service-esb"/>
<target name="dist" depends="esb">
<!-- copying to jbossesb/lib -->
Added: labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodParameterMappingAspect.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodParameterMappingAspect.java (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodParameterMappingAspect.java 2009-07-15 09:15:23 UTC (rev 28038)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.internal.soa.esb.soap.wise;
+
+import it.javalinux.wise.core.client.WSMethod;
+import it.javalinux.wise.core.client.WebParameter;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.jws.WebParam.Mode;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * Aspect used to override parameter array creation within wise invocations.
+ *
+ * @author <a href='mailto:Kevin.Conner at jboss.com'>Kevin Conner</a>
+ */
+public class WSMethodParameterMappingAspect
+{
+ public Object getParameterInRightPositionArray(final MethodInvocation invocation)
+ throws Throwable
+ {
+ final Object[] args = invocation.getArguments() ;
+ final Map<String, Object> params = (Map<String, Object>)args[0] ;
+
+ final WSMethod wsMethod = (WSMethod)invocation.getTargetObject() ;
+ final Map<String, WebParameter> webParams = wsMethod.getWebParams() ;
+
+ final Object[] result = new Object[webParams.size()] ;
+
+ for (Entry<String, WebParameter> entry : webParams.entrySet())
+ {
+ final String key = entry.getKey() ;
+ final Object value = params.get(key) ;
+ final WebParameter webParameter = entry.getValue() ;
+ final int position = webParameter.getPosition() ;
+ result[position] = value ;
+ }
+ return result ;
+ }
+
+ public Object getHoldersResult(final MethodInvocation invocation)
+ throws Throwable
+ {
+ final Object[] args = invocation.getArguments() ;
+ final Map<String, Object> params = (Map<String, Object>)args[0] ;
+
+ final WSMethod wsMethod = (WSMethod)invocation.getTargetObject() ;
+ final Map<String, WebParameter> webParams = wsMethod.getWebParams() ;
+
+ final Map<String, Object> holders = new HashMap<String, Object>() ;
+
+ for (Entry<String, WebParameter> entry : webParams.entrySet())
+ {
+ final WebParameter webParameter = entry.getValue() ;
+ final Enum<Mode> mode = webParameter.getMode() ;
+ if ((mode == Mode.INOUT) || (mode == Mode.OUT))
+ {
+ final String key = entry.getKey() ;
+ final Object value = params.get(key) ;
+ holders.put(key, value) ;
+ }
+ }
+ return holders;
+ }
+}
Property changes on: labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodParameterMappingAspect.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/services/soap/aop/resources/META-INF/jboss-aop.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soap/aop/resources/META-INF/jboss-aop.xml (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/aop/resources/META-INF/jboss-aop.xml 2009-07-15 09:15:23 UTC (rev 28038)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE aop PUBLIC
+ "-//JBoss//DTD JBOSS AOP 1.0//EN"
+ "http://labs.jboss.com/portal/jbossaop/dtd/jboss-aop_1_0.dtd">
+
+<aop>
+ <aspect class="org.jboss.internal.soa.esb.soap.wise.WSMethodParameterMappingAspect" scope="PER_VM"/>
+
+ <bind pointcut="execution(* it.javalinux.wise.core.client.WSMethod->getParmeterInRightPositionArray(..))">
+ <advice name="getParameterInRightPositionArray" aspect="org.jboss.internal.soa.esb.soap.wise.WSMethodParameterMappingAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* it.javalinux.wise.core.client.WSMethod->getHoldersResult(..))">
+ <advice name="getHoldersResult" aspect="org.jboss.internal.soa.esb.soap.wise.WSMethodParameterMappingAspect"/>
+ </bind>
+</aop>
+
Property changes on: labs/jbossesb/trunk/product/services/soap/aop/resources/META-INF/jboss-aop.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Modified: labs/jbossesb/trunk/product/services/soap/build.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soap/build.xml 2009-07-15 09:09:04 UTC (rev 28037)
+++ labs/jbossesb/trunk/product/services/soap/build.xml 2009-07-15 09:15:23 UTC (rev 28038)
@@ -1,6 +1,21 @@
<project name="soap" default="test" basedir=".">
<property file="build.properties"/>
+
+ <property name="build.dir" location="build"/>
+ <property name="aop.dir" location="aop"/>
+ <property name="aop.src.dir" location="${aop.dir}/java"/>
+ <property name="aop.resources.dir" location="${aop.dir}/resources"/>
+
+ <property name="wise.jar" value="wise-core.jar"/>
+
+ <property name="aop.jar.version" value="1.0"/>
+ <property name="aop.jar.name" value="jboss-wise-${aop.jar.version}.aop"/>
+ <property name="aop.jar" value="${build.dir}/${aop.jar.name}"/>
+ <property name="aop.classes.dir" location="${build.dir}/aop-classes"/>
+ <property name="aopc.classes.dir" location="${build.dir}/aopc-classes"/>
+
+ <property name="lib.excludes" value="${wise.jar}"/>
<!-- Import the base Ant build script... -->
<import file="${services.base.build}"/>
@@ -20,10 +35,49 @@
<pathelement location="../soapui-client/target/classes" />
</path>
- <target name="service-specific-assemblies" depends="jar">
- <copy todir="build/${ant.project.name}.esb/">
+ <target name="service-compile" depends="prepare">
+ <delete dir="${aop.classes.dir}" quiet="true"/>
+ <mkdir dir="${aop.classes.dir}"/>
+
+ <javac srcdir="${aop.src.dir}" destdir="${aop.classes.dir}"
+ debug="true" source="1.5" classpathref="classpath"/>
+ </target>
+
+ <target name="service-jar" depends="aop-jar, aopc-jar"/>
+
+ <target name="aop-jar" depends="compile">
+ <jar destfile="${aop.jar}">
+ <fileset dir="${aop.classes.dir}"/>
+ <fileset dir="${aop.resources.dir}"/>
+ </jar>
+ </target>
+
+ <target name="aopc-jar">
+ <taskdef name="aopc" classname="org.jboss.aop.ant.AopC"
+ classpathref="classpath"/>
+
+ <delete dir="${aopc.classes.dir}" quiet="true"/>
+ <mkdir dir="${aopc.classes.dir}"/>
+
+ <unzip dest="${aopc.classes.dir}" src="lib/ext/${wise.jar}"/>
+
+ <aopc compilerclasspathref="classpath" verbose="true">
+ <classpath path="${aopc.classes.dir}"/>
+ <src path="${aopc.classes.dir}"/>
+ <include name="it/javalinux/wise/core/client/WSMethod.class"/>
+
+ <aoppath path="${aop.resources.dir}/META-INF/jboss-aop.xml"/>
+ <aopclasspath path="${aop.classes.dir}"/>
+ </aopc>
+ <zip destfile="${build.dir}/${wise.jar}"
+ basedir="${aopc.classes.dir}"/>
+ </target>
+
+ <target name="service-esb" depends="base-esb">
+ <copy todir="${build.dir}/${ant.project.name}.esb">
<fileset dir="${esb.root.dir}/build/lib"
includes="jaxws-tools*.jar jaxws-rt*.jar jaxb-xjc*.jar"/>
+ <fileset file="${aop.jar}"/>
</copy>
</target>
</project>
More information about the jboss-svn-commits
mailing list