Examples of addListener()


Examples of org.apache.mina.common.WriteFuture.addListener()

        WriteFuture future = null;
        try {
            synchronized (handler) {
                if (isSSLStarted(session)) {
                    future = initiateClosure(nextFilter, session);
                    future.addListener(new IoFutureListener() {
                        public void operationComplete(IoFuture future) {
                            nextFilter.filterClose(session);
                        }
                    });
                }
View Full Code Here

Examples of org.apache.mina.core.future.CloseFuture.addListener()

    System.out.println("session.close called");
    //Thread.sleep(5);

    // wait for session close and then dispose the connector
    closeFuture.addListener(new IoFutureListener<IoFuture>() {

      public void operationComplete(IoFuture future) {
        System.out.println("managed session count=" + connector.getManagedSessionCount());
        System.out.println("Disposing connector ...");
        connector.dispose(true);
View Full Code Here

Examples of org.apache.mina.core.future.ConnectFuture.addListener()

      ConnectFuture connFuture = connector.connect(new InetSocketAddress(
                          ClientConnectionBean.host, port));
      log.debug("About to wait.");
      connFuture.awaitUninterruptibly();
      log.debug("Adding a future listener.");
      connFuture.addListener(new IoFutureListener<ConnectFuture>() {
        public void operationComplete(ConnectFuture future) {
          if (future.isConnected()) {
            log.debug("...connected");
            session = future.getSession();
            ClientShowStatusMessage.showStatusMessage("Connected ... Ready for Action");
View Full Code Here

Examples of org.apache.mina.core.future.DefaultCloseFuture.addListener()

        assertFalse(future.isDone());
        assertFalse(future.isClosed());

        TestListener listener1 = new TestListener();
        TestListener listener2 = new TestListener();
        future.addListener(listener1);
        future.addListener(listener2);

        TestThread thread = new TestThread(future);
        thread.start();
View Full Code Here

Examples of org.apache.mina.core.future.DefaultWriteFuture.addListener()

        // TODO : This is not our business ! The caller has created a FileChannel,
        // he has to close it !
        if (openedFileChannel != null) {
            // If we opened a FileChannel, it needs to be closed when the write has completed
            final FileChannel finalChannel = openedFileChannel;
            writeFuture.addListener(new IoFutureListener<WriteFuture>() {
                public void operationComplete(WriteFuture future) {
                    try {
                        finalChannel.close();
                    } catch (IOException e) {
                        ExceptionMonitor.getInstance().exceptionCaught(e);
View Full Code Here

Examples of org.apache.mina.core.future.WriteFuture.addListener()

        // TODO : This is not our business ! The caller has created a FileChannel,
        // he has to close it !
        if (openedFileChannel != null) {
            // If we opened a FileChannel, it needs to be closed when the write has completed
            final FileChannel finalChannel = openedFileChannel;
            writeFuture.addListener(new IoFutureListener<WriteFuture>() {
                public void operationComplete(WriteFuture future) {
                    try {
                        finalChannel.close();
                    } catch (IOException e) {
                        ExceptionMonitor.getInstance().exceptionCaught(e);
View Full Code Here

Examples of org.apache.mina.transport.socket.nio.NioDatagramAcceptor.addListener()

    chain.addLast("logger", loggingFilter);

    DatagramSessionConfig dcfg = acceptor.getSessionConfig();
    dcfg.setReuseAddress(true);

    acceptor.addListener(new IoServiceListener() {
     
      @Override
      public void sessionDestroyed(IoSession session) throws Exception {
      }
     
View Full Code Here

Examples of org.apache.muse.core.ResourceManager.addListener()

        //
        // this allows the advertisement capability to hear about
        // all resource lifecycle events that happen in the application
        //
        ResourceManager manager = resource.getResourceManager();
        manager.addListener(this);
               
        //
        // initialize the advertisement topics
        //
        NotificationProducer wsn =
View Full Code Here

Examples of org.apache.ojb.broker.core.proxy.CollectionProxy.addListener()

                }
                else
                {
                    status = IS_UNMATERIALIZED_PROXY;
                    if(log.isDebugEnabled()) log.debug("Unmaterialized proxy collection, use proxy listener");
                    colProxy.addListener(this);
                }
            }
            else
            {
                status = IS_NORMAL_OBJECT;
View Full Code Here

Examples of org.apache.ojb.broker.core.proxy.IndirectionHandler.addListener()

        assertEquals(1, result.size());
        Book b = (Book) result.iterator().next();
        IndirectionHandler handler = ProxyHelper.getIndirectionHandler(b.getPublisher());
        assertNotNull(handler);
        assertFalse(handler.alreadyMaterialized());
        handler.addListener(
                new MaterializationListener()
                {
                    public void beforeMaterialization(IndirectionHandler handler, Identity oid)
                    {
                        fail("Reference shall not materialize while locking");
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.