src/share/jaxws_classes/com/oracle/webservices/internal/api/message/DistributedPropertySet.java

changeset 0
373ffda63c9a
child 637
9c07ef4934dd
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/DistributedPropertySet.java	Wed Apr 27 01:27:09 2016 +0800
     1.3 @@ -0,0 +1,81 @@
     1.4 +/*
     1.5 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 + *
     1.8 + * This code is free software; you can redistribute it and/or modify it
     1.9 + * under the terms of the GNU General Public License version 2 only, as
    1.10 + * published by the Free Software Foundation.  Oracle designates this
    1.11 + * particular file as subject to the "Classpath" exception as provided
    1.12 + * by Oracle in the LICENSE file that accompanied this code.
    1.13 + *
    1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 + * version 2 for more details (a copy is included in the LICENSE file that
    1.18 + * accompanied this code).
    1.19 + *
    1.20 + * You should have received a copy of the GNU General Public License version
    1.21 + * 2 along with this work; if not, write to the Free Software Foundation,
    1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 + *
    1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 + * or visit www.oracle.com if you need additional information or have any
    1.26 + * questions.
    1.27 + */
    1.28 +
    1.29 +package com.oracle.webservices.internal.api.message;
    1.30 +
    1.31 +import java.util.Map;
    1.32 +
    1.33 +import com.sun.istack.internal.Nullable;
    1.34 +
    1.35 +/**
    1.36 + * {@link PropertySet} that combines properties exposed from multiple
    1.37 + * {@link PropertySet}s into one.
    1.38 + *
    1.39 + * <p>
    1.40 + * This implementation allows one {@link PropertySet} to assemble
    1.41 + * all properties exposed from other "satellite" {@link PropertySet}s.
    1.42 + * (A satellite may itself be a {@link DistributedPropertySet}, so
    1.43 + * in general this can form a tree.)
    1.44 + *
    1.45 + * <p>
    1.46 + * This is useful for JAX-WS because the properties we expose to the application
    1.47 + * are contributed by different pieces, and therefore we'd like each of them
    1.48 + * to have a separate {@link PropertySet} implementation that backs up
    1.49 + * the properties. For example, this allows FastInfoset to expose its
    1.50 + * set of properties to {@link RequestContext} by using a strongly-typed fields.
    1.51 + *
    1.52 + * <p>
    1.53 + * This is also useful for a client-side transport to expose a bunch of properties
    1.54 + * into {@link ResponseContext}. It simply needs to create a {@link PropertySet}
    1.55 + * object with methods for each property it wants to expose, and then add that
    1.56 + * {@link PropertySet} to {@link Packet}. This allows property values to be
    1.57 + * lazily computed (when actually asked by users), thus improving the performance
    1.58 + * of the typical case where property values are not asked.
    1.59 + *
    1.60 + * <p>
    1.61 + * A similar benefit applies on the server-side, for a transport to expose
    1.62 + * a bunch of properties to {@link WebServiceContext}.
    1.63 + *
    1.64 + * <p>
    1.65 + * To achieve these benefits, access to {@link DistributedPropertySet} is slower
    1.66 + * compared to {@link PropertySet} (such as get/set), while adding a satellite
    1.67 + * object is relatively fast.
    1.68 + *
    1.69 + * @author Kohsuke Kawaguchi
    1.70 + */
    1.71 +public interface DistributedPropertySet extends com.oracle.webservices.internal.api.message.PropertySet {
    1.72 +
    1.73 +    public @Nullable <T extends com.oracle.webservices.internal.api.message.PropertySet> T getSatellite(Class<T> satelliteClass);
    1.74 +
    1.75 +    public Map<Class<? extends com.oracle.webservices.internal.api.message.PropertySet>, com.oracle.webservices.internal.api.message.PropertySet> getSatellites();
    1.76 +
    1.77 +    public void addSatellite(com.oracle.webservices.internal.api.message.PropertySet satellite);
    1.78 +
    1.79 +    public void addSatellite(Class<? extends com.oracle.webservices.internal.api.message.PropertySet> keyClass, com.oracle.webservices.internal.api.message.PropertySet satellite);
    1.80 +
    1.81 +    public void removeSatellite(com.oracle.webservices.internal.api.message.PropertySet satellite);
    1.82 +
    1.83 +    public void copySatelliteInto(com.oracle.webservices.internal.api.message.MessageContext r);
    1.84 +}

mercurial