001: /*
002: * The contents of this file are subject to the terms
003: * of the Common Development and Distribution License
004: * (the "License"). You may not use this file except
005: * in compliance with the License.
006: *
007: * You can obtain a copy of the license at
008: * https://jwsdp.dev.java.net/CDDLv1.0.html
009: * See the License for the specific language governing
010: * permissions and limitations under the License.
011: *
012: * When distributing Covered Code, include this CDDL
013: * HEADER in each file and include the License file at
014: * https://jwsdp.dev.java.net/CDDLv1.0.html If applicable,
015: * add the following below this CDDL HEADER, with the
016: * fields enclosed by brackets "[]" replaced with your
017: * own identifying information: Portions Copyright [yyyy]
018: * [name of copyright owner]
019: */
020: /*
021: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
022: *
023: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
024: *
025: * The contents of this file are subject to the terms of either the GNU
026: * General Public License Version 2 only ("GPL") or the Common Development
027: * and Distribution License("CDDL") (collectively, the "License"). You
028: * may not use this file except in compliance with the License. You can obtain
029: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
030: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
031: * language governing permissions and limitations under the License.
032: *
033: * When distributing the software, include this License Header Notice in each
034: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
035: * Sun designates this particular file as subject to the "Classpath" exception
036: * as provided by Sun in the GPL Version 2 section of the License file that
037: * accompanied this code. If applicable, add the following below the License
038: * Header, with the fields enclosed by brackets [] replaced by your own
039: * identifying information: "Portions Copyrighted [year]
040: * [name of copyright owner]"
041: *
042: * Contributor(s):
043: *
044: * If you wish your version of this file to be governed by only the CDDL or
045: * only the GPL Version 2, indicate your decision by adding "[Contributor]
046: * elects to include this software in this distribution under the [CDDL or GPL
047: * Version 2] license." If you don't indicate a single choice of license, a
048: * recipient has the option to distribute your version of this file under
049: * either the CDDL, the GPL Version 2 or to extend the choice of license to
050: * its licensees as provided above. However, if you add GPL Version 2 code
051: * and therefore, elected the GPL Version 2 license, then the option applies
052: * only if the new code is made subject to such option by the copyright
053: * holder.
054: */
055:
056: package com.sun.xml.soap;
057:
058: import java.util.Vector;
059: import javax.xml.soap.*;
060:
061: public abstract class SOAPProcessor {
062:
063: protected Vector recipients = new Vector();
064: protected Vector annotators = new Vector();
065:
066: /**
067: * adds a <code>SOAPRecipient</code> to this <code>SOAPProcessor</code>
068: *
069: * @param recipient
070: * The <code>SOAPRecipient</code> to be added
071: */
072: public void addRecipient(SOAPRecipient recipient) {
073: recipients.addElement(recipient);
074: }
075:
076: /**
077: * adds a <code>SOAPAnnotator</code> to this <code>SOAPProcessor</code>
078: *
079: * @param annotator
080: * The <code>SOAPAnnotator</code> to be added
081: */
082: public void addAnnotator(SOAPAnnotator annotator) {
083: annotators.addElement(annotator);
084: }
085:
086: /**
087: * Processes an incoming <code>SOAPMessage</code> according to the SOAP
088: * Processing model given in the appropriate SOAP specification. The
089: * message is passed through one or more <code>SOAPRecipient</code> s
090: *
091: * @param message
092: * the <code>SOAPMessage</code> to be processed
093: *
094: * @return the <code>SOAPMessage</code> after processing //todo
095: * @exception SOAPException
096: * if there is an error accepting the message
097: */
098:
099: public abstract SOAPMessage acceptMessage(SOAPMessage message)
100: throws Exception;
101:
102: /**
103: * Processes an outgoing <code>SOAPMessage</code> through one or more
104: * <code>SOAPAnnotator</code>s.
105: *
106: * @param message
107: * the <code>SOAPMessage</code> to be processed
108: *
109: * @return the <code>SOAPMessage</code> after processing //todo
110: * @exception SOAPException
111: * if there is an error while preparing the message
112: */
113: public abstract SOAPMessage prepareMessage(SOAPMessage message)
114: throws Exception;
115:
116: protected abstract String getRoleAttributeValue(
117: SOAPHeaderElement element);
118: }
|