Package io.s4.message

Examples of io.s4.message.Response


    public void processEvent(Object event) {
        Object newEvent = event;
        if (transformers != null && transformers.length > 0) {
            Cloner cloner = clonerMap.get(event.getClass().getName());
            if (cloner == null) {
                ClonerGenerator cg = new ClonerGenerator();
                // generate byte code that knows how to call the clone method on
                // this event
                Class clonerClass = cg.generate(event.getClass());
                try {
                    cloner = (Cloner) clonerClass.newInstance();
                    clonerMap.put(event.getClass().getName(), cloner);
                } catch (InstantiationException ie) {
                    Logger.getLogger(this.getClass()).error(ie);
View Full Code Here


    public AbstractWindowingPE() {
    }

    public void init() {
        // this reference will be shared amongst all instances of the pe
        slotUtils = new SlotUtils(slotSize);

        try {
            slotClass = Class.forName(slotClassName);
        } catch (ClassNotFoundException cnfe) {
            throw new RuntimeException(cnfe);
View Full Code Here

            System.out.println("Intializing event clock time with seed time " + s4EventClock.getCurrentTime());
        }
       
        PEContainer peContainer = (PEContainer) context.getBean("peContainer");

        Watcher w = (Watcher) context.getBean("watcher");
        w.setConfigFilename(configPath);

       
        // load extension modules
        String[] configFileNames = getModuleConfigFiles(extsHome, prop);
        if (configFileNames.length > 0) {
View Full Code Here

        }

        coreContext = new FileSystemXmlApplicationContext(coreConfigFileUrls, coreContext);
        ApplicationContext context = coreContext;       
       
        Clock s4Clock = (Clock) context.getBean("clock");
        if (s4Clock instanceof EventClock && seedTime > 0) {
            EventClock s4EventClock = (EventClock)s4Clock;
            s4EventClock.updateTime(seedTime);
            System.out.println("Intializing event clock time with seed time " + s4EventClock.getCurrentTime());
        }
View Full Code Here

    static EventClock s4Clock;
    static Persister persister;

    public static void main(String[] args) {
        TestPersisterEventClock testPersisterClock = new TestPersisterEventClock();
        s4Clock = new EventClock();
        s4Clock.updateTime(69990000);
        TimeUpdaterThread timeUpdater = new TimeUpdaterThread(s4Clock);
        Thread timeUpdaterThread = new Thread(timeUpdater);
        timeUpdaterThread.start();
        persister = new HashMapPersister(s4Clock);
View Full Code Here

        coreContext = new FileSystemXmlApplicationContext(coreConfigFileUrls, coreContext);
        ApplicationContext context = coreContext;       
       
        Clock s4Clock = (Clock) context.getBean("clock");
        if (s4Clock instanceof EventClock && seedTime > 0) {
            EventClock s4EventClock = (EventClock)s4Clock;
            s4EventClock.updateTime(seedTime);
            System.out.println("Intializing event clock time with seed time " + s4EventClock.getCurrentTime());
        }
       
        PEContainer peContainer = (PEContainer) context.getBean("peContainer");

        Watcher w = (Watcher) context.getBean("watcher");
View Full Code Here

        while (true) {
            EventWrapper eventWrapper = null;
            try {
                eventWrapper = workQueue.take();
                if (s4Clock instanceof EventClock) {
                    EventClock eventClock = (EventClock) s4Clock;
                    eventClock.update(eventWrapper);
                    // To what time to update the clock
                }
                if (trackByKey) {
                    boolean foundOne = false;
                    for (CompoundKeyInfo compoundKeyInfo : eventWrapper.getCompoundKeys()) {
View Full Code Here

    static WallClock s4Clock;
    static Persister persister;

    public static void main(String[] args) {
        TestPersisterWallClock testPersisterClock = new TestPersisterWallClock();
        s4Clock = new WallClock();
        persister = new HashMapPersister(s4Clock);
        testPersisterClock.testPersister(persister);
        persister = new ConMapPersister(s4Clock);
        testPersisterClock.testPersister(persister);
    }
View Full Code Here

   @Test
   public void testCloneAndInitialize() {
       MockPE prototype = new MockPE();
       prototype.setInitMethod("testInitialize");
      
       PrototypeWrapper prototypeWrapper = new PrototypeWrapper(prototype, new WallClock());

       assertEquals(0, prototype.getInitializeCount());
       MockPE instance = (MockPE)prototypeWrapper.getPE("asd");
       assertNotNull(instance);
      
View Full Code Here

            String keyVal = keyInfo.getCompoundValue();

            AbstractPE pe = p.lookupPE(keyVal);

            Response response = ((SinglePERequest) event).evaluate(pe);
            String stream = response.getRInfo().getStream();

            dispatcher.dispatchEvent(stream, response);

        } else if (event instanceof PrototypeRequest) {
            // Or handle aggregate requests to Prototypes.
            Response response = ((PrototypeRequest) event).evaluate(p);
            String stream = response.getRInfo().getStream();

            dispatcher.dispatchEvent(stream, response);
        }

    }
View Full Code Here

TOP

Related Classes of io.s4.message.Response

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.