001: /*
002: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.xml.internal.bind.api;
027:
028: import javax.xml.bind.ValidationEventHandler;
029: import javax.xml.bind.attachment.AttachmentMarshaller;
030: import javax.xml.bind.attachment.AttachmentUnmarshaller;
031:
032: /**
033: * Holds thread specific state information for {@link Bridge}s,
034: * to make {@link Bridge} thread-safe.
035: *
036: * <p>
037: * This object cannot be used concurrently; two threads cannot
038: * use the same object with {@link Bridge}s at the same time, nor
039: * a thread can use a {@link BridgeContext} with one {@link Bridge} while
040: * the same context is in use by another {@link Bridge}.
041: *
042: * <p>
043: * {@link BridgeContext} is relatively a heavy-weight object, and
044: * therefore it is expected to be cached by the JAX-RPC RI.
045: *
046: * <p>
047: * <b>Subject to change without notice</b>.
048: *
049: * @author Kohsuke Kawaguchi
050: * @since 2.0 EA1
051: * @see Bridge
052: * @deprecated
053: * The caller no longer needs to use this, as {@link Bridge} has
054: * methods that can work without {@link BridgeContext}.
055: */
056: public abstract class BridgeContext {
057: protected BridgeContext() {
058: }
059:
060: /**
061: * Registers the error handler that receives unmarshalling/marshalling errors.
062: *
063: * @param handler
064: * can be null, in which case all errors will be considered fatal.
065: *
066: * @since 2.0 EA1
067: */
068: public abstract void setErrorHandler(ValidationEventHandler handler);
069:
070: /**
071: * Sets the {@link AttachmentMarshaller}.
072: *
073: * @since 2.0 EA1
074: */
075: public abstract void setAttachmentMarshaller(AttachmentMarshaller m);
076:
077: /**
078: * Sets the {@link AttachmentUnmarshaller}.
079: *
080: * @since 2.0 EA1
081: */
082: public abstract void setAttachmentUnmarshaller(
083: AttachmentUnmarshaller m);
084:
085: /**
086: * Gets the last {@link AttachmentMarshaller} set through
087: * {@link AttachmentMarshaller}.
088: *
089: * @since 2.0 EA2
090: */
091: public abstract AttachmentMarshaller getAttachmentMarshaller();
092:
093: /**
094: * Gets the last {@link AttachmentUnmarshaller} set through
095: * {@link AttachmentUnmarshaller}.
096: *
097: * @since 2.0 EA2
098: */
099: public abstract AttachmentUnmarshaller getAttachmentUnmarshaller();
100: }
|