Package org.axonframework.eventhandling

Examples of org.axonframework.eventhandling.CompositeClusterSelector


        // and we initialize a simple cluster
        Cluster standardCluster = new SimpleCluster("simple");

        // to make sure Listeners are assigned to their respective cluster, we create a number of selectors that we
        // combine into a single ClusterSelector using a CompositeClusterSelector
        ClusterSelector clusterSelector = new CompositeClusterSelector(Arrays.<ClusterSelector>asList(
                // this one will accept
                new ClassNamePatternClusterSelector(Pattern.compile(".*Another.*"), asyncCluster),
                new DefaultClusterSelector(standardCluster)
        ));

View Full Code Here


    @Test
    public void testSelectorDelegatesInOrder() throws Exception {
        Cluster cluster = mock(Cluster.class);

        when(selector2.selectCluster(isA(EventListener.class))).thenReturn(cluster);
        testSubject = new CompositeClusterSelector(Arrays.asList(selector1, selector2, selector3));

        Cluster actual = testSubject.selectCluster(mockListener);
        assertSame(cluster, actual);
        verify(selector1).selectCluster(mockListener);
        verify(selector2).selectCluster(mockListener);
View Full Code Here

        verify(selector3, never()).selectCluster(any(EventListener.class));
    }

    @Test
    public void testSelectorDelegatesInOrder_NoClusterFound() throws Exception {
        testSubject = new CompositeClusterSelector(Arrays.asList(selector1, selector2, selector3));

        Cluster actual = testSubject.selectCluster(mockListener);
        assertNull(actual);
        verify(selector1).selectCluster(mockListener);
        verify(selector2).selectCluster(mockListener);
View Full Code Here

TOP

Related Classes of org.axonframework.eventhandling.CompositeClusterSelector

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.