Package org.apache.geronimo.network

Examples of org.apache.geronimo.network.SelectorManager$Event


      Event[] events = history.getLatestPage();

      System.out.println("Events In the latestPage are : ");
      for (int i = 0; i < events.length; i++)
      {
        Event anEvent = events[i];
        System.out.println("Event: " + anEvent.getClass().getName()
            + "  FullFormattedMessage: "
            + anEvent.getFullFormattedMessage());
      }
    } catch (Exception e)
    {
      System.out.println("Caught Exception : " + " Name : "
          + e.getClass().getName() + " Message : " + e.getMessage()
View Full Code Here


                {
                    ArrayOfEvent aoe = (ArrayOfEvent) value;
                    Event[] evts = aoe.getEvent();
                    for (int evtID = 0; evtID < evts.length; ++evtID)
                    {
                        Event anEvent = evts[evtID];
                        System.out.println("\n----------" + "\n Event ID: "
                                + anEvent.getKey() + "\n Event: "
                                + anEvent.getClass().getName()
                                + "\n FullFormattedMessage: "
                                + anEvent.getFullFormattedMessage()
                                + "\n VM Reference: "
                                + anEvent.getVm().getVm().get_value()
                                + "\n----------\n");
                    }
                } else if (value instanceof VmEvent)
                {
                    VmEvent anEvent = (VmEvent) value;
                    System.out.println("\n----------" + "\n Event ID: "
                            + anEvent.getKey() + "\n Event: "
                            + anEvent.getClass().getName()
                            + "\n FullFormattedMessage: "
                            + anEvent.getFullFormattedMessage()
                            + "\n VM Reference: "
                            + anEvent.getVm().getVm().get_value()
                            + "\n----------\n");
                }
                System.out.println("===============");
            }
        }
View Full Code Here

        evtMgr.createCollectorForEvents(eventFilter);
      Event[] events = ehc.getLatestPage();

      for (int i = 0; i < events.length; i++)
      {
        Event anEvent = events[i];
        System.out.println("Event: " +
            anEvent.getClass().getName());
      }
    }
    si.getServerConnection().logout();
  }
View Full Code Here

    ServiceInstance si = new ServiceInstance(
        new URL(args[0]), args[1], args[2], true);

    // get the latest event and print it out
    EventManager evtMgr = si.getEventManager();
    Event latestEvent = evtMgr.getLatestEvent();
    printEvent(latestEvent);

    // create a filter spec for querying events
    EventFilterSpec efs = new EventFilterSpec();
    // limit to only error and warning
View Full Code Here

            tp.setPoolName("TP " + aName);

            cp = new ClockPool();
            cp.setPoolName("CP " + aName);

            sm = new SelectorManager();
            sm.setThreadPool(tp);
            sm.setThreadName("SM " + aName);
            sm.setTimeout(500);
        }
View Full Code Here

            tp.setPoolName("TP " + aName);

            cp = new ClockPool();
            cp.setPoolName("CP " + aName);

            sm = new SelectorManager();
            sm.setThreadPool(tp);
            sm.setThreadName("SM " + aName);
            sm.setTimeout(500);
        }
View Full Code Here

        tp.setKeepAliveTime(100);
        tp.setPoolSize(5);
        tp.setPoolName("TP");
        tp.doStart();

        SelectorManager sm = new SelectorManager();
        sm.setThreadPool(tp);
        sm.setThreadName("SM");
        sm.doStart();

        ProtocolStack stack = new ProtocolStack();
        DatagramProtocol dgp = new DatagramProtocol();
        dgp.setDestinationInterface(new InetSocketAddress("localhost", 0));
        dgp.setSourceAddress(new InetSocketAddress("localhost", 0));
        dgp.setSelectorManager(sm);

        stack.push(dgp);
        stack.push(new TopProtocol());
        stack.push(new TestCountingProtocol(completed));

        stack.setup();

        DatagramDownPacket packet = new DatagramDownPacket();
        packet.setAddress(new InetSocketAddress(dgp.getConnectURI().getHost(), dgp.getConnectURI().getPort()));
        packet.setBuffers(getByteBuffer());

        for (int i = 0; i < COUNT; i++) {
            stack.sendDown(packet);
        }

        if (!completed.attempt(60 * 1000)) {
            throw new IllegalStateException("TIMEOUT");
        }

        stack.drain();

        sm.doStop();

        tp.doStop();
    }
