src/share/jaxws_classes/com/sun/xml/internal/bind/v2/package-info.java

Tue, 06 Mar 2012 16:09:35 -0800

author
ohair
date
Tue, 06 Mar 2012 16:09:35 -0800
changeset 286
f50545b5e2f1
child 397
b99d7e355d4b
permissions
-rw-r--r--

7150322: Stop using drop source bundles in jaxws
Reviewed-by: darcy, ohrstrom

ohair@286 1 /*
ohair@286 2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
ohair@286 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@286 4 *
ohair@286 5 * This code is free software; you can redistribute it and/or modify it
ohair@286 6 * under the terms of the GNU General Public License version 2 only, as
ohair@286 7 * published by the Free Software Foundation. Oracle designates this
ohair@286 8 * particular file as subject to the "Classpath" exception as provided
ohair@286 9 * by Oracle in the LICENSE file that accompanied this code.
ohair@286 10 *
ohair@286 11 * This code is distributed in the hope that it will be useful, but WITHOUT
ohair@286 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@286 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@286 14 * version 2 for more details (a copy is included in the LICENSE file that
ohair@286 15 * accompanied this code).
ohair@286 16 *
ohair@286 17 * You should have received a copy of the GNU General Public License version
ohair@286 18 * 2 along with this work; if not, write to the Free Software Foundation,
ohair@286 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@286 20 *
ohair@286 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@286 22 * or visit www.oracle.com if you need additional information or have any
ohair@286 23 * questions.
ohair@286 24 */
ohair@286 25
ohair@286 26 /**
ohair@286 27 * <h1>The JAXB 2.0 runtime</h1>.
ohair@286 28 *
ohair@286 29 * <h1>Overview</h1>
ohair@286 30 * <p>
ohair@286 31 * This module provides code that implements {@link JAXBContext}.
ohair@286 32 * Roughly speaking the runtime works like this:
ohair@286 33 *
ohair@286 34 * <ol>
ohair@286 35 * <li>There's a set of classes and interfaces that model JAXB-bound types.
ohair@286 36 * You can think of this as a reflection library for JAXB.
ohair@286 37 * <li>There's a set of classes that constitute the unmarshaller and marshaller.
ohair@286 38 * Each class represents a small portion, and they are composed to perform
ohair@286 39 * the operations.
ohair@286 40 * <li>{@link JAXBContextImpl} builds itself by reading the model and
ohair@286 41 * composing unmarshallers and marshallers.
ohair@286 42 * </ol>
ohair@286 43 *
ohair@286 44 * <h1>Interesting Pieces inside Runtime</h1>
ohair@286 45 * <p>
ohair@286 46 * The followings are the interesting pieces inside the runtime.
ohair@286 47 *
ohair@286 48 * <dl>
ohair@286 49 * <dt>{@link com.sun.xml.internal.bind.v2.model model}
ohair@286 50 * <dd>
ohair@286 51 * This set of classes and interfaces models JAXB-bound types.
ohair@286 52 *
ohair@286 53 * <dt>{@link com.sun.xml.internal.bind.v2.runtime XML I/O}
ohair@286 54 * <dd>
ohair@286 55 * This set of classes implements the JAXB API and provides the XML I/O functionality.
ohair@286 56 * </dl>
ohair@286 57 *
ohair@286 58 * <p>
ohair@286 59 * The classes <b>NOT</b> in the {@link com.sun.xml.internal.bind.v2} package (and its subpackages)
ohair@286 60 * are also used by old JAXB 1.0 clients.
ohair@286 61 *
ohair@286 62 * <h1>Models</h1>
ohair@286 63 * <p>
ohair@286 64 * "Model" is the portion of the code that represents JAXB-bound types.
ohair@286 65 *
ohair@286 66 * <p>
ohair@286 67 * The following picture illustrates the relationship among major
ohair@286 68 * packages of the binding model.
ohair@286 69 *
ohair@286 70 * <div>
ohair@286 71 * <img src="doc-files/packages.png"/>
ohair@286 72 * </div>
ohair@286 73 *
ohair@286 74 * <p>
ohair@286 75 * The core model contracts are all interfaces, and they are parameterized
ohair@286 76 * so that they can be used
ohair@286 77 * with different reflection libraries. This is necessary, as the model
ohair@286 78 * is used:
ohair@286 79 * <ol>
ohair@286 80 * <li> at runtime to process loaded classes,
ohair@286 81 * <li> at tool-time to process source files / class files, and
ohair@286 82 * <li> at schema compile time to generate source code.
ohair@286 83 * </ol>
ohair@286 84 * They all use different reflection libraries.
ohair@286 85 *
ohair@286 86 * <p>
ohair@286 87 * This portion is used by all
ohair@286 88 * three running mode of JAXB.
ohair@286 89 * <a href="model/impl/package-summary.html">The corresponding base-level implementaion</a>
ohair@286 90 * is also parameterized.
ohair@286 91 *
ohair@286 92 * <p>
ohair@286 93 * The runtime model contract and implementation are used only at the run-time.
ohair@286 94 * These packages fix the parameterization to the Java reflection,
ohair@286 95 * and also exposes additional functionalities to actually do the
ohair@286 96 * unmarshalling/marshalling. These classes have "Runtime" prefix.
ohair@286 97 *
ohair@286 98 * <p>
ohair@286 99 * Finally XJC has its own implementation of the contract in
ohair@286 100 * its own package. This package also fixes the parameterization
ohair@286 101 * to its own reflection library.
ohair@286 102 *
ohair@286 103 * <p>
ohair@286 104 * When you work on the code, it is often helpful to know the layer you are in.
ohair@286 105 *
ohair@286 106 *
ohair@286 107 * <p>
ohair@286 108 * The binding model design roughly looks like the following.
ohair@286 109 * For more details, see the javadoc of each component.
ohair@286 110 *
ohair@286 111 * <div>
ohair@286 112 * <img src="doc-files/j2s_architecture.gif"/>
ohair@286 113 * </div>
ohair@286 114 *
ohair@286 115 * <b><i>TODO: link to classes from above pictures</i></b>
ohair@286 116 *
ohair@286 117 *
ohair@286 118 * <h3>Evolution Rules</h3>
ohair@286 119 * None of the class in this package or below should be directly
ohair@286 120 * referenced by the generated code. Hence they can be changed freely
ohair@286 121 * from versions to versions.
ohair@286 122 *
ohair@286 123 *
ohair@286 124 *
ohair@286 125 *
ohair@286 126 * <h1>Performance Characteristics</h1>
ohair@286 127 * <p>
ohair@286 128 * Model construction happens inside {@link JAXBContext#newInstance(Class[])}.
ohair@286 129 * It's desirable for this step to be fast and consume less memory,
ohair@286 130 * but it's not too performance sensitive.
ohair@286 131 *
ohair@286 132 * <p>
ohair@286 133 * Code that implements the unmarshaller and the marshaller OTOH
ohair@286 134 * needs to be very carefully written to achieve maximum sustaining
ohair@286 135 * performance.
ohair@286 136 *
ohair@286 137 *
ohair@286 138 *
ohair@286 139 *
ohair@286 140 * <h1>Bootstrap Sequence</h1>
ohair@286 141 * <p>
ohair@286 142 * The following picture illustrates how the {@link JAXBContext#newInstance(Class[])} method
ohair@286 143 * triggers activities.
ohair@286 144 *
ohair@286 145 * {@SequenceDiagram
ohair@286 146 boxwid=1.2;
ohair@286 147
ohair@286 148 pobject(U,"user");
ohair@286 149 object(A,"JAXB API");
ohair@286 150 object(CF,"ContextFactory");
ohair@286 151 pobject(JC);
ohair@286 152 step();
ohair@286 153
ohair@286 154 message(U,A,"JAXBContext.newInstance()");
ohair@286 155 active(A);
ohair@286 156 message(A,A,"locate JAXB RI 2.0");
ohair@286 157 active(A);
ohair@286 158 step();
ohair@286 159 inactive(A);
ohair@286 160
ohair@286 161 message(A,CF,"createContext");
ohair@286 162 active(CF);
ohair@286 163
ohair@286 164 create_message(CF,JC,"c:JAXBContextImpl");
ohair@286 165 active(JC);
ohair@286 166
ohair@286 167 message(JC,JC,"build runtime model");
ohair@286 168 message(JC,JC,"build JaxBeanInfos");
ohair@286 169 inactive(JC);
ohair@286 170
ohair@286 171 rmessage(A,U,"return c");
ohair@286 172 inactive(CF);
ohair@286 173 inactive(A);
ohair@286 174
ohair@286 175 complete(JC);
ohair@286 176 complete(CF);
ohair@286 177 complete(A);
ohair@286 178 * }
ohair@286 179 *
ohair@286 180 * @ArchitectureDocument
ohair@286 181 */
ohair@286 182 package com.sun.xml.internal.bind.v2;
ohair@286 183
ohair@286 184 import javax.xml.bind.JAXBContext;
ohair@286 185
ohair@286 186 import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;

mercurial