Package de.novanic.eventservice.client.event

Examples of de.novanic.eventservice.client.event.DomainEvent


     */
    public void receiveEvent(String anEvent) {
      if(CYCLE_TAG.equals(anEvent)) {
        myCallback.onSuccess(new ArrayList<DomainEvent>(0));
      } else {
            DomainEvent theDeserializedEvent = deserializeEvent(anEvent);
            myEventNotification.onNotify(theDeserializedEvent);
      }
    }
View Full Code Here


     * Adds an event for a domain to the user.
     * @param aDomain domain
     * @param anEvent event
     */
    public void addEvent(Domain aDomain, Event anEvent) {
        DomainEvent theDomainEvent = new DefaultDomainEvent(anEvent, aDomain);
        myEvents.add(theDomainEvent);
        notifyEventListening();
    }
View Full Code Here

     *                   The maximum amount of events prevents the logic from endless seeking of events (for example when more events are concurrently added than this logic/thread can process).
     * @return all events according to the user
     */
    public List<DomainEvent> retrieveEvents(int aMaxEvents) {
        List<DomainEvent> theEventList = new ArrayList<DomainEvent>(myEvents.size());
        DomainEvent theEvent;
        for(int i = 0; i < aMaxEvents && (theEvent = myEvents.poll()) != null; i++) {
            theEventList.add(theEvent);
        }
        return theEventList;
    }
View Full Code Here

        mockInitRootPanel();
        when(RootPanel.getBodyElement()).thenReturn(theElementMock);

        GWTMockUtilities.restore();

        DomainEvent theDomainEvent = new DummyDomainEvent();
        final String theSerializedEvent = "[4,3,2,1,[\"de.novanic.eventservice.client.event.DefaultDomainEvent/3924906731\",\"de.novanic.eventservice.client.event.domain.DefaultDomain/240262385\",\"test_domain\",null],0,5]";

        SerializationStreamReader theSerializationStreamReaderMock = mock(SerializationStreamReader.class);
        when(theSerializationStreamReaderMock.readObject()).thenReturn(theDomainEvent);
View Full Code Here

        EventNotificationTestHandler theEventNotification = new EventNotificationTestHandler();

        final String theSerializedEvent = "[4,3,2,1,[\"de.novanic.eventservice.client.event.DefaultDomainEvent/3924906731\",\"de.novanic.eventservice.client.event.domain.DefaultDomain/240262385\",\"test_domain\",null],0,5]";

        DomainEvent theDomainEvent = new DummyDomainEvent();

        SerializationStreamReader theSerializationStreamReaderMock = mock(SerializationStreamReader.class);
        when(theSerializationStreamReaderMock.readObject()).thenReturn(theDomainEvent);

        mockInitSerializationStreamFactory(theSerializationStreamReaderMock, theSerializedEvent);
View Full Code Here

        EventNotificationTestHandler theEventNotification = new EventNotificationTestHandler();

        final String theSerializedEvent = "[4,3,2,1,[\"de.novanic.eventservice.client.event.DefaultDomainEvent/3924906731\",\"de.novanic.eventservice.client.event.domain.DefaultDomain/240262385\",\"test_domain\",null],0,5]";

        DomainEvent theDomainEvent = new DummyDomainEvent();

        SerializationStreamReader theSerializationStreamReaderMock = mock(SerializationStreamReader.class);
        when(theSerializationStreamReaderMock.readObject()).thenReturn(theDomainEvent);

        mockInitSerializationStreamFactory(theSerializationStreamReaderMock, theSerializedEvent);
View Full Code Here

TOP

Related Classes of de.novanic.eventservice.client.event.DomainEvent

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.