Java Code Examples for org.apache.cxf.service.model.BindingOperationInfo#setProperty()

The following examples show how to use org.apache.cxf.service.model.BindingOperationInfo#setProperty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PolicyEngineImpl.java    From cxf with Apache License 2.0 6 votes vote down vote up
public EffectivePolicy getEffectiveClientRequestPolicy(EndpointInfo ei, BindingOperationInfo boi,
                                                       Conduit c, Message m) {
    EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_REQUEST_CLIENT);
    if (effectivePolicy == null) {
        synchronized (ei) {
            effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_REQUEST_CLIENT);
            if (null == effectivePolicy) {
                EffectivePolicyImpl epi = createOutPolicyInfo();
                Assertor assertor = PolicyUtils.createAsserter(c);
                epi.initialise(ei, boi, this, assertor, true, true, m);
                if (m != null) {
                    boi.setProperty(POLICY_INFO_REQUEST_CLIENT, epi);
                }
                effectivePolicy = epi;
            }
        }
    }
    return effectivePolicy;
}
 
Example 2
Source File: PolicyEngineImpl.java    From cxf with Apache License 2.0 6 votes vote down vote up
public EffectivePolicy getEffectiveServerRequestPolicy(EndpointInfo ei,
                                                       BindingOperationInfo boi,
                                                       Message m) {
    EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_REQUEST_SERVER);
    if (effectivePolicy == null) {
        synchronized (ei) {
            effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_REQUEST_SERVER);
            if (null == effectivePolicy) {
                EffectivePolicyImpl epi = createOutPolicyInfo();
                epi.initialise(ei, boi, this, false, true, m);
                if (m != null) {
                    boi.setProperty(POLICY_INFO_REQUEST_SERVER, epi);
                }
                effectivePolicy = epi;
            }
        }
    }
    return effectivePolicy;
}
 
Example 3
Source File: PolicyEngineImpl.java    From cxf with Apache License 2.0 6 votes vote down vote up
public EffectivePolicy getEffectiveClientResponsePolicy(EndpointInfo ei,
                                                        BindingOperationInfo boi,
                                                        Message m) {
    EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_RESPONSE_CLIENT);
    if (effectivePolicy == null) {
        synchronized (ei) {
            effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_RESPONSE_CLIENT);
            if (null == effectivePolicy) {
                EffectivePolicyImpl epi = createOutPolicyInfo();
                epi.initialise(ei, boi, this, true, false, m);
                if (m != null) {
                    boi.setProperty(POLICY_INFO_RESPONSE_CLIENT, epi);
                }
                effectivePolicy = epi;
            }
        }
    }
    return effectivePolicy;
}
 
Example 4
Source File: AbstractMetricsInterceptor.java    From cxf with Apache License 2.0 6 votes vote down vote up
private Object createMetricsContextForOperation(Message message, BindingOperationInfo boi) {
    Object o = boi.getProperty(MetricsContext.class.getName());
    if (o == null) {
        List<MetricsContext> contexts = new ArrayList<>();
        for (MetricsProvider p : getMetricProviders(message.getExchange().getBus())) {
            MetricsContext c = p.createOperationContext(message.getExchange().getEndpoint(),
                                     boi, MessageUtils.isRequestor(message),
                                     (String)message.getContextualProperty(MetricsProvider.CLIENT_ID));
            if (c != null) {
                contexts.add(c);
            }
            if (c instanceof Closeable) {
                message.getExchange().getEndpoint().addCleanupHook((Closeable)c);
            }
        }
        if (contexts.size() == 1) {
            o = contexts.get(0);
        } else {
            o = contexts;
        }
        boi.setProperty(MetricsContext.class.getName(), o);
    }
    return o;
}
 
