gpt4 book ai didi

org.apache.cxf.ws.policy.WSPolicyFeature类的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 02:31:05 26 4
gpt4 key购买 nike

本文整理了Java中org.apache.cxf.ws.policy.WSPolicyFeature类的一些代码示例,展示了WSPolicyFeature类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WSPolicyFeature类的具体详情如下:
包路径:org.apache.cxf.ws.policy.WSPolicyFeature
类名称:WSPolicyFeature

WSPolicyFeature介绍

[英]Configures a Server, Client, Bus with the specified policies. If a series of Policy Elements are supplied, these will be loaded into a Policy class using the PolicyBuilder extension on the bus. If the PolicyEngine has not been started, this feature will start it.
[中]使用指定的策略配置服务器、客户端和总线。如果提供了一系列策略Element,这些策略将使用总线上的PolicyBuilder扩展加载到策略类中。如果PolicyEngine尚未启动,此功能将启动它。

代码示例

代码示例来源:origin: Talend/tesb-rt-se

WSPolicyFeature policyFeature = new WSPolicyFeature();
policyFeature.setPolicies(policies);
locatorEndpoint.getFeatures().add(policyFeature);
    policyFeature.initialize(sr, currentBus);

代码示例来源:origin: org.apache.cxf/cxf-rt-ws-policy

@Override
public void initialize(Client client, Bus bus) {
  Endpoint endpoint = client.getEndpoint();
  Policy p = initializeEndpointPolicy(endpoint, bus);
  PolicyEngine pe = bus.getExtension(PolicyEngine.class);
  EndpointInfo ei = endpoint.getEndpointInfo();
  EndpointPolicy ep = pe.getClientEndpointPolicy(ei, null, null);
  pe.setClientEndpointPolicy(ei, ep.updatePolicy(p, createMessage(endpoint, bus)));
}

代码示例来源:origin: apache/cxf

public void setupServer(boolean mtomRequired, String address) throws Exception {
  getStaticBus().getExtension(PolicyEngine.class).setAlternativeSelector(
    new FirstAlternativeSelector());
  JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
  sf.setServiceBean(new EchoService());
  sf.setBus(getStaticBus());
  sf.setAddress(address);
  WSPolicyFeature policyFeature = new WSPolicyFeature();
  List<Element> policyElements = new ArrayList<>();
  if (mtomRequired) {
    policyElements.add(StaxUtils.read(
      getClass().getResourceAsStream("mtom-policy.xml"))
            .getDocumentElement());
  } else {
    policyElements.add(StaxUtils.read(
      getClass().getResourceAsStream("mtom-policy-optional.xml"))
            .getDocumentElement());
  }
  policyFeature.setPolicyElements(policyElements);
  sf.getFeatures().add(policyFeature);
  sf.create();
}

代码示例来源:origin: Talend/tesb-rt-se

features.add(new WSPolicyFeature(securityArguments.getPolicy()));

代码示例来源:origin: apache/cxf

QName portQName = new QName(NAMESPACE, "DoubleItPlaintextPort");
WSPolicyFeature policyFeature = new WSPolicyFeature();
Element policyElement =
  StaxUtils.read(getClass().getResourceAsStream("plaintext-pass-timestamp-policy.xml")).getDocumentElement();
policyFeature.setPolicyElements(Collections.singletonList(policyElement));

代码示例来源:origin: org.talend.esb.job/org.talend.esb.job.controller

features.add(new WSPolicyFeature(securityArguments.getPolicy()));

代码示例来源:origin: Talend/tesb-rt-se

WSPolicyFeature policyFeature = new WSPolicyFeature();
policyFeature.setPolicies(policies);
    policyFeature.initialize(server, bus);

代码示例来源:origin: apache/cxf

@Override
public void initialize(Client client, Bus bus) {
  Endpoint endpoint = client.getEndpoint();
  Policy p = initializeEndpointPolicy(endpoint, bus);
  PolicyEngine pe = bus.getExtension(PolicyEngine.class);
  EndpointInfo ei = endpoint.getEndpointInfo();
  EndpointPolicy ep = pe.getClientEndpointPolicy(ei, null, null);
  pe.setClientEndpointPolicy(ei, ep.updatePolicy(p, createMessage(endpoint, bus)));
}

代码示例来源:origin: org.talend.esb.sam.service/sam-service-soap

WSPolicyFeature policyFeature = new WSPolicyFeature();
policyFeature.setPolicies(policies);
    policyFeature.initialize(server, bus);

代码示例来源:origin: apache/cxf

@Override
public void initialize(Server server, Bus bus) {
  Endpoint endpoint = server.getEndpoint();
  Policy p = initializeEndpointPolicy(endpoint, bus);
  PolicyEngine pe = bus.getExtension(PolicyEngine.class);
  EndpointInfo ei = endpoint.getEndpointInfo();
  EndpointPolicy ep = pe.getServerEndpointPolicy(ei, null, null);
  pe.setServerEndpointPolicy(ei, ep.updatePolicy(p, createMessage(endpoint, bus)));
  // Add policy to the service model (and consequently to the WSDL)
  // FIXME - ideally this should probably be moved up to where the policies are applied to the
  // endpoint, rather than this late.  As a consequence of its location, you have to declare a
  // ws policy feature on every endpoint in order to get any policy attachments into the
  // wsdl.  Alternatively add to the WSDLServiceBuilder somehow.
  ServiceModelPolicyUpdater pu = new ServiceModelPolicyUpdater(ei);
  for (PolicyProvider pp : ((PolicyEngineImpl) pe).getPolicyProviders()) {
    if (pp instanceof ExternalAttachmentProvider) {
      pu.addPolicyAttachments(((ExternalAttachmentProvider) pp).getAttachments());
    }
  }
}

代码示例来源:origin: org.talend.esb/sam-agent

WSPolicyFeature policyFeature = new WSPolicyFeature();
policyFeature.setPolicies(policies);
policyFeature.initialize(client, bus);

代码示例来源:origin: org.apache.cxf/cxf-rt-ws-policy

@Override
public void initialize(Server server, Bus bus) {
  Endpoint endpoint = server.getEndpoint();
  Policy p = initializeEndpointPolicy(endpoint, bus);
  PolicyEngine pe = bus.getExtension(PolicyEngine.class);
  EndpointInfo ei = endpoint.getEndpointInfo();
  EndpointPolicy ep = pe.getServerEndpointPolicy(ei, null, null);
  pe.setServerEndpointPolicy(ei, ep.updatePolicy(p, createMessage(endpoint, bus)));
  // Add policy to the service model (and consequently to the WSDL)
  // FIXME - ideally this should probably be moved up to where the policies are applied to the
  // endpoint, rather than this late.  As a consequence of its location, you have to declare a
  // ws policy feature on every endpoint in order to get any policy attachments into the
  // wsdl.  Alternatively add to the WSDLServiceBuilder somehow.
  ServiceModelPolicyUpdater pu = new ServiceModelPolicyUpdater(ei);
  for (PolicyProvider pp : ((PolicyEngineImpl) pe).getPolicyProviders()) {
    if (pp instanceof ExternalAttachmentProvider) {
      pu.addPolicyAttachments(((ExternalAttachmentProvider) pp).getAttachments());
    }
  }
}

代码示例来源:origin: Talend/tesb-rt-se

WSPolicyFeature policyFeature = new WSPolicyFeature();
policyFeature.setPolicies(policies);
policyFeature.initialize(client, bus);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com