Examples of EndpointPolicy


Examples of com.netflix.staash.mesh.endpoints.EndpointPolicy

        final ScheduledExecutorService executor = Executors.newScheduledThreadPool(10);
       
        final TopicRegistry    topics   = new TopicRegistry(new MemoryTopicFactory());
        final InstanceRegistry registry = new InstanceRegistry();
        final ClientFactory    factory  = new MemoryClientFactory();
        final EndpointPolicy   endpointPolicy = new ChordEndpointPolicy();
       
        topics.createTopic("test");
        topics.addEntry("test"new Entry("Key1", "Value1", System.currentTimeMillis()));
        topics.addEntry("test"new Entry("Key2", "Value2", System.currentTimeMillis()));
       
View Full Code Here

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

            assertEquals(1,
                         xpu.getValueList("/wsdl:definitions/wsdl:binding/wsdl:operation/"
                                              + "wsp:PolicyReference[@URI='#echoIntBindingOpPolicy']", wsdl)
                             .getLength());
           
            EndpointPolicy policy = bus.getExtension(PolicyEngine.class)
                .getServerEndpointPolicy(s.getEndpoint().getEndpointInfo(), null);
            assertNotNull(policy);
            assertEquals(1, policy.getChosenAlternative().size());
        } finally {
            bus.shutdown(true);
        }
    }
View Full Code Here

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

                                                  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);
            }
           
            Collection<PolicyAssertion> assertions = ep.getVocabulary();
            if (null != assertions) {
                message.put(AssertionInfoMap.class, new AssertionInfoMap(assertions));
            }
            endpoint.getService().setInvoker(new STSInvoker());
            ex.put(Endpoint.class, endpoint);
View Full Code Here

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

        EasyMock.expect(pe.isEnabled()).andReturn(true);
        PolicyInterceptorProviderRegistry reg = control.createMock(PolicyInterceptorProviderRegistry.class);
        EasyMock.expect(bus.getExtension(PolicyInterceptorProviderRegistry.class)).andReturn(reg);
        EndpointInfo aei = control.createMock(EndpointInfo.class);
        EasyMock.expect(ae.getEndpointInfo()).andReturn(aei);
        EndpointPolicy epi = control.createMock(EndpointPolicy.class);
        EasyMock.expect(pe.getServerEndpointPolicy(aei, null)).andReturn(epi);
        EasyMock.expect(epi.getChosenAlternative()).andReturn(new ArrayList<PolicyAssertion>());

        pe.setServerEndpointPolicy(ei, epi);
        EasyMock.expectLastCall();
        BindingInfo bi = control.createMock(BindingInfo.class);
        EasyMock.expect(ei.getBinding()).andReturn(bi);
View Full Code Here

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

        rme.shutdown();
    }

    @Test
    public void testEffectivePolicyImpl() {
        EndpointPolicy ep = control.createMock(EndpointPolicy.class);
        Collection<PolicyAssertion> alt = new ArrayList<PolicyAssertion>();
        EasyMock.expect(ep.getChosenAlternative()).andReturn(alt).times(2);
        PolicyInterceptorProviderRegistry reg = control.createMock(PolicyInterceptorProviderRegistry.class);
        List<Interceptor<? extends Message>> li = new ArrayList<Interceptor<? extends Message>>();
        EasyMock.expect(reg.getInterceptors(alt, true, false)).andReturn(li);
        Policy p = control.createMock(Policy.class);
        EasyMock.expect(ep.getPolicy()).andReturn(p);
        control.replay();
        EffectivePolicy effective = rme.new EffectivePolicyImpl(ep, reg, true, false);
        assertSame(alt, effective.getChosenAlternative());
        assertSame(li, effective.getInterceptors());
        assertSame(p, effective.getPolicy());
View Full Code Here

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

        EndpointInfo ei = getEndpoint().getEndpointInfo();

        PolicyInterceptorProviderRegistry reg = manager.getBus()
            .getExtension(PolicyInterceptorProviderRegistry.class);
        EndpointPolicy ep = null == conduit ? engine.getServerEndpointPolicy(applicationEndpoint
            .getEndpointInfo(), null) : engine.getClientEndpointPolicy(applicationEndpoint.getEndpointInfo(),
                                                                       conduit);

        if (conduit != null) {
            engine.setClientEndpointPolicy(ei, ep);
View Full Code Here

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

                                                      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);
            }

            Collection<Assertion> assertions = ep.getVocabulary();
            if (null != assertions) {
                message.put(AssertionInfoMap.class, new AssertionInfoMap(assertions));
            }
            endpoint.getService().setInvoker(invoker);
            ex.put(Endpoint.class, endpoint);
View Full Code Here

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

                                                  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> interceptors = ep.getInterceptors();
            for (Interceptor i : interceptors) {
                message.getInterceptorChain().add(i);
            }
           
            Collection<PolicyAssertion> assertions = ep.getVocabulary();
            if (null != assertions) {
                message.put(AssertionInfoMap.class, new AssertionInfoMap(assertions));
            }
            endpoint.getService().setInvoker(new STSInvoker());
            ex.put(Endpoint.class, endpoint);
View Full Code Here

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

            assertEquals(1,
                         xpu.getValueList("/wsdl:definitions/wsdl:binding/wsdl:operation/"
                                              + "wsp:PolicyReference[@URI='#echoIntBindingOpPolicy']", wsdl)
                             .getLength());
           
            EndpointPolicy policy = bus.getExtension(PolicyEngine.class)
                .getServerEndpointPolicy(s.getEndpoint().getEndpointInfo(), null, null);
            assertNotNull(policy);
            assertEquals(1, policy.getChosenAlternative().size());
        } finally {
            bus.shutdown(true);
        }
    }
View Full Code Here

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

                                                      null);
            }
            endpoint.getEndpointInfo().setProperty(TokenStore.class.getName(), store);
            message.getExchange().put(TokenStore.class.getName(), store);

            EndpointPolicy ep = pe.getServerEndpointPolicy(endpoint.getEndpointInfo(), destination, message);
            List<Interceptor<? extends Message>> interceptors = ep.getInterceptors(message);
            for (Interceptor<? extends Message> i : interceptors) {
                message.getInterceptorChain().add(i);
            }

            Collection<Assertion> assertions = ep.getVocabulary(message);
            if (null != assertions) {
                message.put(AssertionInfoMap.class, new AssertionInfoMap(assertions));
            }
            endpoint.getService().setInvoker(invoker);
            ex.put(Endpoint.class, endpoint);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.