01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.ws.rm.policy;
19:
20: import java.util.ArrayList;
21: import java.util.Collection;
22:
23: import javax.xml.namespace.QName;
24:
25: import org.apache.cxf.Bus;
26: import org.apache.cxf.interceptor.AbstractAttributedInterceptorProvider;
27: import org.apache.cxf.ws.policy.PolicyInterceptorProvider;
28: import org.apache.cxf.ws.rm.RMInInterceptor;
29: import org.apache.cxf.ws.rm.RMOutInterceptor;
30: import org.apache.cxf.ws.rm.soap.RMSoapInterceptor;
31:
32: public class RMPolicyInterceptorProvider extends
33: AbstractAttributedInterceptorProvider implements
34: PolicyInterceptorProvider {
35:
36: private static final Collection<QName> ASSERTION_TYPES;
37: private RMInInterceptor rmIn = new RMInInterceptor();
38: private RMOutInterceptor rmOut = new RMOutInterceptor();
39: private RMSoapInterceptor rmSoap = new RMSoapInterceptor();
40:
41: static {
42: Collection<QName> types = new ArrayList<QName>();
43: types.add(new QName(
44: "http://schemas.xmlsoap.org/ws/2005/02/rm/policy",
45: "RMAssertion"));
46: ASSERTION_TYPES = types;
47: }
48:
49: public RMPolicyInterceptorProvider(Bus bus) {
50: super ();
51: rmIn.setBus(bus);
52: rmOut.setBus(bus);
53:
54: getInInterceptors().add(rmIn);
55: getInInterceptors().add(rmSoap);
56:
57: getOutInterceptors().add(rmOut);
58: getOutInterceptors().add(rmSoap);
59:
60: getInFaultInterceptors().add(rmIn);
61: getInFaultInterceptors().add(rmSoap);
62:
63: getOutFaultInterceptors().add(rmOut);
64: getOutFaultInterceptors().add(rmSoap);
65: }
66:
67: public Collection<QName> getAssertionTypes() {
68: return ASSERTION_TYPES;
69: }
70: }
|