-
Notifications
You must be signed in to change notification settings - Fork 15
/
SAAJMetaFactoryImpl.java
71 lines (61 loc) · 2.83 KB
/
SAAJMetaFactoryImpl.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
package com.sun.xml.messaging.saaj.soap;
import jakarta.xml.soap.SAAJMetaFactory;
import jakarta.xml.soap.SOAPConstants;
import jakarta.xml.soap.MessageFactory;
import jakarta.xml.soap.SOAPFactory;
import jakarta.xml.soap.SOAPException;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.sun.xml.messaging.saaj.util.LogDomainConstants;
public class SAAJMetaFactoryImpl extends SAAJMetaFactory {
private static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
"com.sun.xml.messaging.saaj.soap.LocalStrings");
public SAAJMetaFactoryImpl() {
}
@Override
protected MessageFactory newMessageFactory(String protocol)
throws SOAPException {
if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol)) {
return new com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl();
} else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
return new com.sun.xml.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl();
} else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
return new com.sun.xml.messaging.saaj.soap.dynamic.SOAPMessageFactoryDynamicImpl();
} else {
log.log(
Level.SEVERE,
"SAAJ0569.soap.unknown.protocol",
new Object[] {protocol.replaceAll("[\r\n]",""), "MessageFactory"});
throw new SOAPException("Unknown Protocol: " + protocol +
" specified for creating MessageFactory");
}
}
@Override
protected SOAPFactory newSOAPFactory(String protocol)
throws SOAPException {
if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol)) {
return new com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl();
} else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
return new com.sun.xml.messaging.saaj.soap.ver1_2.SOAPFactory1_2Impl();
} else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
return new com.sun.xml.messaging.saaj.soap.dynamic.SOAPFactoryDynamicImpl();
} else {
log.log(
Level.SEVERE,
"SAAJ0569.soap.unknown.protocol",
new Object[] {protocol.replaceAll("[\r\n]",""), "SOAPFactory"});
throw new SOAPException("Unknown Protocol: " + protocol +
" specified for creating SOAPFactory");
}
}
}