Package com.atomikos.util

Examples of com.atomikos.util.DynamicProxy


    CompositeTransaction current = tm.getCompositeTransaction();
    if ( ( current != null ) && ( current.getProperty ( TransactionManagerImp.JTA_PROPERTY_NAME) != null )) {
      synchronized (sessions) {
        for (int i=0; i<sessions.size() ;i++) {
          Session session = (Session) sessions.get(i);
          DynamicProxy dproxy = ( DynamicProxy ) session;
          AbstractJmsSessionProxy proxy = (AbstractJmsSessionProxy) dproxy.getInvocationHandler();
         
          //recycle if either inactive in this tx, OR if active (since a new session will be created anyway, and
          //concurrent sessions are allowed on the same underlying connection!
          if ( proxy.isInactiveTransaction(current) || proxy.isInTransaction( current ) ) {
            if ( LOGGER.isInfoEnabled() ) LOGGER.logInfo ( this + ": recycling session " + proxy );
View Full Code Here


    boolean ret = closed;
    synchronized (sessions) {
      Iterator it = sessions.iterator();
      while ( it.hasNext() && ret ) {
        Object handle = it.next();
        DynamicProxy dproxy = ( DynamicProxy ) handle;
        AbstractJmsSessionProxy  session = (AbstractJmsSessionProxy) dproxy.getInvocationHandler();
        if ( !session.isAvailable() ) {
          ret = false;
        }
      }
    }
View Full Code Here

    boolean ret = erroneous;
    synchronized (sessions) {
      Iterator it = sessions.iterator();
      while ( it.hasNext() && !ret ) {
        Object handle = it.next();
        DynamicProxy dproxy = ( DynamicProxy ) handle;
        AbstractJmsSessionProxy  session = (AbstractJmsSessionProxy) dproxy.getInvocationHandler();
        if ( session.isErroneous() ) ret = true;
      }
    }
    return ret;
  }
View Full Code Here

    boolean ret = false;
    synchronized (sessions) {
      Iterator it = sessions.iterator();
      while ( it.hasNext() && !ret ) {
        Object handle = it.next();
        DynamicProxy dproxy = ( DynamicProxy ) handle;
        AbstractJmsSessionProxy  session = (AbstractJmsSessionProxy) dproxy.getInvocationHandler();
        if ( session.isInTransaction ( ct ) ) ret = true;
      }
    }
    return ret;
  }
View Full Code Here

    boolean ret = false;
    synchronized (sessions) {
      Iterator it = sessions.iterator();
      while ( it.hasNext() && !ret ) {
        Object handle = it.next();
        DynamicProxy dproxy = ( DynamicProxy ) handle;
        AbstractJmsSessionProxy  session = (AbstractJmsSessionProxy) dproxy.getInvocationHandler();
        if ( session.isInactiveTransaction ( ct ) ) ret = true;
      }
    }
    return ret;
  }
View Full Code Here

    //a session has terminated -> remove it from the list of sessions to enable GC
    synchronized (sessions) {
      Iterator it = sessions.iterator();
      while ( it.hasNext() ) {
        Object handle = it.next();
        DynamicProxy dproxy = ( DynamicProxy ) handle;
        AbstractJmsSessionProxy  session = (AbstractJmsSessionProxy) dproxy.getInvocationHandler();
        if ( session.isAvailable() ) it.remove();
      }
    }
  }
View Full Code Here

   
    //let pool take care of reusing an existing handle
    Connection proxy = super.getConnection ( hmsg );         

        // here we are certain that proxy is not null -> increase the use count
        DynamicProxy dproxy = ( DynamicProxy ) proxy;
        com.atomikos.jdbc.nonxa.AtomikosThreadLocalConnection previous = (AtomikosThreadLocalConnection) dproxy.getInvocationHandler();

        previous.incUseCount();
        previous.addHeuristicMessage ( hmsg );
        Configuration.logDebug ( this + ": returning " + proxy );
    return proxy;
View Full Code Here

    classLoaders.add ( obj.getClass().getClassLoader() );
    classLoaders.add ( AtomikosThreadLocalConnection.class.getClassLoader() );
   
    ret = ClassLoadingHelper.newProxyInstance ( classLoaders , interfaceClasses , new AtomikosThreadLocalConnection ( pooledConnection ) );
   
    DynamicProxy dproxy = (DynamicProxy) ret;
    AtomikosThreadLocalConnection c = (AtomikosThreadLocalConnection) dproxy.getInvocationHandler();
    c.resourceName = resourceName;
   
    return ret;
  }
View Full Code Here

  {
    Reapable ret = null;
    if ( canBeRecycledForCallingThread() ) {
      Configuration.logDebug ( this + ": reusing existing proxy for thread..." );
      ret = getCurrentConnectionProxy();
      DynamicProxy dproxy = ( DynamicProxy ) ret;
      AtomikosThreadLocalConnection previous = (AtomikosThreadLocalConnection) dproxy.getInvocationHandler();
      //DON't increment use count: see case 27793
      //previous.incUseCount();
    } else {
      Configuration.logDebug ( this + ": creating connection proxy..." );
      JdbcConnectionProxyHelper.setIsolationLevel ( connection, getDefaultIsolationLevel() );
View Full Code Here

  public boolean isAvailable() {
    boolean ret = true;

    Reapable handle = getCurrentConnectionProxy();
    if ( handle != null ) {
      DynamicProxy dproxy = ( DynamicProxy ) handle;
      AtomikosThreadLocalConnection previous = (AtomikosThreadLocalConnection) dproxy.getInvocationHandler();
      ret = previous.isNoLongerInUse();
    }
   
    return ret;
   
View Full Code Here

TOP

Related Classes of com.atomikos.util.DynamicProxy

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.