Package javax.resource.spi

Examples of javax.resource.spi.ManagedConnection


        if (out != null)
            out.print("Failed connecting process: " + exc);
      throw new ResourceException("Failed connecting process: " + exc);
    }

    ManagedConnection managedCx = new ManagedConnectionImpl(ra,
                                                            cnx,
                                                            hostName,
                                                            serverPort,
                                                            userName);
    managedCx.setLogWriter(out);

    if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG))
      AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG,
                                    this + " createManagedConnection managedCx = " + managedCx);
View Full Code Here


        if (out != null)
            out.print("Failed connecting process: " + exc);
      throw new ResourceException("Failed connecting process: " + exc);
    }

    ManagedConnection managedCx = new ManagedConnectionImpl(ra,
                                                            cnx,
                                                            hostName,
                                                            serverPort,
                                                            userName);
    managedCx.setLogWriter(out);

    if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG))
      AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG,
                                    this + " createManagedConnection managedCx = " + managedCx);
View Full Code Here

  void reconnect() {
    valid = true;
    try {
      ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
      mcf.setResourceAdapter(ra);
      ManagedConnection mc = mcf.createManagedConnection(subject, cxRequest);
      destroy();
    catch (Exception e) {
      if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG))
        AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, this + " reconnect exception " + e);
    }
View Full Code Here

    }
    public Object allocateConnection(ManagedConnectionFactory mcf,
                                     ConnectionRequestInfo cxRequestInfo)
        throws ResourceException{
        ManagedConnection mc = mcf.createManagedConnection(null,cxRequestInfo);
        ConnectionListener l = new ConnectionListener(mc);
        mc.addConnectionEventListener(l);
        return mc.getConnection(null,cxRequestInfo);

    }
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)
            {
               JBossResourceException.rethrowAsResourceException("Unfinished local transaction - error getting local transaction from " + this, t);
            }
View Full Code Here

            Subject subject = getSubject();

            // Check if we got a valid Subject instance; requirement for recovery
            if (subject != null)
            {
               ManagedConnection mc = open(subject);
               XAResource xaResource = null;

               try
               {
                  xaResource = mc.getXAResource();
               }
               catch (ResourceException reconnect)
               {
                  close(mc);
                  mc = open(subject);
                  xaResource = mc.getXAResource();
               }

               try
               {
                  ObjectName on = new ObjectName(connectionManager);

                  boolean wrapXAResource = false;
                  boolean padXid = false;
                  Boolean isSameRMOverrideValue = Boolean.FALSE;

                  Boolean b = null;

                  b = (Boolean)getServer().getAttribute(on, "WrapXAResource");
                  if (b != null)
                     wrapXAResource = b.booleanValue();

                  b = (Boolean)getServer().getAttribute(on, "PadXid");
                  if (b != null)
                     padXid = b.booleanValue();

                  b = (Boolean)getServer().getAttribute(on, "IsSameRMOverrideValue");
                  if (b != null)
                     isSameRMOverrideValue = b;

                  if(wrapXAResource)
                  {
                     String eisProductName = null;
                     String eisProductVersion = null;

                     try
                     {
                        eisProductName = mc.getMetaData().getEISProductName();
                        eisProductVersion = mc.getMetaData().getEISProductVersion();
                     }
                     catch (ResourceException re)
                     {
                        // Ignore
                     }
View Full Code Here

              InternalManagedConnectionPool internalPool = subContext.getSubPool();
              Set cels = internalPool.getConnectionListeners();
              for(Iterator celsIter = cels.iterator(); celsIter.hasNext();)
              {
                 ConnectionListener cl = (ConnectionListener) celsIter.next();
                 ManagedConnection mc = cl.getManagedConnection();
                 if (mc instanceof org.jboss.resource.statistic.JBossConnectionStatistics)
                 {
                    org.jboss.resource.statistic.JBossConnectionStatistics stats = (org.jboss.resource.statistic.JBossConnectionStatistics)mc;
                    statistics += stats.listConnectionStats();
                    if(statistics.startsWith("-1")){
View Full Code Here

    * @throws ResourceException for any error
    */
   private ConnectionListener createConnectionEventListener(Subject subject, ConnectionRequestInfo cri)
         throws ResourceException
   {
      ManagedConnection mc = mcf.createManagedConnection(subject, cri);
      connectionCounter.inc();
      try
      {
         return clf.createConnectionListener(mc, this);
      }
      catch (ResourceException re)
      {
         connectionCounter.dec();
         mc.destroy();
         throw re;
      }
   }
View Full Code Here

    }

    // recover any resources on startup
    if (_isEnableXA) {
      Subject subject = null;
      ManagedConnection mConn = mcf.createManagedConnection(subject, null);

      try {
        XAResource xa = mConn.getXAResource();

        _tm.recover(xa);
      } catch (NotSupportedException e) {
        log.finer(e.toString());
      } catch (Throwable e) {
        log.log(Level.FINER, e.toString(), e);
      } finally {
        mConn.destroy();
      }
    }

    return mcf.createConnectionFactory(this);
  }
View Full Code Here

                                              ConnectionRequestInfo info,
                                              UserPoolItem oldPoolItem)
    throws ResourceException
  {
    while (_lifecycle.isActive()) {
      ManagedConnection mConn;

      long now = Alarm.getCurrentTime();

      if (_lastValidCheckTime + 15000L < now) {
        _lastValidCheckTime = now;
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.