Example 5
Source File: JaxWsServerFactoryBean.java    From cxf with Apache License 2.0 4 votes vote down vote up
@Override
protected BindingInfo createBindingInfo() {
    JaxWsServiceFactoryBean sf = (JaxWsServiceFactoryBean)getServiceFactory();

    JaxWsImplementorInfo implInfo = sf.getJaxWsImplementorInfo();
    String jaxBid = implInfo.getBindingType();
    String binding = getBindingId();
    if (binding == null) {
        binding = jaxBid;
        setBindingId(binding);
    }

    if (binding.equals(SOAPBinding.SOAP11HTTP_BINDING)
        || binding.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)) {
        binding = "http://schemas.xmlsoap.org/wsdl/soap/";
        setBindingId(binding);
        if (getBindingConfig() == null) {
            setBindingConfig(new JaxWsSoapBindingConfiguration(sf));
        }
    } else if (binding.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) {
        binding = SOAPBinding.SOAP12HTTP_BINDING;
        setBindingId(binding);
        if (getBindingConfig() == null) {
            setBindingConfig(new JaxWsSoapBindingConfiguration(sf));
        }
    }

    if (getBindingConfig() instanceof JaxWsSoapBindingConfiguration) {
        JaxWsSoapBindingConfiguration conf = (JaxWsSoapBindingConfiguration)getBindingConfig();

        if (jaxBid.equals(SOAPBinding.SOAP12HTTP_BINDING)) {
            conf.setVersion(Soap12.getInstance());
        }

        if (jaxBid.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) {
            conf.setVersion(Soap12.getInstance());
            conf.setMtomEnabled(true);
        }
        if (jaxBid.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)) {
            conf.setMtomEnabled(true);
        }

        if (transportId != null) {
            conf.setTransportURI(transportId);
        }
        conf.setJaxWsServiceFactoryBean(sf);

    }

    BindingInfo bindingInfo = super.createBindingInfo();

    if (implInfo.isWebServiceProvider()) {
        bindingInfo.getService().setProperty("soap.force.doclit.bare", Boolean.TRUE);
        if (this.getServiceFactory().isPopulateFromClass()) {
            for (EndpointInfo ei : bindingInfo.getService().getEndpoints()) {
                ei.setProperty("soap.no.validate.parts", Boolean.TRUE);
            }
            //Provider, but no wsdl.  Synthetic ops
            for (BindingOperationInfo op : bindingInfo.getOperations()) {
                op.setProperty("operation.is.synthetic", Boolean.TRUE);
                op.getOperationInfo().setProperty("operation.is.synthetic", Boolean.TRUE);
            }
        }
    }

    return bindingInfo;
}
 
Example 6
Source File: PolicyEngineImpl.java    From cxf with Apache License 2.0 4 votes vote down vote up
public void setEffectiveClientRequestPolicy(EndpointInfo ei, BindingOperationInfo boi,
                                            EffectivePolicy ep) {
    boi.setProperty(POLICY_INFO_REQUEST_CLIENT, ep);
}
 
Example 7
Source File: PolicyEngineImpl.java    From cxf with Apache License 2.0 4 votes vote down vote up
public void setEffectiveServerResponsePolicy(EndpointInfo ei, BindingOperationInfo boi,
                                             EffectivePolicy ep) {
    boi.setProperty(POLICY_INFO_RESPONSE_SERVER, ep);
}
 
Example 8
Source File: PolicyEngineImpl.java    From cxf with Apache License 2.0 4 votes vote down vote up
public void setEffectiveServerRequestPolicy(EndpointInfo ei, BindingOperationInfo boi,
                                            EffectivePolicy ep) {
    boi.setProperty(POLICY_INFO_REQUEST_SERVER, ep);
}
 
Example 9
Source File: PolicyEngineImpl.java    From cxf with Apache License 2.0 4 votes vote down vote up
public void setEffectiveClientResponsePolicy(EndpointInfo ei, BindingOperationInfo boi,
                                             EffectivePolicy ep) {
    boi.setProperty(POLICY_INFO_RESPONSE_CLIENT, ep);
}