1.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/api/DistributedPropertySet.java Thu Apr 04 19:05:24 2013 -0700 1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/api/DistributedPropertySet.java Tue Apr 09 14:51:13 2013 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -26,163 +26,40 @@ 1.11 package com.sun.xml.internal.ws.api; 1.12 1.13 import com.sun.istack.internal.NotNull; 1.14 -import com.sun.istack.internal.Nullable; 1.15 -import com.sun.xml.internal.ws.api.message.Packet; 1.16 -import com.sun.xml.internal.ws.client.RequestContext; 1.17 -import com.sun.xml.internal.ws.client.ResponseContext; 1.18 - 1.19 -import javax.xml.soap.SOAPException; 1.20 -import javax.xml.soap.SOAPMessage; 1.21 -import javax.xml.ws.WebServiceContext; 1.22 -import java.util.Map.Entry; 1.23 -import java.util.IdentityHashMap; 1.24 -import java.util.Map; 1.25 -import java.util.Set; 1.26 1.27 /** 1.28 - * {@link PropertySet} that combines properties exposed from multiple 1.29 - * {@link PropertySet}s into one. 1.30 + * Placeholder for backwards compatibility. 1.31 * 1.32 - * <p> 1.33 - * This implementation allows one {@link PropertySet} to assemble 1.34 - * all properties exposed from other "satellite" {@link PropertySet}s. 1.35 - * (A satellite may itself be a {@link DistributedPropertySet}, so 1.36 - * in general this can form a tree.) 1.37 - * 1.38 - * <p> 1.39 - * This is useful for JAX-WS because the properties we expose to the application 1.40 - * are contributed by different pieces, and therefore we'd like each of them 1.41 - * to have a separate {@link PropertySet} implementation that backs up 1.42 - * the properties. For example, this allows FastInfoset to expose its 1.43 - * set of properties to {@link RequestContext} by using a strongly-typed fields. 1.44 - * 1.45 - * <p> 1.46 - * This is also useful for a client-side transport to expose a bunch of properties 1.47 - * into {@link ResponseContext}. It simply needs to create a {@link PropertySet} 1.48 - * object with methods for each property it wants to expose, and then add that 1.49 - * {@link PropertySet} to {@link Packet}. This allows property values to be 1.50 - * lazily computed (when actually asked by users), thus improving the performance 1.51 - * of the typical case where property values are not asked. 1.52 - * 1.53 - * <p> 1.54 - * A similar benefit applies on the server-side, for a transport to expose 1.55 - * a bunch of properties to {@link WebServiceContext}. 1.56 - * 1.57 - * <p> 1.58 - * To achieve these benefits, access to {@link DistributedPropertySet} is slower 1.59 - * compared to {@link PropertySet} (such as get/set), while adding a satellite 1.60 - * object is relatively fast. 1.61 - * 1.62 + * @deprecated Use com.oracle.webservices.internal.api.message.DistributedPropertySet instead. 1.63 * @author Kohsuke Kawaguchi 1.64 */ 1.65 -public abstract class DistributedPropertySet 1.66 - extends PropertySet 1.67 - implements com.sun.xml.internal.org.jvnet.ws.message.DistributedPropertySet 1.68 -{ 1.69 +public abstract class DistributedPropertySet extends com.oracle.webservices.internal.api.message.BaseDistributedPropertySet { 1.70 + 1.71 /** 1.72 - * All {@link PropertySet}s that are bundled into this {@link PropertySet}. 1.73 + * @deprecated 1.74 */ 1.75 - private final Map<Class, PropertySet> satellites = new IdentityHashMap<Class, PropertySet>(); 1.76 - 1.77 public void addSatellite(@NotNull PropertySet satellite) { 1.78 - addSatellite(satellite.getClass(), satellite); 1.79 + super.addSatellite(satellite); 1.80 } 1.81 1.82 + /** 1.83 + * @deprecated 1.84 + */ 1.85 public void addSatellite(@NotNull Class keyClass, @NotNull PropertySet satellite) { 1.86 - satellites.put(keyClass, satellite); 1.87 + super.addSatellite(keyClass, satellite); 1.88 } 1.89 1.90 + /** 1.91 + * @deprecated 1.92 + */ 1.93 public void copySatelliteInto(@NotNull DistributedPropertySet r) { 1.94 - r.satellites.putAll(this.satellites); 1.95 + super.copySatelliteInto(r); 1.96 } 1.97 1.98 - public @Nullable <T extends com.sun.xml.internal.org.jvnet.ws.message.PropertySet> T getSatellite(Class<T> satelliteClass) { 1.99 - T satellite = (T) satellites.get(satelliteClass); 1.100 - if (satellite != null) 1.101 - return satellite; 1.102 - 1.103 - for (PropertySet child : satellites.values()) { 1.104 - if (satelliteClass.isInstance(child)) { 1.105 - return satelliteClass.cast(child); 1.106 - } 1.107 - 1.108 - if (DistributedPropertySet.class.isInstance(child)) { 1.109 - satellite = DistributedPropertySet.class.cast(child).getSatellite(satelliteClass); 1.110 - if (satellite != null) { 1.111 - return satellite; 1.112 - } 1.113 - } 1.114 - } 1.115 - return null; 1.116 - } 1.117 - 1.118 - @Override 1.119 - public Object get(Object key) { 1.120 - // check satellites 1.121 - for (PropertySet child : satellites.values()) { 1.122 - if(child.supports(key)) 1.123 - return child.get(key); 1.124 - } 1.125 - 1.126 - // otherwise it must be the master 1.127 - return super.get(key); 1.128 - } 1.129 - 1.130 - @Override 1.131 - public Object put(String key, Object value) { 1.132 - // check satellites 1.133 - for (PropertySet child : satellites.values()) { 1.134 - if(child.supports(key)) 1.135 - return child.put(key,value); 1.136 - } 1.137 - 1.138 - // otherwise it must be the master 1.139 - return super.put(key,value); 1.140 - } 1.141 - 1.142 - @Override 1.143 - public boolean supports(Object key) { 1.144 - // check satellites 1.145 - for (PropertySet child : satellites.values()) { 1.146 - if(child.supports(key)) 1.147 - return true; 1.148 - } 1.149 - 1.150 - return super.supports(key); 1.151 - } 1.152 - 1.153 - @Override 1.154 - public Object remove(Object key) { 1.155 - // check satellites 1.156 - for (PropertySet child : satellites.values()) { 1.157 - if(child.supports(key)) 1.158 - return child.remove(key); 1.159 - } 1.160 - 1.161 - return super.remove(key); 1.162 - } 1.163 - 1.164 - @Override 1.165 - /*package*/ void createEntrySet(Set<Entry<String, Object>> core) { 1.166 - super.createEntrySet(core); 1.167 - for (PropertySet child : satellites.values()) { 1.168 - child.createEntrySet(core); 1.169 - } 1.170 - } 1.171 - 1.172 - public void addSatellite(com.sun.xml.internal.org.jvnet.ws.message.PropertySet satellite) { 1.173 - addSatellite((PropertySet)satellite); 1.174 - } 1.175 - 1.176 - public void addSatellite(@NotNull Class keyClass, @NotNull com.sun.xml.internal.org.jvnet.ws.message.PropertySet satellite) { 1.177 - addSatellite(keyClass, (PropertySet)satellite); 1.178 - } 1.179 - 1.180 - public void removeSatellite(com.sun.xml.internal.org.jvnet.ws.message.PropertySet satellite) { 1.181 - removeSatellite((PropertySet)satellite); 1.182 - } 1.183 - 1.184 - public void copySatelliteInto(com.sun.xml.internal.org.jvnet.ws.message.MessageContext r) { 1.185 - copySatelliteInto((DistributedPropertySet)r); 1.186 + /** 1.187 + * @deprecated 1.188 + */ 1.189 + public void removeSatellite(PropertySet satellite) { 1.190 + super.removeSatellite(satellite); 1.191 } 1.192 }