Source Code Cross Referenced for SAAJMetaFactory.java in  » 6.0-JDK-Core » xml » javax » xml » soap » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » xml » javax.xml.soap 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * $Id: SAAJMetaFactory.java,v 1.2.2.15 2005/02/11 07:26:15 vj135062 Exp $
003         * $Revision: 1.2.2.15 $
004         * $Date: 2005/02/11 07:26:15 $
005         */
006
007        /*
008         * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
009         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
010         *
011         * This code is free software; you can redistribute it and/or modify it
012         * under the terms of the GNU General Public License version 2 only, as
013         * published by the Free Software Foundation.  Sun designates this
014         * particular file as subject to the "Classpath" exception as provided
015         * by Sun in the LICENSE file that accompanied this code.
016         *
017         * This code is distributed in the hope that it will be useful, but WITHOUT
018         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
019         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
020         * version 2 for more details (a copy is included in the LICENSE file that
021         * accompanied this code).
022         *
023         * You should have received a copy of the GNU General Public License version
024         * 2 along with this work; if not, write to the Free Software Foundation,
025         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
026         *
027         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
028         * CA 95054 USA or visit www.sun.com if you need additional information or
029         * have any questions.
030         */
031        package javax.xml.soap;
032
033        /**
034         * The access point for the implementation classes of the factories defined in the
035         * SAAJ API. All of the <code>newInstance</code> methods defined on factories in 
036         * SAAJ 1.3 defer to instances of this class to do the actual object creation. 
037         * The implementations of <code>newInstance()</code> methods (in SOAPFactory and MessageFactory)
038         * that existed in SAAJ 1.2 have been updated to also delegate to the SAAJMetaFactory when the SAAJ 1.2
039         * defined lookup fails to locate the Factory implementation class name. 
040         * 
041         * <p>
042         * SAAJMetaFactory is a service provider interface. There are no public methods on this
043         * class.
044         *
045         * @author SAAJ RI Development Team
046         * @since SAAJ 1.3
047         */
048
049        public abstract class SAAJMetaFactory {
050            static private final String META_FACTORY_CLASS_PROPERTY = "javax.xml.soap.MetaFactory";
051            static private final String DEFAULT_META_FACTORY_CLASS = "com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl";
052
053            static private SAAJMetaFactory instance = null;
054
055            /**
056             * Creates a new instance of a concrete <code>SAAJMetaFactory</code> object. 
057             * The SAAJMetaFactory is an SPI, it pulls the creation of the other factories together into a 
058             * single place. Changing out the SAAJMetaFactory has the effect of changing out the entire SAAJ 
059             * implementation. Service providers provide the name of their <code>SAAJMetaFactory</code>
060             * implementation. 
061             *
062             * This method uses the following ordered lookup procedure to determine the SAAJMetaFactory implementation class to load:
063             * <UL>
064             *  <LI> Use the javax.xml.soap.MetaFactory system property.
065             *  <LI> Use the properties file "lib/jaxm.properties" in the JRE directory. This configuration file is in standard 
066             * java.util.Properties format and contains the fully qualified name of the implementation class with the key being the 
067             * system property defined above. 
068             *  <LI> Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API 
069             * will look for a classname in the file META-INF/services/javax.xml.soap.MetaFactory in jars available to the runtime.
070             *  <LI> Default to com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl.
071             * </UL>
072             *
073             * @return a concrete <code>SAAJMetaFactory</code> object
074             * @exception SOAPException if there is an error in creating the <code>SAAJMetaFactory</code>
075             */
076            static synchronized SAAJMetaFactory getInstance()
077                    throws SOAPException {
078                if (instance == null) {
079                    try {
080                        instance = (SAAJMetaFactory) FactoryFinder.find(
081                                META_FACTORY_CLASS_PROPERTY,
082                                DEFAULT_META_FACTORY_CLASS);
083                    } catch (Exception e) {
084                        throw new SOAPException(
085                                "Unable to create SAAJ meta-factory"
086                                        + e.getMessage());
087                    }
088                }
089
090                return instance;
091            }
092
093            protected SAAJMetaFactory() {
094            }
095
096            /**
097             * Creates a <code>MessageFactory</code> object for 
098             * the given <code>String</code> protocol. 
099             *
100             * @param protocol a <code>String</code> indicating the protocol
101             * @exception SOAPException if there is an error in creating the
102             *            MessageFactory
103             * @see SOAPConstants#SOAP_1_1_PROTOCOL
104             * @see SOAPConstants#SOAP_1_2_PROTOCOL
105             * @see SOAPConstants#DYNAMIC_SOAP_PROTOCOL
106             */
107            protected abstract MessageFactory newMessageFactory(String protocol)
108                    throws SOAPException;
109
110            /**
111             * Creates a <code>SOAPFactory</code> object for 
112             * the given <code>String</code> protocol. 
113             *
114             * @param protocol a <code>String</code> indicating the protocol
115             * @exception SOAPException if there is an error in creating the
116             *            SOAPFactory
117             * @see SOAPConstants#SOAP_1_1_PROTOCOL
118             * @see SOAPConstants#SOAP_1_2_PROTOCOL
119             * @see SOAPConstants#DYNAMIC_SOAP_PROTOCOL
120             */
121            protected abstract SOAPFactory newSOAPFactory(String protocol)
122                    throws SOAPException;
123        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.