View Full Code Here

        tp.setKeepAliveTime(100);
        tp.setPoolSize(5);
        tp.setPoolName("TP");
        tp.doStart();

        SelectorManager sm = new SelectorManager();
        sm.setThreadPool(tp);
        sm.setThreadName("SM");
        sm.doStart();

        ProtocolStack stack = new ProtocolStack();
        DatagramProtocol dgp = new DatagramProtocol();
        dgp.setDestinationInterface(new InetSocketAddress("localhost", 0));
        dgp.setSourceAddress(new InetSocketAddress("localhost", 8081));
        dgp.setSelectorManager(sm);

        stack.push(dgp);
        stack.push(new TopProtocol());
        stack.push(new TestCountingProtocol(completed));

        ProtocolStack stack_copy = (ProtocolStack) stack.cloneProtocol();

        stack_copy.setup();

        DatagramDownPacket packet = new DatagramDownPacket();
        packet.setAddress(new InetSocketAddress("localhost", 8081));
        packet.setBuffers(getByteBuffer());

        for (int i = 0; i < COUNT; i++) {
            stack_copy.sendDown(packet);
        }

        if (!completed.attempt(60 * 1000)) {
            throw new IllegalStateException("TIMEOUT");
        }

        stack_copy.drain();

        sm.doStop();

        tp.doStop();
    }
View Full Code Here

        ClockPool cp = new ClockPool();
        cp.setPoolName("CP");
        cp.doStart();

        SelectorManager sm = new SelectorManager();
        sm.setThreadPool(tp);
        sm.setThreadName("SM");
        sm.setTimeout(500);
        sm.doStart();

        SocketProtocol spt = new SocketProtocol();
        spt.setUpProtocol(new TestCountingProtocol(completed));
        spt.setTimeout(10 * 1000);
        spt.setSelectorManager(sm);

        ProtocolFactory pf = new ProtocolFactory();
        pf.setClockPool(cp);
        pf.setMaxAge(Long.MAX_VALUE);
        pf.setMaxInactivity(1 * 60 * 60 * 1000);
        pf.setReclaimPeriod(10 * 1000);
        pf.setTemplate(spt);

        ServerSocketAcceptor ssa = new ServerSocketAcceptor();
        ssa.setSelectorManager(sm);
        ssa.setTimeOut(5 * 1000);
        ssa.setUri(new URI("async://localhost:0/?tcp.nodelay=true&tcp.backlog=5#"));
        ssa.setAcceptorListener(pf);
        ssa.startup();

        SocketProtocol sp = new SocketProtocol();
        sp.setUpProtocol(new Protocol() {
            public Protocol getUpProtocol() {
                throw new NoSuchMethodError();
            }

            public void setUpProtocol(Protocol up) {
                throw new NoSuchMethodError();
            }

            public Protocol getDownProtocol() {
                throw new NoSuchMethodError();
            }

            public void setDownProtocol(Protocol down) {
                throw new NoSuchMethodError();
            }

            public void clearLinks() {
            }

            public Protocol cloneProtocol() throws CloneNotSupportedException {
                return (Protocol) super.clone();
            }

            public void setup() {
            }

            public void drain() {
            }

            public void teardown() {
            }

            public void sendUp(UpPacket packet) {
            }

            public void sendDown(DownPacket packet) {
            }

            public void flush() {
            }
        });

        sp.setTimeout(10 * 1000);
        sp.setInterface(new InetSocketAddress(ssa.getConnectURI().getHost(), 0));
        sp.setAddress(new InetSocketAddress(ssa.getConnectURI().getHost(), ssa.getConnectURI().getPort()));
        sp.setSelectorManager(sm);

        sp.setup();


        for (int i = 0; i < COUNT; i++) {
            sp.sendDown(getDatagramPacket());
        }

        if (!completed.attempt(60 * 1000)) {
            throw new IllegalStateException("TIMEOUT");
        }

        sp.drain();

        ssa.drain();

        pf.drain();

        spt.drain();

        sm.doStop();

        cp.doStop();

        tp.doStop();
    }
View Full Code Here

        cp = new ClockPool();
        cp.setPoolName("CP");
        cp.doStart();

        sm = new SelectorManager();
        sm.setThreadPool(tp);
        sm.setThreadName("SM");
        sm.setTimeout(0);
        sm.doStart();
View Full Code Here

TOP

Related Classes of org.apache.geronimo.network.SelectorManager$Event

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.