private Policy loadPolicy(String location) { InputStream is = null; try { is = new FileInputStream(location); return policyBuilder.getPolicy(is); } catch (Exception e) { throw new RuntimeException("Cannot load policy", e); } finally { if (null != is) { try { is.close(); } catch (IOException e) { // just ignore } } } }
if (null != policyElements) { for (Element e : policyElements) { loadedPolicies.add(builder.getPolicy(e));
private Policy loadPolicy(String location, Bus cxf) { InputStream is = null; try { is = new FileInputStream(location); return cxf.getExtension(PolicyBuilder.class).getPolicy(is); } catch (Exception e) { throw new RuntimeException("Cannot load policy", e); } finally { if (null != is) { try { is.close(); } catch (IOException e) { // just ignore } } } }
if (null != policyElements) { for (Element e : policyElements) { loadedPolicies.add(builder.getPolicy(e));
private Policy loadPolicy(String location, Bus cxf) { InputStream is = null; try { is = new FileInputStream(location); return cxf.getExtension(PolicyBuilder.class).getPolicy(is); } catch (Exception e) { throw new RuntimeException("Cannot load policy", e); } finally { if (null != is) { try { is.close(); } catch (IOException e) { // just ignore } } } }
private Policy loadPolicy(String location, Bus cxf) { InputStream is = null; try { is = new FileInputStream(location); return cxf.getExtension(PolicyBuilder.class).getPolicy(is); } catch (Exception e) { throw new RuntimeException("Cannot load policy", e); } finally { if (null != is) { try { is.close(); } catch (IOException e) { // just ignore } } } } }
private Policy loadPolicy(String location, Bus cxf) { InputStream is = null; try { is = new FileInputStream(location); return cxf.getExtension(PolicyBuilder.class).getPolicy(is); } catch (Exception e) { throw new RuntimeException("Cannot load policy", e); } finally { if (null != is) { try { is.close(); } catch (IOException e) { // just ignore } } } }
private Policy loadPolicy(String location, Bus cxf) { InputStream is = null; try { is = new FileInputStream(location); return cxf.getExtension(PolicyBuilder.class).getPolicy(is); } catch (Exception e) { throw new RuntimeException("Cannot load policy", e); } finally { if (null != is) { try { is.close(); } catch (IOException e) { // just ignore } } } }
private Policy loadPolicy(String location, Bus cxf) { InputStream is = null; try { is = new FileInputStream(location); return cxf.getExtension(PolicyBuilder.class).getPolicy(is); } catch (Exception e) { throw new RuntimeException("Cannot load policy", e); } finally { if (null != is) { try { is.close(); } catch (IOException e) { // just ignore } } } } }
protected void setPolicyInternal(Element newPolicy) { this.setPolicyInternal(bus.getExtension(PolicyBuilder.class).getPolicy(newPolicy)); }
protected void setPolicyInternal(Element newPolicy) { this.setPolicyInternal(bus.getExtension(PolicyBuilder.class).getPolicy(newPolicy)); }
public Policy resolveReference(String uri, Element el) { if (el == null) { return null; } if (uri.equals(el.getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, PolicyConstants.WSU_ID_ATTR_NAME))) { return builder.getPolicy(el); } Element el2 = DOMUtils.getFirstElement(el); while (el2 != null) { Policy p = resolveReference(uri, el2); if (p != null) { return p; } el2 = DOMUtils.getNextElement(el2); } return null; }
public Policy resolveReference(String uri, Element el) { if (el == null) { return null; } if (uri.equals(el.getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, PolicyConstants.WSU_ID_ATTR_NAME))) { return builder.getPolicy(el); } Element el2 = DOMUtils.getFirstElement(el); while (el2 != null) { Policy p = resolveReference(uri, el2); if (p != null) { return p; } el2 = DOMUtils.getNextElement(el2); } return null; }
public Policy resolveReference(String uri) { List<UnknownExtensibilityElement> extensions = descriptionInfo.getExtensors(UnknownExtensibilityElement.class); if (extensions != null) { for (UnknownExtensibilityElement e : extensions) { if (Constants.isPolicyElement(e.getElementType()) && uri.equals(e.getElement().getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, PolicyConstants.WSU_ID_ATTR_NAME))) { return builder.getPolicy(e.getElement()); } } } return null; }
public Policy resolveReference(String uri) { List<UnknownExtensibilityElement> extensions = descriptionInfo.getExtensors(UnknownExtensibilityElement.class); if (extensions != null) { for (UnknownExtensibilityElement e : extensions) { if (Constants.isPolicyElement(e.getElementType()) && uri.equals(e.getElement().getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, PolicyConstants.WSU_ID_ATTR_NAME))) { return builder.getPolicy(e.getElement()); } } } return null; }
public Policy resolveReference(String uri) { PolicyBean pb = bus.getExtension(ConfiguredBeanLocator.class) .getBeanOfType(uri, PolicyBean.class); if (null != pb) { PolicyBuilder builder = bus.getExtension(PolicyBuilder.class); return builder.getPolicy(pb.getElement()); } return null; } };
public Policy resolveReference(String uri) { PolicyBean pb = bus.getExtension(ConfiguredBeanLocator.class) .getBeanOfType(uri, PolicyBean.class); if (null != pb) { PolicyBuilder builder = bus.getExtension(PolicyBuilder.class); return builder.getPolicy(pb.getElement()); } return null; } };
/** * Adds the policy retrieved from the configured policy loader to this message as the override * policy. * * @param message */ @Override public void handleMessage(Message message) { if (policy == null) { PolicyBuilder builder = message.getExchange().getBus().getExtension(PolicyBuilder.class); try { policy = builder.getPolicy(loader.getPolicy().getDocumentElement()); LOGGER.trace("Read in policy, adding to policy override of message."); message.put(PolicyConstants.POLICY_OVERRIDE, policy); } catch (Exception e) { throw new Fault(e); } } else { message.put(PolicyConstants.POLICY_OVERRIDE, policy); } } }