コード例 #1
0
      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);
      }
コード例 #2
0
 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;
 }
コード例 #3
0
 public Enumeration<String> elements() {
   return headers.elements();
 }
コード例 #4
0
 public String remove(Object key) {
   return headers.remove(key);
 }
コード例 #5
0
 public int size() {
   return headers.size();
 }
コード例 #6
0
 public Enumeration<String> keys() {
   return headers.keys();
 }
コード例 #7
0
 public String put(String key, String value) {
   return headers.put(key, value);
 }
コード例 #8
0
 public boolean isEmpty() {
   return headers.isEmpty();
 }
コード例 #9
0
 public void removeAttribute(String attributeName) {
   Dictionary<String, Object> attributes = proxyContext.getContextAttributes(httpContext);
   attributes.remove(attributeName);
 }
コード例 #10
0
 public void setAttribute(String attributeName, Object attributeValue) {
   Dictionary<String, Object> attributes = proxyContext.getContextAttributes(httpContext);
   attributes.put(attributeName, attributeValue);
 }
コード例 #11
0
 public Enumeration<String> getAttributeNames() {
   Dictionary<String, Object> attributes = proxyContext.getContextAttributes(httpContext);
   return attributes.keys();
 }
コード例 #12
0
 public Object getAttribute(String attributeName) {
   Dictionary<String, Object> attributes = proxyContext.getContextAttributes(httpContext);
   return attributes.get(attributeName);
 }