325N/A/*
478N/A * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
325N/A *
325N/A * This code is free software; you can redistribute it and/or modify it
325N/A * under the terms of the GNU General Public License version 2 only, as
325N/A * published by the Free Software Foundation. Oracle designates this
325N/A * particular file as subject to the "Classpath" exception as provided
325N/A * by Oracle in the LICENSE file that accompanied this code.
325N/A *
325N/A * This code is distributed in the hope that it will be useful, but WITHOUT
325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
325N/A * version 2 for more details (a copy is included in the LICENSE file that
325N/A * accompanied this code).
325N/A *
325N/A * You should have received a copy of the GNU General Public License version
325N/A * 2 along with this work; if not, write to the Free Software Foundation,
325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
325N/A *
325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
325N/A * or visit www.oracle.com if you need additional information or have any
325N/A * questions.
325N/A */
325N/A
325N/Apackage javax.xml.soap;
325N/A
325N/A/**
325N/A * A factory for creating <code>SOAPConnection</code> objects. Implementation of this class
325N/A * is optional. If <code>SOAPConnectionFactory.newInstance()</code> throws an
325N/A * UnsupportedOperationException then the implementation does not support the
325N/A * SAAJ communication infrastructure. Otherwise {@link SOAPConnection} objects
325N/A * can be created by calling <code>createConnection()</code> on the newly
325N/A * created <code>SOAPConnectionFactory</code> object.
325N/A */
325N/Apublic abstract class SOAPConnectionFactory {
325N/A /**
325N/A * A constant representing the default value for a <code>SOAPConnection</code>
325N/A * object. The default is the point-to-point SOAP connection.
325N/A */
478N/A static final String DEFAULT_SOAP_CONNECTION_FACTORY
325N/A = "com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnectionFactory";
325N/A
325N/A /**
325N/A * A constant representing the <code>SOAPConnection</code> class.
325N/A */
325N/A static private final String SF_PROPERTY
325N/A = "javax.xml.soap.SOAPConnectionFactory";
325N/A
325N/A /**
325N/A * Creates an instance of the default
325N/A * <code>SOAPConnectionFactory</code> object.
325N/A *
325N/A * @return a new instance of a default
325N/A * <code>SOAPConnectionFactory</code> object
325N/A *
325N/A * @exception SOAPException if there was an error creating the
325N/A * <code>SOAPConnectionFactory</code>
325N/A *
325N/A * @exception UnsupportedOperationException if newInstance is not
325N/A * supported.
325N/A */
325N/A public static SOAPConnectionFactory newInstance()
325N/A throws SOAPException, UnsupportedOperationException
325N/A {
325N/A try {
325N/A return (SOAPConnectionFactory)
325N/A FactoryFinder.find(SF_PROPERTY,
325N/A DEFAULT_SOAP_CONNECTION_FACTORY);
325N/A } catch (Exception ex) {
325N/A throw new SOAPException("Unable to create SOAP connection factory: "
325N/A +ex.getMessage());
325N/A }
325N/A }
325N/A
325N/A /**
325N/A * Create a new <code>SOAPConnection</code>.
325N/A *
325N/A * @return the new <code>SOAPConnection</code> object.
325N/A *
325N/A * @exception SOAPException if there was an exception creating the
325N/A * <code>SOAPConnection</code> object.
325N/A */
325N/A public abstract SOAPConnection createConnection()
325N/A throws SOAPException;
325N/A}