public String get(Object key) { if (!(key instanceof String)) return null; String sKey = (String) key; if (Constants.EXPORT_PACKAGE.equalsIgnoreCase(sKey) || Constants.PROVIDE_CAPABILITY.equalsIgnoreCase(sKey)) { String systemProvideHeader = getEquinoxContainer() .getConfiguration() .getConfiguration( EquinoxConfiguration.PROP_SYSTEM_PROVIDE_HEADER, EquinoxConfiguration.SYSTEM_PROVIDE_HEADER_SYSTEM_EXTRA); boolean useSystemExtra = systemProvideHeader.equals(EquinoxConfiguration.SYSTEM_PROVIDE_HEADER_SYSTEM_EXTRA); boolean useSystem = systemProvideHeader.equals(EquinoxConfiguration.SYSTEM_PROVIDE_HEADER_SYSTEM) || useSystemExtra; String systemProp = useSystem ? (Constants.EXPORT_PACKAGE.equalsIgnoreCase(sKey) ? Constants.FRAMEWORK_SYSTEMPACKAGES : Constants.FRAMEWORK_SYSTEMCAPABILITIES) : null; String systemExtraProp = useSystemExtra ? (Constants.EXPORT_PACKAGE.equalsIgnoreCase(sKey) ? Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA : Constants.FRAMEWORK_SYSTEMCAPABILITIES_EXTRA) : null; return getExtra(sKey, systemProp, systemExtraProp); } return headers.get(key); }
private String getExtra(String header, String systemProp, String systemExtraProp) { String systemValue = systemProp != null ? getEquinoxContainer().getConfiguration().getConfiguration(systemProp) : null; String systemExtraValue = systemExtraProp != null ? getEquinoxContainer().getConfiguration().getConfiguration(systemExtraProp) : null; if (systemValue == null) systemValue = systemExtraValue; else if (systemExtraValue != null && systemExtraValue.trim().length() > 0) systemValue += ", " + systemExtraValue; // $NON-NLS-1$ String result = headers.get(header); if (systemValue != null && systemValue.trim().length() > 0) { if (result != null) result += ", " + systemValue; // $NON-NLS-1$ else result = systemValue; } return result; }
public Enumeration<String> elements() { return headers.elements(); }
public String remove(Object key) { return headers.remove(key); }
public int size() { return headers.size(); }
public Enumeration<String> keys() { return headers.keys(); }
public String put(String key, String value) { return headers.put(key, value); }
public boolean isEmpty() { return headers.isEmpty(); }
public void removeAttribute(String attributeName) { Dictionary<String, Object> attributes = proxyContext.getContextAttributes(httpContext); attributes.remove(attributeName); }
public void setAttribute(String attributeName, Object attributeValue) { Dictionary<String, Object> attributes = proxyContext.getContextAttributes(httpContext); attributes.put(attributeName, attributeValue); }
public Enumeration<String> getAttributeNames() { Dictionary<String, Object> attributes = proxyContext.getContextAttributes(httpContext); return attributes.keys(); }
public Object getAttribute(String attributeName) { Dictionary<String, Object> attributes = proxyContext.getContextAttributes(httpContext); return attributes.get(attributeName); }