Dan, We will need to organize a hackathon to migrate Axis2 to use the new Neethi APIs. Will you be able to assist during this?
Azeez On Fri, Feb 18, 2011 at 10:04 AM, Daniel Kulp <[email protected]> wrote: > > I just committed a bunch more updates to Neethi that cleanup a few things, > but > also will end up making it much easier to port from Neeth 2 to 3. > > 1) I renamed PolicyEngine to PolicyBuilder. It really is just a Policy > builder. CXF and Axis (and others) really have the "engine" for asserting > the policies and such, thus the rename kind of makes sense. > > 2) With that renamed, I re-created the PolicyEngine with all the static > methods. It just wrappers a static instance of PolicyBuilder. I'd LIKE > to > mark PolicyEngine as Deprecated as it's definitely better to not use the > statics, but I'm also OK just leaving it. > > 3) I also changed the return of getAlternatives to match what the javadoc > said > which also matches what Axis is casting it to. (simplified some CXF code > as > well) > > > The result is that it's now pretty easy to update from 2.x to 3.x. The > changes required really are just: > > 1) Anything that implements AssertionBuilder will neet to be updated to > implement AssertionBuilder<OMElement>. Fairly simple. > > 2) All policies will need to have a "boolean isIgnorable()" method added. > You > can just add a default method that returns false to keep the old behavior. > However, you could also update the builders to record the ignorable flag > properly so the intersections would work. > > I've included a patch below that would update the axis2 trunk. Obviously, > things like Rampart would be more involved, but it does show how simple it > is. > > Once again, I'd appreciate anyone else looking at it and any thoughts folks > may have. > > -- > Daniel Kulp > [email protected] > http://dankulp.com/blog > > > > > > Index: modules/parent/pom.xml > =================================================================== > --- modules/parent/pom.xml (revision 1071847) > +++ modules/parent/pom.xml (working copy) > @@ -69,7 +69,7 @@ > <!-- Tracking SNAPSHOT(s) of a few projects --> > <axiom.version>1.2.12-SNAPSHOT</axiom.version> > <!--TODO: fix the compatibility issues with the Neethi trunk and > bring back to 3.0.0-SNAPSHOT--> > - <neethi.version>2.0.4</neethi.version> > + <neethi.version>3.0.0-SNAPSHOT</neethi.version> > <woden.version>1.0-SNAPSHOT</woden.version> > > <!-- Use released versions for these projects --> > Index: > > modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java > =================================================================== > --- > > modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java > (revision 1071847) > +++ > > modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java > (working copy) > @@ -28,7 +28,6 @@ > import org.apache.axis2.jaxws.description.builder.WebEndpointAnnot; > import org.apache.axis2.jaxws.description.builder.WebMethodAnnot; > import org.apache.axis2.jaxws.description.builder.WebResultAnnot; > -import sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl; > > import javax.jws.Oneway; > import javax.jws.WebMethod; > @@ -39,6 +38,7 @@ > import javax.xml.ws.ResponseWrapper; > import javax.xml.ws.WebEndpoint; > import java.lang.reflect.Constructor; > +import java.lang.reflect.GenericArrayType; > import java.lang.reflect.Method; > import java.lang.reflect.Modifier; > import java.lang.reflect.ParameterizedType; > @@ -347,7 +347,7 @@ > mdc.setReturnType(fullType); > } else if (type instanceof Class) { > mdc.setReturnType(((Class)type).getName()); > - } else if (type instanceof GenericArrayTypeImpl) { > + } else if (type instanceof GenericArrayType) { > mdc.setReturnType(type.getClass().getName()); > } > } > Index: > modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java > =================================================================== > --- modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java > (revision 1071847) > +++ modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java > (working copy) > @@ -52,5 +52,10 @@ > this.optional = isOptional; > } > > + > + public boolean isIgnorable() { > + return false; > + } > + > } > > \ No newline at end of file > Index: > > modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM10AssertionBuilder.java > =================================================================== > --- > > modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM10AssertionBuilder.java > (revision 1071847) > +++ > > modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM10AssertionBuilder.java > (working copy) > @@ -43,7 +43,7 @@ > * The builder will be picked by the > * "org.apache.neethi.AssertionBuilderFactory". > */ > -public class MTOM10AssertionBuilder implements AssertionBuilder { > +public class MTOM10AssertionBuilder implements AssertionBuilder<OMElement> > { > > private static Log log = > LogFactory.getLog(MTOM10AssertionBuilder.class); > > Index: > > modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM11AssertionBuilder.java > =================================================================== > --- > > modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM11AssertionBuilder.java > (revision 1071847) > +++ > > modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM11AssertionBuilder.java > (working copy) > @@ -39,7 +39,7 @@ > * "org.apache.neethi.AssertionBuilderFactory". > */ > > -public class MTOM11AssertionBuilder implements AssertionBuilder{ > +public class MTOM11AssertionBuilder implements AssertionBuilder<OMElement> > { > > private static Log log = > LogFactory.getLog(MTOM10AssertionBuilder.class); > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- *Afkham Azeez* Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com, * * *Member; Apache Software Foundation; **http://www.apache.org/*<http://www.apache.org/> * email: **[email protected]* <[email protected]>* cell: +94 77 3320919 blog: **http://blog.afkham.org* <http://blog.afkham.org>* twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez> * linked-in: **http://lk.linkedin.com/in/afkhamazeez* * * *Lean . Enterprise . Middleware* * *
