Package org.apache.cxf.ws.policy

Examples of org.apache.cxf.ws.policy.PolicyEngine


        connectionFactory = new HttpsURLConnectionFactory();
        cookies = new Cookies();
       
        // wsdl extensors are superseded by policies which in       
        // turn are superseded by injection                         
        PolicyEngine pe = bus.getExtension(PolicyEngine.class);     
        if (null != pe && pe.isEnabled() && endpointInfo.getService() != null) {                         
            clientSidePolicy =                                      
                PolicyUtils.getClient(pe, endpointInfo, this);             
        }
        CXFAuthenticator.addAuthenticator();
    }
View Full Code Here


        HttpServletResponse response = (HttpServletResponse)inMessage.get(HTTP_RESPONSE);
        return new BackChannelConduit(response);
    }

    private void initConfig() {
        PolicyEngine engine = bus.getExtension(PolicyEngine.class);
        // for a decoupled endpoint there is no service info
        if (null != engine && engine.isEnabled()
            && null != endpointInfo.getService()) {
            server = PolicyUtils.getServer(engine, endpointInfo, this);
        }
        if (null == server && WSDLLibrary.isAvailable()) {
            server = endpointInfo.getTraversedExtensor(
View Full Code Here

    private void initializeConfig() {
   
        // wsdl extensors are superseded by policies which in       
        // turn are superseded by injection                         

        PolicyEngine pe = bus.getExtension(PolicyEngine.class);     
        if (null != pe && pe.isEnabled() && endpointInfo.getService() != null) {                         
            clientSidePolicy =                                      
                PolicyUtils.getClient(pe, endpointInfo, this);             
        }                                                           

    }
View Full Code Here

    protected BindingOperationInfo findOperation(String suffix) {
        BindingInfo bi = client.getEndpoint().getBinding().getBindingInfo();
        for (BindingOperationInfo boi : bi.getOperations()) {
            SoapOperationInfo soi = boi.getExtensor(SoapOperationInfo.class);
            if (soi != null && soi.getAction() != null && soi.getAction().endsWith(suffix)) {
                PolicyEngine pe = bus.getExtension(PolicyEngine.class);
                Conduit conduit = client.getConduit();
                EffectivePolicy effectivePolicy = pe.getEffectiveClientRequestPolicy(client.getEndpoint()
                    .getEndpointInfo(), boi, conduit);
                setPolicyInternal(effectivePolicy.getPolicy());
                return boi;
            }
        }
View Full Code Here

    protected boolean isPartialResponse(Message m) {
        return Boolean.TRUE.equals(m.get(PARTIAL_RESPONSE));
    }

    private void initConfig() {
        PolicyEngine engine = bus.getExtension(PolicyEngine.class);
        // for a decoupled endpoint there is no service info
        if (null != engine && engine.isEnabled()
            && null != endpointInfo.getService()) {
            server = PolicyUtils.getServer(engine, endpointInfo, this);
        }
        if (null == server) {
            server = endpointInfo.getTraversedExtensor(
View Full Code Here

    @Test
    public void testParse() {
        Bus bus = new SpringBusFactory().createBus("org/apache/cxf/ws/policy/spring/beans.xml");
        try {
            PolicyEngine pe = bus.getExtension(PolicyEngine.class);
            assertTrue("Policy engine is not enabled", pe.isEnabled());
            assertTrue("Unknown assertions are not ignored", pe.isIgnoreUnknownAssertions());
           
            assertEquals(MaximalAlternativeSelector.class.getName(),
                         pe.getAlternativeSelector().getClass().getName());
           
           
            PolicyEngineImpl pei = (PolicyEngineImpl)pe;
            Collection<PolicyProvider> providers = pei.getPolicyProviders();
            assertEquals(4, providers.size());
View Full Code Here

        connectionFactory = new HttpsURLConnectionFactory();
        cookies = new Cookies();
       
        // wsdl extensors are superseded by policies which in       
        // turn are superseded by injection                         
        PolicyEngine pe = bus.getExtension(PolicyEngine.class);     
        if (null != pe && pe.isEnabled() && endpointInfo.getService() != null) {                         
            clientSidePolicy =                                      
                PolicyUtils.getClient(pe, endpointInfo, this);             
        }
        CXFAuthenticator.addAuthenticator();
    }
View Full Code Here

        HttpServletResponse response = (HttpServletResponse)inMessage.get(HTTP_RESPONSE);
        return new BackChannelConduit(response);
    }

    private void initConfig() {
        PolicyEngine engine = bus.getExtension(PolicyEngine.class);
        // for a decoupled endpoint there is no service info
        if (null != engine && engine.isEnabled()
            && null != endpointInfo.getService()) {
            server = PolicyUtils.getServer(engine, endpointInfo, this);
        }
        if (null == server && WSDLLibrary.isAvailable()) {
            server = endpointInfo.getTraversedExtensor(
View Full Code Here

   
    public final void setBus(Bus b) {
        bus = b;
        if (null != bus) {
            setBuilder(bus.getExtension(PolicyBuilder.class));
            PolicyEngine pe = (PolicyEngine)bus.getExtension(PolicyEngine.class);
            if (pe != null) {
                setRegistry(pe.getRegistry());
                ((PolicyEngineImpl)pe).addPolicyProvider(this);
            }
        }
    }
View Full Code Here

    private void recalcEffectivePolicy(SoapMessage message,
                                       String namespace,
                                       Policy policy) {
        Exchange ex = message.getExchange();
        Bus bus = ex.getBus();
        PolicyEngine pe = bus.getExtension(PolicyEngine.class);
        if (null == pe) {
            return;
        }
        Destination destination = ex.getDestination();
        try {
            Endpoint endpoint = message.getExchange().getEndpoint();
           
            TokenStore store = (TokenStore)message.getContextualProperty(TokenStore.class.getName());
            if (store == null) {
                store = new MemoryTokenStore();
                endpoint.getEndpointInfo().setProperty(TokenStore.class.getName(), store);
            }
            endpoint = STSUtils.createSTSEndpoint(bus,
                                                  namespace,
                                                  endpoint.getEndpointInfo().getTransportId(),
                                                  destination.getAddress().getAddress().getValue(),
                                                  message.getVersion().getBindingId(),
                                                  policy,
                                                  null);
            endpoint.getEndpointInfo().setProperty(TokenStore.class.getName(), store);
            message.getExchange().put(TokenStore.class.getName(), store);
       
            EndpointPolicy ep = pe.getServerEndpointPolicy(endpoint.getEndpointInfo(), destination);
            List<Interceptor<? extends Message>> interceptors = ep.getInterceptors();
            for (Interceptor<? extends Message> i : interceptors) {
                message.getInterceptorChain().add(i);
            }
           
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.policy.PolicyEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.