Class BaseDistributedPropertySet
- java.lang.Object
-
- com.oracle.webservices.api.message.BasePropertySet
-
- com.oracle.webservices.api.message.BaseDistributedPropertySet
-
- All Implemented Interfaces:
DistributedPropertySet,PropertySet
- Direct Known Subclasses:
DistributedPropertySet,Packet,RequestContext
public abstract class BaseDistributedPropertySet extends BasePropertySet implements DistributedPropertySet
PropertySetthat combines properties exposed from multiplePropertySets into one.This implementation allows one
PropertySetto assemble all properties exposed from other "satellite"PropertySets. (A satellite may itself be aDistributedPropertySet, 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
PropertySetimplementation that backs up the properties. For example, this allows FastInfoset to expose its set of properties toRequestContextby 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 aPropertySetobject with methods for each property it wants to expose, and then add thatPropertySettoPacket. 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
DistributedPropertySetis slower compared toPropertySet(such as get/set), while adding a satellite object is relatively fast.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.oracle.webservices.api.message.BasePropertySet
BasePropertySet.Accessor, BasePropertySet.PropertyMap, BasePropertySet.PropertyMapEntry
-
Nested classes/interfaces inherited from interface com.oracle.webservices.api.message.PropertySet
PropertySet.Property
-
-
Constructor Summary
Constructors Constructor Description BaseDistributedPropertySet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSatellite(PropertySet satellite)voidaddSatellite(Class<? extends PropertySet> keyClass, PropertySet satellite)protected Map<String,Object>asMapLocal()booleancontainsKey(Object key)voidcopySatelliteInto(DistributedPropertySet r)voidcopySatelliteInto(MessageContext r)protected voidcreateEntrySet(Set<Map.Entry<String,Object>> core)protected Map<String,Object>createView()Objectget(Object key)Gets the name of the property.<T extends PropertySet>
TgetSatellite(Class<T> satelliteClass)Map<Class<? extends PropertySet>,PropertySet>getSatellites()Objectput(String key, Object value)Sets a property.Objectremove(Object key)voidremoveSatellite(PropertySet satellite)booleansupports(Object key)Checks if thisPropertySetsupports a property of the given name.protected booleansupportsLocal(Object key)-
Methods inherited from class com.oracle.webservices.api.message.BasePropertySet
asMap, createMapView, getPropertyMap, mapAllowsAdditionalProperties, parse
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.oracle.webservices.api.message.PropertySet
asMap, createMapView
-
-
-
-
Method Detail
-
addSatellite
public void addSatellite(@NotNull PropertySet satellite)
- Specified by:
addSatellitein interfaceDistributedPropertySet
-
addSatellite
public void addSatellite(@NotNull Class<? extends PropertySet> keyClass, @NotNull PropertySet satellite)
- Specified by:
addSatellitein interfaceDistributedPropertySet
-
removeSatellite
public void removeSatellite(PropertySet satellite)
- Specified by:
removeSatellitein interfaceDistributedPropertySet
-
copySatelliteInto
public void copySatelliteInto(@NotNull DistributedPropertySet r)
-
copySatelliteInto
public void copySatelliteInto(MessageContext r)
- Specified by:
copySatelliteIntoin interfaceDistributedPropertySet
-
getSatellite
@Nullable public <T extends PropertySet> T getSatellite(Class<T> satelliteClass)
- Specified by:
getSatellitein interfaceDistributedPropertySet
-
getSatellites
public Map<Class<? extends PropertySet>,PropertySet> getSatellites()
- Specified by:
getSatellitesin interfaceDistributedPropertySet
-
get
public Object get(Object key)
Description copied from class:BasePropertySetGets the name of the property.- Specified by:
getin interfacePropertySet- Overrides:
getin classBasePropertySet- Parameters:
key- This field is typed asObjectto follow theMap.get(Object)convention, but if anything butStringis passed, this method just returns null.
-
put
public Object put(String key, Object value)
Description copied from class:BasePropertySetSets 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:
putin interfacePropertySet- Overrides:
putin classBasePropertySet- See Also:
PropertySet.Property
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfacePropertySet- Overrides:
containsKeyin classBasePropertySet
-
supports
public boolean supports(Object key)
Description copied from class:BasePropertySetChecks if thisPropertySetsupports a property of the given name.- Specified by:
supportsin interfacePropertySet- Overrides:
supportsin classBasePropertySet
-
remove
public Object remove(Object key)
- Specified by:
removein interfacePropertySet- Overrides:
removein classBasePropertySet
-
createEntrySet
protected void createEntrySet(Set<Map.Entry<String,Object>> core)
- Overrides:
createEntrySetin classBasePropertySet
-
supportsLocal
protected boolean supportsLocal(Object key)
-
createView
protected Map<String,Object> createView()
- Overrides:
createViewin classBasePropertySet
-
-