Examples of DynamicProxy


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

Examples of com.atomikos.util.DynamicProxy

    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

Examples of com.atomikos.util.DynamicProxy

    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

Examples of com.atomikos.util.DynamicProxy

    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

Examples of com.atomikos.util.DynamicProxy

    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

Examples of com.atomikos.util.DynamicProxy

    //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

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
      Configuration.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 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!
        ret = proxy.isInactiveInTransaction(current) || proxy.isInTransaction( 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.