Deprected abstract endpoint, in favor of the @Endpoint model and arbitrary parameter injection

This commit is contained in:
Arjen Poutsma
2010-05-06 11:24:38 +00:00
parent a7323de799
commit 5abfd69fc4
9 changed files with 36 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@ import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
import javax.xml.transform.dom.DOMSource;
import org.springframework.xml.transform.TransformerObjectSupport;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
@@ -28,8 +30,6 @@ import org.dom4j.io.DocumentResult;
import org.dom4j.io.DocumentSource;
import org.w3c.dom.Node;
import org.springframework.xml.transform.TransformerObjectSupport;
/**
* Abstract base class for endpoints that handle the message payload as dom4j elements. Offers the message payload as a
* dom4j <code>Element</code>, and allows subclasses to create a response by returning an <code>Element</code>.
@@ -40,7 +40,9 @@ import org.springframework.xml.transform.TransformerObjectSupport;
* @author Arjen Poutsma
* @see org.dom4j.Element
* @since 1.0.0
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
*/
@Deprecated
public abstract class AbstractDom4jPayloadEndpoint extends TransformerObjectSupport implements PayloadEndpoint {
private boolean alwaysTransform = false;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,12 +24,12 @@ import javax.xml.transform.TransformerException;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import org.springframework.xml.transform.TransformerObjectSupport;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.springframework.xml.transform.TransformerObjectSupport;
/**
* Abstract base class for endpoints that handle the message payload as DOM elements.
* <p/>
@@ -43,7 +43,9 @@ import org.springframework.xml.transform.TransformerObjectSupport;
* @author Alef Arendsen
* @see #invokeInternal(org.w3c.dom.Element,org.w3c.dom.Document)
* @since 1.0.0
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
*/
@Deprecated
public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSupport implements PayloadEndpoint {
private DocumentBuilderFactory documentBuilderFactory;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@ import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
import javax.xml.transform.dom.DOMSource;
import org.springframework.xml.transform.TransformerObjectSupport;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.DOMBuilder;
@@ -27,8 +29,6 @@ import org.jdom.transform.JDOMResult;
import org.jdom.transform.JDOMSource;
import org.w3c.dom.Node;
import org.springframework.xml.transform.TransformerObjectSupport;
/**
* Abstract base class for endpoints that handle the message payload as JDOM elements.
* <p/>
@@ -40,7 +40,9 @@ import org.springframework.xml.transform.TransformerObjectSupport;
*
* @author Arjen Poutsma
* @since 1.0.0
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
*/
@Deprecated
public abstract class AbstractJDomPayloadEndpoint extends TransformerObjectSupport implements PayloadEndpoint {
private boolean alwaysTransform = false;

View File

@@ -18,9 +18,6 @@ package org.springframework.ws.server.endpoint;
import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
@@ -29,6 +26,9 @@ import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.support.MarshallingUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Endpoint that unmarshals the request payload, and marshals the response object. This endpoint needs a
* <code>Marshaller</code> and <code>Unmarshaller</code>, both of which can be set using properties. An abstract
@@ -41,7 +41,9 @@ import org.springframework.ws.support.MarshallingUtils;
* @see Unmarshaller
* @see #invokeInternal(Object)
* @since 1.0.0
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
*/
@Deprecated
public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpoint, InitializingBean {
/** Logger available to subclasses. */
@@ -78,7 +80,7 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo
Assert.notNull(marshaller, "marshaller must not be null");
if (!(marshaller instanceof Unmarshaller)) {
throw new IllegalArgumentException("Marshaller [" + marshaller + "] does not implement the Unmarshaller " +
"interface. Please set an Unmarshaller explicitely by using the " +
"interface. Please set an Unmarshaller explicitly by using the " +
"AbstractMarshallingPayloadEndpoint(Marshaller, Unmarshaller) constructor.");
}
else {
@@ -189,7 +191,7 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo
* The default implementation does nothing.
*
* @deprecated as of Spring Web Services 1.5: {@link #afterPropertiesSet()} is no longer final, so this can safely
* be overriden in subclasses
* be overridden in subclasses
*/
@Deprecated
public void afterMarshallerSet() throws Exception {
@@ -198,10 +200,10 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo
/**
* Template method that subclasses must implement to process a request.
* <p/>
* The unmarshaled request object is passed as a parameter, and the returned object is marshalled to a response. If
* The unmarshalled request object is passed as a parameter, and the returned object is marshalled to a response. If
* no response is required, return <code>null</code>.
*
* @param requestObject the unnmarshalled message payload as an object
* @param requestObject the unmarshalled message payload as an object
* @return the object to be marshalled as response, or <code>null</code> if a response is not required
*/
protected abstract Object invokeInternal(Object requestObject) throws Exception;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import javax.xml.transform.Source;
import javax.xml.transform.sax.SAXResult;
import org.springframework.xml.transform.TransformerObjectSupport;
import org.xml.sax.ContentHandler;
/**
@@ -34,7 +35,9 @@ import org.xml.sax.ContentHandler;
* @see #createContentHandler()
* @see #getResponse(org.xml.sax.ContentHandler)
* @since 1.0.0
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
*/
@Deprecated
public abstract class AbstractSaxPayloadEndpoint extends TransformerObjectSupport implements PayloadEndpoint {
/**

View File

@@ -46,7 +46,9 @@ import org.springframework.xml.transform.TraxUtils;
* @see XMLEventReader
* @see XMLEventWriter
* @since 1.0.0
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
*/
@Deprecated
@SuppressWarnings("Since15")
public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPayloadEndpoint implements MessageEndpoint {

View File

@@ -29,7 +29,9 @@ import org.springframework.xml.transform.TransformerObjectSupport;
* @see XMLInputFactory
* @see XMLOutputFactory
* @since 1.0.0
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
*/
@Deprecated
@SuppressWarnings("Since15")
public abstract class AbstractStaxPayloadEndpoint extends TransformerObjectSupport {

View File

@@ -43,7 +43,9 @@ import org.springframework.xml.transform.TraxUtils;
* @see XMLStreamReader
* @see XMLStreamWriter
* @since 1.0.0
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
*/
@Deprecated
@SuppressWarnings("Since15")
public abstract class AbstractStaxStreamPayloadEndpoint extends AbstractStaxPayloadEndpoint implements MessageEndpoint {

View File

@@ -60,7 +60,9 @@ import org.xml.sax.XMLReader;
* @author Arjen Poutsma
* @see Element
* @since 1.0.0
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
*/
@Deprecated
@SuppressWarnings("Since15")
public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSupport implements PayloadEndpoint {