Examples of Listener


Examples of com.nokia.dempsy.messagetransport.Listener

         //===========================================
         // setup the sender and receiver
         adaptor = new TcpReceiver(null,getFailFast());
         factory = makeSenderFactory(false,null,500); // distruptible sender factory
         receiveLargeMessageLatch = new CountDownLatch(1);
         adaptor.setListener( new Listener()
         {
            @Override
            public boolean onMessage( byte[] messageBytes, boolean failfast ) throws MessageTransportException
            {
               receivedByteArrayMessage = messageBytes;
View Full Code Here

Examples of com.opengamma.engine.exec.DependencyGraphExecutionFuture.Listener

  public void testAddListenerBeforeCompletion() throws Throwable {
    final NormalExecutionJobDispatcher dispatcher = new NormalExecutionJobDispatcher();
    final PlanExecutor executor = new PlanExecutor(createCycle(dispatcher), createPlan());
    final AtomicReference<String> result = new AtomicReference<String>();
    executor.setListener(new Listener() {
      @Override
      public void graphCompleted(final String calculationConfiguration) {
        assertEquals(result.getAndSet(calculationConfiguration), null);
      }
    });
View Full Code Here

Examples of com.orientechnologies.orient.core.OMemoryWatchDog.Listener

  public void setMaxSize(final int iMaxSize) {
    maxSize = iMaxSize;
  }

  public void startup() {
    watchDogListener = Orient.instance().getMemoryWatchDog().addListener(new Listener() {
      /**
       * Auto reduce cache size of 50%
       */
      public void memoryUsageLow(TYPE iType, final long usedMemory, final long maxMemory) {
        if (iType == TYPE.JVM) {
View Full Code Here

Examples of com.peterhi.net.Listener

public final class ServerApp {

  public static void main(String[] args) throws Exception {
    final Local local = new Local(22222);
    local.getSocket().setSoTimeout(10);
    local.addListener(new Listener() {
      @Override
      public void received(Event event) {
        SocketAddress address = event.getAddress();
        byte[] data = event.getData(true);
        System.out.println(MessageFormat.format("Received {0} bytes of data from {1}.", data.length, address));
View Full Code Here

Examples of com.peterhi.net3.Local.Listener

public class Server {

  public static void main(String[] args) throws Exception {
    Local local = new Local(22222);
    local.getSocket().setSoTimeout(10);
    local.addListener(new Listener() {
      @Override
      public void received(SocketAddress address, byte[] data) {
        System.out.println("Received " + new String(data) + " from " + address);
      }
    });
View Full Code Here

Examples of com.peterhi.rudp.Endpoint.Listener

public class ServerApp {

  public static void main(String[] args) throws Exception {
    Endpoint server = new Endpoint(22222);
    server.addListener(new Listener() {
      @Override
      public void received(Event event) {
        String reliableStr = event.isReliable() ? "reliable" : "unreliable";
        String string = new String(event.getData());
        System.out.println("RECEIVED!!!");
View Full Code Here

Examples of com.peterhi.working.Listener

public class Server {

  public static void main(String[] args) throws Exception {
    EndpointImpl endpoint = new EndpointImpl(new DatagramSocket(22222));
    endpoint.addListener(new Listener() {
      @Override
      public void update(Event event) {
        try {
          InputStream stream = event.getInputStream();
         
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.Listener

            throw new MBeanException(e);
        }
    }

    public Listener createListener(String targetName) {
        Listener listener = new Listener();
        listener.setVendorid("31345");
        listener.setProductname("Sun Diameter");
        listener.setFirmwareRevision("1.0");
        listener.setMode("client");

        Bindto[] bindto = new Bindto[2];
        Bindto bindtoTCP = new Bindto();
        bindtoTCP.setPort("${DIAMETER_TCP_PORT}");
        bindtoTCP.setHost("${DIAMETER_TCP_ADDRESS}");
        bindtoTCP.setTransport("tcp");
        bindto[0] = bindtoTCP;
        Bindto bindtoTLS = new Bindto();
        bindtoTLS.setPort("${DIAMETER_SSL_PORT}");
        bindtoTLS.setHost("${DIAMETER_SSL_ADDRESS}");
        bindtoTLS.setTransport("tls");
        Ssl ssl = new Ssl();
        ssl.setCertNickname("s1cs");
        ssl.setClientAuthEnabled(false);
        ssl.setSsl2Enabled(false);
        ssl.setSsl3Enabled(false);
        ssl.setTlsEnabled(true);
        ssl.setTlsRollbackEnabled(true);
        bindtoTLS.setSsl(ssl);
        bindto[1] = bindtoTLS;
        listener.setBindto(bindto);

        listener.setAcceptUnknownPeer("true");
        listener.setTctimer("10000");

        String realmName = null;
        try {
            InetAddress addr = InetAddress.getLocalHost();
            realmName = addr.getHostName();
        } catch (UnknownHostException ue) {
            realmName = "localhost";
        }
        realmName = realmName + "." + targetName;
        listener.setRealm(realmName);
        listener.setDiameterApplicationRef("one");
        return listener;
    }
View Full Code Here

Examples of com.vaadin.ui.Component.Listener

        EasyMock.verify(listener, errorHandler);
    }

    @Test
    public void fireEvent_multipleListenersAndException_errorHandlerCalled() {
        Listener listener2 = EasyMock.createMock(Component.Listener.class);
        router.addListener(Component.Event.class, listener2,
                COMPONENT_EVENT_METHOD);

        listener.componentEvent(EasyMock.<Component.Event> anyObject());
        EasyMock.expectLastCall().andThrow(
                new RuntimeException("listener failed"));
        errorHandler.error(EasyMock.<ErrorEvent> anyObject());
        // second listener should be called despite an error in the first
        listener2.componentEvent(EasyMock.<Component.Event> anyObject());

        EasyMock.replay(component, listener, listener2, errorHandler);
        router.fireEvent(new Component.Event(component), errorHandler);
        EasyMock.verify(listener, listener2, errorHandler);
    }
View Full Code Here

Examples of connection.Listener

    uploadManager = new UploadManager();
    downloadManager = new DownloadManager();

    Runtime.getRuntime().addShutdownHook(new ShutdownHook());

    new Listener();

    // Schedule a job for the event-dispatching thread:
    // creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable()
    {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.