Examples of DynamicProxy


Examples of com.atomikos.util.DynamicProxy

  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

Examples of com.atomikos.util.DynamicProxy

  public boolean isInTransaction ( CompositeTransaction ct ) {
    boolean ret = false;
    Reapable handle = getCurrentConnectionProxy();
    if ( handle != null ) {
      DynamicProxy dproxy = ( DynamicProxy ) handle;
      AtomikosThreadLocalConnection previous = (AtomikosThreadLocalConnection) dproxy.getInvocationHandler();
      ret = previous.isInTransaction ( ct );
    }
    return ret;
  }
View Full Code Here

Examples of com.atomikos.util.DynamicProxy

       CompositeTransactionManager ctm = Configuration
             .getCompositeTransactionManager ();
       CompositeTransaction ct = null;
       if ( ctm != null ) ct = ctm.getCompositeTransaction ();
       if ( ct != null && ct.getProperty TransactionManagerImp.JTA_PROPERTY_NAME ) != null ) {
         DynamicProxy dproxy = ( DynamicProxy ) handle;
         AtomikosThreadLocalConnection previous = (AtomikosThreadLocalConnection) dproxy.getInvocationHandler();
         ret = previous.isInTransaction ( ct );
       }
    }
    return ret;
  }
View Full Code Here

Examples of com.atomikos.util.DynamicProxy

   
    //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 );
        if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": returning " + proxy );
    return proxy;
View Full Code Here

Examples of com.atomikos.util.DynamicProxy

   
    //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 );
        if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": returning " + proxy );
    return proxy;
View Full Code Here

Examples of com.atomikos.util.DynamicProxy

    classLoaders.add ( obj.getClass().getClassLoader() );
    classLoaders.add ( AtomikosThreadLocalConnection.class.getClassLoader() );

    ret = ClassLoadingHelper.newProxyInstance ( classLoaders , minimumSetOfInterfaceClasses , interfaceClasses , new AtomikosThreadLocalConnection ( pooledConnection ) );

    DynamicProxy dproxy = (DynamicProxy) ret;
    AtomikosThreadLocalConnection c = (AtomikosThreadLocalConnection) dproxy.getInvocationHandler();
    c.resourceName = resourceName;

    return ret;
  }
View Full Code Here

Examples of com.atomikos.util.DynamicProxy

  }

  public synchronized boolean isAvailable() {
    boolean ret = true;
    if ( currentProxy != null ) {
      DynamicProxy dproxy = ( DynamicProxy ) currentProxy;
      AtomikosJmsConnectionProxy proxy = (AtomikosJmsConnectionProxy) dproxy.getInvocationHandler();     
      ret = proxy.isAvailable();
    }
    return ret;
  }
View Full Code Here

Examples of com.atomikos.util.DynamicProxy

  }

  public synchronized boolean isInTransaction ( CompositeTransaction ct ) {
    boolean ret = false;
    if ( currentProxy != null ) {
      DynamicProxy dproxy = ( DynamicProxy ) currentProxy;
      AtomikosJmsConnectionProxy proxy = (AtomikosJmsConnectionProxy) dproxy.getInvocationHandler();
      ret = proxy.isInTransaction ( ct );
    }
    return ret;
  }
View Full Code Here

Examples of com.atomikos.util.DynamicProxy

    synchronized ( this ) {
      //a session has terminated -> check reusability of all remaining
      if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": a session has terminated, is connection now available ? " + isAvailable() );
      if ( isAvailable() ) {
        if ( currentProxy != null ) {
          DynamicProxy dproxy = ( DynamicProxy ) currentProxy;
          AtomikosJmsConnectionProxy proxy = (AtomikosJmsConnectionProxy) dproxy.getInvocationHandler();
          if ( proxy.isErroneous() ) erroneous = true;
          proxy.destroy();
        }
       
        fireTerminatedEvent = true;
      } else {
        //not yet available, but check if the connection is erroneous
        //which happens if the session being terminated is erroneous
        if ( currentProxy != null ) {
          DynamicProxy dproxy = ( DynamicProxy ) currentProxy;
          AtomikosJmsConnectionProxy proxy = (AtomikosJmsConnectionProxy) dproxy.getInvocationHandler();
          if ( proxy.isErroneous() ) erroneous = true;
        }
      }
    }
   
View Full Code Here

Examples of com.atomikos.util.DynamicProxy

    if ( currentProxy != null ) {
      CompositeTransactionManager tm = Configuration.getCompositeTransactionManager();
     
      CompositeTransaction current = tm.getCompositeTransaction();
      if ( ( current != null ) && ( current.getProperty ( TransactionManagerImp.JTA_PROPERTY_NAME) != null )) {
        DynamicProxy dproxy = ( DynamicProxy ) currentProxy;
        AtomikosJmsConnectionProxy proxy = (AtomikosJmsConnectionProxy) dproxy.getInvocationHandler();
        //recycle only if inactive in this tx - i.e., if proxy was closed!
        ret = proxy.isInactiveInTransaction(current);
      }
    }
   
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.