Tue, 06 Mar 2012 16:09:35 -0800
7150322: Stop using drop source bundles in jaxws
Reviewed-by: darcy, ohrstrom
1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
26 package com.sun.xml.internal.ws.protocol.soap;
28 import com.sun.xml.internal.ws.api.WSBinding;
29 import com.sun.xml.internal.ws.api.message.Packet;
30 import com.sun.xml.internal.ws.api.pipe.*;
31 import com.sun.xml.internal.ws.client.HandlerConfiguration;
32 import com.sun.xml.internal.ws.binding.BindingImpl;
33 import javax.xml.namespace.QName;
34 import java.util.Set;
36 /**
37 * @author Rama Pulavarthi
38 */
40 public class ServerMUTube extends MUTube {
42 private ServerTubeAssemblerContext tubeContext;
43 private final Set<String> roles;
44 private final Set<QName> handlerKnownHeaders;
46 public ServerMUTube(ServerTubeAssemblerContext tubeContext, Tube next) {
47 super(tubeContext.getEndpoint().getBinding(), next);
49 this.tubeContext = tubeContext;
51 //On Server, HandlerConfiguration does n't change after publish, so store locally
52 HandlerConfiguration handlerConfig = binding.getHandlerConfig();
53 roles = handlerConfig.getRoles();
54 handlerKnownHeaders = handlerConfig.getHandlerKnownHeaders();
55 }
57 protected ServerMUTube(ServerMUTube that, TubeCloner cloner) {
58 super(that,cloner);
59 tubeContext = that.tubeContext;
60 roles = that.roles;
61 handlerKnownHeaders = that.handlerKnownHeaders;
62 }
64 /**
65 * Do MU Header Processing on incoming message (request)
66 * @return
67 * if all the headers in the packet are understood, returns action such that
68 * next pipe will be inovked.
69 * if all the headers in the packet are not understood, returns action such that
70 * SOAPFault Message is sent to previous pipes.
71 */
72 @Override
73 public NextAction processRequest(Packet request) {
74 Set<QName> misUnderstoodHeaders = getMisUnderstoodHeaders(request.getMessage().getHeaders(),roles, handlerKnownHeaders);
75 if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) {
76 return doInvoke(super.next, request);
77 }
78 return doReturnWith(request.createServerResponse(createMUSOAPFaultMessage(misUnderstoodHeaders),
79 tubeContext.getWsdlModel(), tubeContext.getSEIModel(), tubeContext.getEndpoint().getBinding()));
80 }
82 public ServerMUTube copy(TubeCloner cloner) {
83 return new ServerMUTube(this,cloner);
84 }
86 }