Examples of ConnectionListener


Examples of jetbrains.communicator.jabber.ConnectionListener

  public void testConnectListener() throws Throwable {
    final boolean[] connected = new boolean[1];
    final boolean[] disconnected = new boolean[1];
    final boolean[] authenticated = new boolean[1];
    myFacade.addConnectionListener(new ConnectionListener() {
      @Override
      public void connected(XMPPConnection connection) {
        connected[0] = true;
      }
View Full Code Here

Examples of net.sf.jftp.net.ConnectionListener

        }
        else
        {
            for(int i = 0; i < listeners.size(); i++)
            {
                ConnectionListener listener = (ConnectionListener) listeners.elementAt(i);

                if(shortProgress && Settings.shortProgress)
                {
                    if(type.startsWith(DataConnection.DFINISHED))
                    {
                        listener.updateProgress(baseFile,
                                                DataConnection.DFINISHED + ":" +
                                                fileCount, bytes);
                    }

                    listener.updateProgress(baseFile,
                                            DataConnection.GETDIR + ":" +
                                            fileCount, bytes);
                }
                else
                {
                    listener.updateProgress(file, type, bytes);
                }
            }
        }
    }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.plugins.hibernate.ConnectionListener

   {
      _hibernateConnectionProvider = hibernateConnectionProvider;
      _hqlAliasFinder = hqlAliasFinder;
      _hqlSyntaxHighlightTokenMatcherProxy = hqlSyntaxHighlightTokenMatcherProxy;

      _hibernateConnectionProvider.addConnectionListener(new ConnectionListener()
      {
         public void connectionOpened(HibernateConnection con, HibernateConfiguration cfg)
         {
            init();
         }
View Full Code Here

Examples of org.apache.qpid.jms.ConnectionListener

                                  String clientName, String virtualPath, String serviceName)
            throws AMQException, JMSException, URLSyntaxException
    {
        _connection = new AMQConnection(brokerDetails, username, password,
                                        clientName, virtualPath);
        _connection.setConnectionListener(new ConnectionListener()
        {

            public void bytesSent(long count)
            {
            }
View Full Code Here

Examples of org.jboss.jca.core.connectionmanager.listener.ConnectionListener

   public void transactionStarted(Collection<ConnectionRecord> crs) throws SystemException
   {
      Set<ConnectionListener> cls = new HashSet<ConnectionListener>(crs.size());
      for (ConnectionRecord cr : crs)
      {
         ConnectionListener cl = cr.getConnectionListener();
         if (!cls.contains(cl))
         {
            cls.add(cl);
            cl.enlist();

            if (!isInterleaving())
            {
               cl.setTrackByTx(true);

               ManagedConnectionPool mcp = (ManagedConnectionPool)cl.getContext();
               Transaction tx = transactionManager.getTransaction();

               // The lock may need to be initialized if we are in the first lazy enlistment
               Lock lock = getLock();
               try
View Full Code Here

Examples of org.jboss.jca.core.connectionmanager.listener.ConnectionListener

               throw new ResourceException(bundle.unableSetXAResourceTransactionTimeout(getJndiName()), e);
            }
         }
      }

      ConnectionListener cli = new TxConnectionListener(this, mc, getPool(), context, getFlushStrategy(), xaResource);
      mc.addConnectionEventListener(cli);
      return cli;
   }
View Full Code Here

Examples of org.jboss.jca.core.connectionmanager.listener.ConnectionListener

    * {@inheritDoc}
    */
   public ConnectionListener getConnection(Transaction trackByTransaction, Subject subject, ConnectionRequestInfo cri)
      throws ResourceException
   {
      ConnectionListener cl = null;
      boolean separateNoTx = false;

      if (noTxSeparatePools)
      {
         separateNoTx = clf.isTransactional();
View Full Code Here

Examples of org.jboss.jca.core.connectionmanager.listener.ConnectionListener

    */
   private ConnectionListener getSimpleConnection(final Subject subject, final ConnectionRequestInfo cri,
                                                  final ManagedConnectionPool mcp)
      throws ResourceException
   {
      ConnectionListener cl = null;

      try
      {
         // Get connection from the managed connection pool
         cl = mcp.getConnection(subject, cri);
View Full Code Here

Examples of org.jboss.jca.core.connectionmanager.listener.ConnectionListener

         throw new ResourceException(bundle.unableObtainLock(), ie);
      }
      try
      {
         // Already got one
         ConnectionListener cl = (ConnectionListener)tsr.getResource(mcp);
         if (cl != null)
         {
            if (trace)
               log.tracef("Previous connection tracked by transaction=%s tx=%s", cl, trackByTransaction);
            return cl;
View Full Code Here

Examples of org.jboss.jca.core.connectionmanager.listener.ConnectionListener

      // This must be done outside the tx local lock, otherwise
      // the tx timeout won't work and get connection can do a lot of other work
      // with many opportunities for deadlocks.
      // Instead we do a double check after we got the transaction to see
      // whether another thread beat us to the punch.
      ConnectionListener cl = mcp.getConnection(subject, cri);
      if (trace)
         log.tracef("Got connection from pool tracked by transaction=%s tx=%s", cl, trackByTransaction);

      TransactionSynchronizationRegistry tsr = getTransactionSynchronizationRegistry();
      Lock lock = getLock();
      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException ie)
      {
         Thread.interrupted();

         throw new ResourceException(bundle.unableObtainLock(), ie);
      }
      try
      {
         // Check we weren't racing with another transaction
         ConnectionListener other =
            (ConnectionListener)tsr.getResource(mcp);

         if (other != null)
         {
            mcp.returnConnection(cl, false);
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.