Package javax.resource.spi

Examples of javax.resource.spi.ManagedConnection


    }

    public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
        if (reauthentication) {
            for (Iterator iterator = connectionSet.iterator(); iterator.hasNext();) {
                ManagedConnection managedConnection = (ManagedConnection) iterator.next();
                if (managedConnections.contains(managedConnection)) {
                    return managedConnection;
                }
            }
        } else {
            for (Iterator iterator = connectionSet.iterator(); iterator.hasNext();) {
                ManagedConnection managedConnection = (ManagedConnection) iterator.next();
//                return managedConnection;
                if (managedConnections.contains(managedConnection)) {
                    MockManagedConnection mockManagedConnection = (MockManagedConnection) managedConnection;
                    if ((subject == null ? mockManagedConnection.getSubject() == null : subject.equals(mockManagedConnection.getSubject())
                            && (cxRequestInfo == null ? mockManagedConnection.getConnectionRequestInfo() == null : cxRequestInfo.equals(mockManagedConnection.getConnectionRequestInfo())))) {
View Full Code Here


    return new JcaExecutorServiceManagedConnection(this);
  }
 
  @SuppressWarnings("rawtypes")
  public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
    ManagedConnection result = null;
    Iterator it = connectionSet.iterator();
    while (result == null && it.hasNext()) {
      ManagedConnection mc = (ManagedConnection) it.next();
      if (mc instanceof JcaExecutorServiceManagedConnection) {
        result = mc;
      }

    }
View Full Code Here

            if (connectionInfo.isUnshareable()) {
                //if one is, they all are
                return;
            }
            ManagedConnectionInfo managedConnectionInfo = connectionInfo.getManagedConnectionInfo();
            ManagedConnection managedConnection = managedConnectionInfo.getManagedConnection();
            if (managedConnection instanceof DissociatableManagedConnection
                    && managedConnectionInfo.isFirstConnectionInfo(connectionInfo)) {
                int size = connectionInfos.size();
                i.remove();
                assert size - 1 == connectionInfos.size();
View Full Code Here

                }
                return;
            }
            try {
                ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo();
                ManagedConnection matchedMC =
                        newMCI
                        .getManagedConnectionFactory()
                        .matchManagedConnections(Collections.singleton(newMCI.getManagedConnection()),
                                mci.getSubject(),
                                mci.getConnectionRequestInfo());
View Full Code Here

        }
    }

    protected boolean internalReturn(ConnectionInfo connectionInfo, ConnectionReturnAction connectionReturnAction) {
        ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo();
        ManagedConnection mc = mci.getManagedConnection();
        try {
            mc.cleanup();
        } catch (ResourceException e) {
            connectionReturnAction = ConnectionReturnAction.DESTROY;
        }
        boolean wasInPool = false;
        synchronized (pool) {
View Full Code Here

    }

    public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
        if (reauthentication) {
            for (Iterator iterator = connectionSet.iterator(); iterator.hasNext();) {
                ManagedConnection managedConnection = (ManagedConnection) iterator.next();
                if (managedConnections.contains(managedConnection)) {
                    return managedConnection;
                }
            }
        } else {
            for (Iterator iterator = connectionSet.iterator(); iterator.hasNext();) {
                ManagedConnection managedConnection = (ManagedConnection) iterator.next();
//                return managedConnection;
                if (managedConnections.contains(managedConnection)) {
                    MockManagedConnection mockManagedConnection = (MockManagedConnection) managedConnection;
                    if ((subject == null ? mockManagedConnection.getSubject() == null : subject.equals(mockManagedConnection.getSubject())
                            && (cxRequestInfo == null ? mockManagedConnection.getConnectionRequestInfo() == null : cxRequestInfo.equals(mockManagedConnection.getConnectionRequestInfo())))) {
View Full Code Here

    }

    public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
        if (reauthentication) {
            for (Iterator iterator = connectionSet.iterator(); iterator.hasNext();) {
                ManagedConnection managedConnection = (ManagedConnection) iterator.next();
                if (managedConnections.contains(managedConnection)) {
                    return managedConnection;
                }
            }
        } else {
            for (Iterator iterator = connectionSet.iterator(); iterator.hasNext();) {
                ManagedConnection managedConnection = (ManagedConnection) iterator.next();
//                return managedConnection;
                if (managedConnections.contains(managedConnection)) {
                    MockManagedConnection mockManagedConnection = (MockManagedConnection) managedConnection;
                    if ((subject == null ? mockManagedConnection.getSubject() == null : subject.equals(mockManagedConnection.getSubject())
                            && (cxRequestInfo == null ? mockManagedConnection.getConnectionRequestInfo() == null : cxRequestInfo.equals(mockManagedConnection.getConnectionRequestInfo())))) {
View Full Code Here

   {
      // We have a hanging transaction
      if (localTransaction.get())
      {
         LocalTransaction local = null;
         ManagedConnection mc = getManagedConnection();
         try
         {
            local = mc.getLocalTransaction();
         }
         catch (Throwable t)
         {
            throw new ResourceException(bundle.unfinishedLocalTransaction(this), t);
         }
View Full Code Here

   private ConnectionListener createConnectionEventListener(Subject subject, ConnectionRequestInfo cri)
      throws ResourceException
   {
      long start = System.currentTimeMillis();

      ManagedConnection mc = mcf.createManagedConnection(subject, cri);

      statistics.deltaTotalCreationTime(System.currentTimeMillis() - start);
      statistics.deltaCreatedCount();
      try
      {
         return clf.createConnectionListener(mc, this);
      }
      catch (ResourceException re)
      {
         statistics.deltaDestroyedCount();
         mc.destroy();
         throw re;
      }
   }
View Full Code Here

      }

      statistics.deltaDestroyedCount();
      cl.setState(ConnectionState.DESTROYED);

      ManagedConnection mc = cl.getManagedConnection();
      try
      {
         mc.destroy();
      }
      catch (Throwable t)
      {
         log.debug("Exception destroying ManagedConnection " + cl, t);
      }

      mc.removeConnectionEventListener(cl);
   }
View Full Code Here

TOP

Related Classes of javax.resource.spi.ManagedConnection

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.