Package javax.resource.spi

Examples of javax.resource.spi.ManagedConnection.destroy()


      {
         return clf.createConnectionListener(mc, this);
      }
      catch (ResourceException re)
      {
         mc.destroy();
         throw re;
      }
   }

   /**
 
View Full Code Here


        synchronized (pool) {
            while (!pool.isEmpty()) {
                ManagedConnection mc = pool.remove(pool.size() - 1).getManagedConnection();
                if (mc != null) {
                    try {
                        mc.destroy();
                    }
                    catch (ResourceException re) {
                        //ignore
                    }
                }
View Full Code Here

            ConnectionInfo connectionInfo,
            ConnectionReturnAction connectionReturnAction) {
        ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo();
        ManagedConnection mc = mci.getManagedConnection();
        try {
            mc.destroy();
        } catch (ResourceException e) {
            //log and forget
        } catch (Error e) {
            throw e;
        } catch (Throwable t) {
View Full Code Here

      assertNotNull(textMessage);
      assertEquals(textMessage.getText(), "test");
     
      ManagedConnection mc = ((HornetQRASession)s).getManagedConnection();
      s.close();
      mc.destroy();
   }

   public void testSimpleMessageSendAndReceiveXA() throws Exception
   {
      Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
View Full Code Here

      assertNotNull(textMessage);
      assertEquals(textMessage.getText(), "test");

      ManagedConnection mc = ((HornetQRASession)s).getManagedConnection();
      s.close();
      mc.destroy();
   }

   public void testSimpleMessageSendAndReceiveTransacted() throws Exception
   {
      resourceAdapter = new HornetQResourceAdapter();
View Full Code Here

      assertEquals(textMessage.getText(), "test");
      s.commit();
     
      ManagedConnection mc = ((HornetQRASession)s).getManagedConnection();
      s.close();
      mc.destroy();
   }

   public void testMultipleSessionsThrowsException() throws Exception
   {
      resourceAdapter = new HornetQResourceAdapter();
View Full Code Here

         assertTrue(e.getLinkedException() instanceof IllegalStateException);
      }
     
      ManagedConnection mc = ((HornetQRASession)s).getManagedConnection();
      s.close();
      mc.destroy();
   }

   public void testConnectionCredentials() throws Exception
   {
      resourceAdapter = new HornetQResourceAdapter();
View Full Code Here

      QueueConnection queueConnection = qraConnectionFactory.createQueueConnection();
      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      ManagedConnection mc = ((HornetQRASession)session).getManagedConnection();
      queueConnection.close();
      mc.destroy();

      queueConnection = qraConnectionFactory.createQueueConnection("testuser", "testpassword");
      session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
     
      mc = ((HornetQRASession)session).getManagedConnection();
View Full Code Here

      queueConnection = qraConnectionFactory.createQueueConnection("testuser", "testpassword");
      session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
     
      mc = ((HornetQRASession)session).getManagedConnection();
      queueConnection.close();
      mc.destroy();

   }

   public void testConnectionCredentialsFail() throws Exception
   {
View Full Code Here

      QueueConnection queueConnection = qraConnectionFactory.createQueueConnection();
      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
     
      ManagedConnection mc = ((HornetQRASession)session).getManagedConnection();
      queueConnection.close();
      mc.destroy();

      queueConnection = qraConnectionFactory.createQueueConnection("testuser", "testwrongpassword");
      try
      {
         queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE).close();
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.