Package org.axonframework.eventhandling

Examples of org.axonframework.eventhandling.DefaultClusterSelector


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

        // create the event bus and subscribe two listeners
        // notice how the registration process itself is unaware of clustering
        EventBus eventBus = new ClusteringEventBus(clusterSelector);
View Full Code Here


    private DefaultClusterSelector testSubject;

    @Before
    public void setUp() throws Exception {
        testSubject = new DefaultClusterSelector();
    }
View Full Code Here

    }

    @Test
    public void testProvidedInstanceIsReturned() {
        Cluster mock = mock(Cluster.class);
        testSubject = new DefaultClusterSelector(mock);
        assertSame(mock, testSubject.selectCluster(mock(EventListener.class)));
    }
View Full Code Here

        ReplayingCluster replayingCluster = new ReplayingCluster(new SimpleCluster("simple"), eventStore,
                                                                 new NoTransactionManager(), 0,
                                                                 new BackloggingIncomingMessageHandler());

        // we initialize an event bus that contains our replaying cluster
        EventBus eventBus = new ClusteringEventBus(new DefaultClusterSelector(replayingCluster));

        // we subscribe our two listeners to the Event Bus
        AnnotationEventListenerAdapter.subscribe(new ThreadPrintingEventListener(), eventBus);
        AnnotationEventListenerAdapter.subscribe(new AnotherThreadPrintingEventListener(), eventBus);
View Full Code Here

        verify(delegateCluster).unsubscribe(replayAware);
    }

    @Test
    public void testAnnotatedHandlersRecognized() {
        EventBus eventBus = new ClusteringEventBus(new DefaultClusterSelector(testSubject));
        MyReplayAwareListener annotatedBean = new MyReplayAwareListener();
        AnnotationEventListenerAdapter.subscribe(annotatedBean, eventBus);

        testSubject.startReplay();
View Full Code Here

TOP

Related Classes of org.axonframework.eventhandling.DefaultClusterSelector

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.