Package io.s4.comm.core

Examples of io.s4.comm.core.SenderProcess


   @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


    public void run() {
        if (listener == null) {
            if (listenerAppName == null) {
                listenerAppName = appName;
            }
            sender = new SenderProcess(clusterManagerAddress,
                                       appName,
                                       listenerAppName);
            Map<String, String> map = new HashMap<String, String>();
            map.put("SenderId", "" + senderId);
            sender.setSerializer(new PassThroughSerializer());
            sender.acquireTaskAndCreateSender(map);
        } else {
            Object listenerConfig = null;
            try {
                listenerConfig = listener.getListenerConfig();
                if (listenerConfig == null) {
                    logger.info("CommLayerEmitter going to wait for listener to acquire task");
                    synchronized (listener) {
                        listenerConfig = listener.getListenerConfig();
                        if (listenerConfig == null) {
                            listener.wait();
                            listenerConfig = listener.getListenerConfig();
                        }
                    }
                }
            } catch (Exception e) {
                logger.info("Exception in CommLayerEmitter.run()", e);
            }
            logger.info("Creating sender process with " + listenerConfig);

            String destinationAppName = (listenerAppName != null
                    ? listenerAppName : listener.getAppName());

            sender = new SenderProcess(listener.getClusterManagerAddress(),
                                       listener.getAppName(),
                                       destinationAppName);

            sender.setSerializer(new PassThroughSerializer());
            sender.createSenderFromConfig(listenerConfig);
View Full Code Here

TOP

Related Classes of io.s4.comm.core.SenderProcess

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.