com.sun.xml.ws.api
Class DistributedPropertySet
java.lang.Object
com.sun.xml.ws.api.PropertySet
com.sun.xml.ws.api.DistributedPropertySet
- All Implemented Interfaces:
- org.jvnet.ws.message.DistributedPropertySet, org.jvnet.ws.message.PropertySet
- Direct Known Subclasses:
- Packet, RequestContext
public abstract class DistributedPropertySet
- extends PropertySet
- implements org.jvnet.ws.message.DistributedPropertySet
PropertySet
that combines properties exposed from multiple
PropertySet
s into one.
This implementation allows one PropertySet
to assemble
all properties exposed from other "satellite" PropertySet
s.
(A satellite may itself be a DistributedPropertySet
, so
in general this can form a tree.)
This is useful for JAX-WS because the properties we expose to the application
are contributed by different pieces, and therefore we'd like each of them
to have a separate PropertySet
implementation that backs up
the properties. For example, this allows FastInfoset to expose its
set of properties to RequestContext
by using a strongly-typed fields.
This is also useful for a client-side transport to expose a bunch of properties
into ResponseContext
. It simply needs to create a PropertySet
object with methods for each property it wants to expose, and then add that
PropertySet
to Packet
. This allows property values to be
lazily computed (when actually asked by users), thus improving the performance
of the typical case where property values are not asked.
A similar benefit applies on the server-side, for a transport to expose
a bunch of properties to WebServiceContext
.
To achieve these benefits, access to DistributedPropertySet
is slower
compared to PropertySet
(such as get/set), while adding a satellite
object is relatively fast.
Nested classes/interfaces inherited from interface org.jvnet.ws.message.PropertySet |
org.jvnet.ws.message.PropertySet.Property |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jvnet.ws.message.PropertySet |
containsKey, createMapView |
DistributedPropertySet
public DistributedPropertySet()
addSatellite
public void addSatellite(@NotNull
PropertySet satellite)
addSatellite
public void addSatellite(@NotNull
Class keyClass,
@NotNull
PropertySet satellite)
copySatelliteInto
public void copySatelliteInto(@NotNull
DistributedPropertySet r)
getSatellite
@Nullable
public <T extends org.jvnet.ws.message.PropertySet> T getSatellite(Class<T> satelliteClass)
- Specified by:
getSatellite
in interface org.jvnet.ws.message.DistributedPropertySet
get
public Object get(Object key)
- Description copied from class:
PropertySet
- Gets the name of the property.
- Specified by:
get
in interface org.jvnet.ws.message.PropertySet
- Overrides:
get
in class PropertySet
- Parameters:
key
- This field is typed as Object
to follow the HashMap.get(Object)
convention, but if anything but String
is passed, this method
just returns null.
put
public Object put(String key,
Object value)
- Description copied from class:
PropertySet
- Sets a property.
Implementation Note
This method is slow. Code inside JAX-WS should define strongly-typed
fields in this class and access them directly, instead of using this.
- Specified by:
put
in interface org.jvnet.ws.message.PropertySet
- Overrides:
put
in class PropertySet
- See Also:
Property
supports
public boolean supports(Object key)
- Description copied from class:
PropertySet
- Checks if this
PropertySet
supports a property of the given name.
- Specified by:
supports
in interface org.jvnet.ws.message.PropertySet
- Overrides:
supports
in class PropertySet
remove
public Object remove(Object key)
- Specified by:
remove
in interface org.jvnet.ws.message.PropertySet
- Overrides:
remove
in class PropertySet
createEntrySet
void createEntrySet(Set<Map.Entry<String,Object>> core)
- Overrides:
createEntrySet
in class PropertySet
addSatellite
public void addSatellite(org.jvnet.ws.message.PropertySet satellite)
- Specified by:
addSatellite
in interface org.jvnet.ws.message.DistributedPropertySet
addSatellite
public void addSatellite(@NotNull
Class keyClass,
@NotNull
org.jvnet.ws.message.PropertySet satellite)
- Specified by:
addSatellite
in interface org.jvnet.ws.message.DistributedPropertySet
removeSatellite
public void removeSatellite(org.jvnet.ws.message.PropertySet satellite)
- Specified by:
removeSatellite
in interface org.jvnet.ws.message.DistributedPropertySet
copySatelliteInto
public void copySatelliteInto(org.jvnet.ws.message.MessageContext r)
- Specified by:
copySatelliteInto
in interface org.jvnet.ws.message.DistributedPropertySet
Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved.