Package com.atomikos.datasource

Examples of com.atomikos.datasource.RecoverableResource


        // Ask the Configuration for all current resources, since
        // newly added ones are not known at init.
        Enumeration resources = Configuration.getResources ();
        while ( resources.hasMoreElements () ) {
            RecoverableResource res = (RecoverableResource) resources
                    .nextElement ();

            Configuration.removeResource ( res.getName () );
            try {
                res.close ();
            } catch ( ResourceException re ) {

              //Issue 10038:
              //Ignore errors in force mode: force is most likely
              //during VM exit; in that case interleaving of shutdown hooks
View Full Code Here


                    }
                }

                Enumeration reslist = Configuration.getResources ();
                while ( reslist.hasMoreElements () ) {
                    RecoverableResource res = (RecoverableResource) reslist
                            .nextElement ();
                    try {
                        res.endRecovery ();
                    } catch ( Exception error ) {
                        LOGGER.logWarning ( "ERROR IN RECOVERY", error );
                        // continue processing to avoid indoubts for other resources
                    }
                }
View Full Code Here

  private static void purgeResources ()
    {
        Enumeration enumm = getResources ();
        while ( enumm.hasMoreElements () ) {
            RecoverableResource res = (RecoverableResource) enumm.nextElement ();
            if ( res.isClosed () )
                removeResource ( res.getName () );
        }
    }
View Full Code Here

        recoveryService_ = service;
        if ( service != null ) {
            // notify all currently registered resources
            Enumeration resources = getResources ();
            while ( resources.hasMoreElements () ) {
                RecoverableResource next = (RecoverableResource) resources
                        .nextElement ();
                next.setRecoveryService ( service );

            }

        }
    }
View Full Code Here

     * @return RecoverableResource The removed object.
     */

    public static RecoverableResource removeResource ( String name )
    {
        RecoverableResource ret = null;
        if ( name != null ) {
          ret = (RecoverableResource) resources_.remove ( name );
          if ( ret != null ) resourceList_.remove ( ret );

        }
View Full Code Here

     *            The name to find.
     */

    public static RecoverableResource getResource ( String name )
    {
        RecoverableResource res = null;
        if ( name != null ) res = (RecoverableResource) resources_.get ( name );
        return res;
    }
View Full Code Here

    } catch ( NameNotFoundException e ) {
      //ignore but log
      if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": error removing from JNDI" , e );
    }
   
    RecoverableResource res = Configuration.getResource ( getUniqueResourceName() );
    if ( res != null ) {
      Configuration.removeResource ( getUniqueResourceName() );
      //fix for case 26005: close resource!
      res.close();
    }
   
    if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": close done." );
  }
View Full Code Here

      return cf;
  }
 
  protected void doClose()
  {
    RecoverableResource res = Configuration.getResource ( getUniqueResourceName() );
    if ( res != null ) {
      Configuration.removeResource ( getUniqueResourceName() );
      //fix for case 26005
      res.close();
    }
  } 
View Full Code Here

        // If so, each resource needs to know that the XID
        // can be recovered, or endRecovery in one of them
        // will incorrectly rollback

        while ( resources.hasMoreElements () ) {
            RecoverableResource res = (RecoverableResource) resources
                    .nextElement ();
            if ( res.recover ( this ) ) {
                recovered = true;
            }

        }
View Full Code Here

    } catch ( NameNotFoundException e ) {
      //ignore but log
      if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": error removing from JNDI" , e );
    }
   
    RecoverableResource res = Configuration.getResource ( getUniqueResourceName() );
    if ( res != null ) {
      Configuration.removeResource ( getUniqueResourceName() );
      //fix for case 26005: close resource!
      res.close();
    }
   
    if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": close done." );
  }
View Full Code Here

TOP

Related Classes of com.atomikos.datasource.RecoverableResource

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.