Package com.atomikos.icatch

Examples of com.atomikos.icatch.SysException


                                    + xares + " and " + xaresource );
                }
            } catch ( XAException xe ) {
                Stack errors = new Stack ();
                errors.push ( xe );
                throw new SysException ( "Error in XAResource comparison: "
                        + xe.getMessage (), errors );
            }
        }
        return ret;
    }
View Full Code Here


            exported_ = false;
        } else {
            name_ = tmUniqueName + "UserTransactionServer";
            providerUrl_ = properties.getProperty ( Context.PROVIDER_URL );
            if ( providerUrl_ == null ) {
                throw new SysException ( "Startup property "
                        + Context.PROVIDER_URL
                        + " must be set for client demarcation." );
            }
            initialContextFactory_ = properties
                    .getProperty ( Context.INITIAL_CONTEXT_FACTORY );
            if ( initialContextFactory_ == null ) {
                throw new SysException ( "Startup property "
                        + Context.INITIAL_CONTEXT_FACTORY
                        + " must be set for client demarcation." );
            }
            properties_ = properties;

            tm_ = (TransactionManagerImp) TransactionManagerImp
                    .getTransactionManager ();
            if ( tm_ == null )
                throw new SysException ( "No TM found" );

            try {

                if ( "PortableRemoteObject".equals ( exportClass ) ) {
                    PortableRemoteObject.exportObject ( this );
                    exported_ = true;
                } else if ( "UnicastRemoteObject".equals ( exportClass ) ) {
                    UnicastRemoteObject.exportObject ( this );
                    exported_ = true;
                }

            } catch ( Exception e ) {
                Stack errors = new Stack ();
                errors.push ( e );
                throw new SysException (
                        "Error exporting - naming service not running?", errors );
            }

            try {

                Context ctx = getInitialContext ();
                ctx.rebind ( name_, this );
            } catch ( Exception e ) {
                Stack errors = new Stack ();
                errors.push ( e );
                throw new SysException (
                        "Please make sure the rmiregistry is running!?", errors );
            }

        }
View Full Code Here

                Context ctx = getInitialContext ();
                ctx.unbind ( name_ );
            } catch ( Exception e ) {
                Stack errors = new Stack ();
                errors.push ( e );
                throw new SysException ( e.getMessage (), errors );
            }
            // set exported to false, to make sure this method is
            // idempotent
            exported_ = false;
        }
View Full Code Here


        String name = getTrimmedProperty (
                AbstractUserTransactionServiceFactory.TM_UNIQUE_NAME_PROPERTY_NAME, p );
        if ( name == null || name.equals ( "" ) )
            throw new SysException (
                    "Property not set: com.atomikos.icatch.tm_unique_name" );
        ret = new StandAloneTransactionManager ( name, recmgr,
                logdir, maxTimeout, max, !threadedCommit );

        // set default serial mode for JTA txs.
View Full Code Here

            if ( clientDemarcation ) {

                String name = getTrimmedProperty (
                        AbstractUserTransactionServiceFactory.TM_UNIQUE_NAME_PROPERTY_NAME, p );
                if ( name == null || name.equals ( "" ) )
                    throw new SysException (
                            "Property not set: com.atomikos.icatch.tm_unique_name" );
                UserTransactionServerImp utxs = UserTransactionServerImp
                        .getSingleton ();
                utxs.init ( name, p );

                String factory = getTrimmedProperty (
                        Context.INITIAL_CONTEXT_FACTORY, p );
                String url = getTrimmedProperty ( Context.PROVIDER_URL, p );
                if ( url == null || url.equals ( "" ) ) {
                    throw new SysException ( "Property not set: "
                            + Context.PROVIDER_URL );
                }

            }

            // this will add all resources and recover them
            super.init ( info );

        } catch ( Exception e ) {
            e.printStackTrace ();
            Stack errors = new Stack ();
            errors.push ( e );
            throw (SysException) new SysException ( "Error in init(): " + e.getMessage (),
                    errors ).initCause(e);
        }
    }
View Full Code Here

        } catch ( RollbackException rb ) {
            // impossible since this happens for 1PC only,
            // and 1PC txs are not in the log?!
            Stack errors = new Stack ();
            errors.push ( rb );
            throw new SysException ( "Error in forced commit: "
                    + rb.getMessage (), errors );
        }
    }
View Full Code Here

         // rollback coordinator outside SYNCH block to avoid deadlocks
         try {
             ct_.getCoordinatorImp ().rollback ();
         } catch ( HeurCommitException e ) {
             errors.push ( e );
             throw new SysException ( "Unexpected error in rollback", errors );
         } catch ( HeurMixedException e ) {
             errors.push ( e );
             throw new SysException ( "Unexpected error in rollback", errors );
         } catch ( HeurHazardException e ) {
             errors.push ( e );
             throw new SysException ( "Unexpected error in rollback", errors );
         }
    }
View Full Code Here

                    // swapped out coordinator already, OR NONEXISTENT!
                    try {
                        cc = (CoordinatorImp) recoverymanager_.recover ( root );
                    } catch ( LogException le ) {
                        errors.push ( le );
                        throw new SysException (
                                "Error in getting coordinator: "
                                        + le.getMessage (), errors );
                    }
                    if ( cc != null ) {
                        startlistening ( cc );
View Full Code Here

                // for swapping out after indoubt resolved.
            }
        } catch ( Exception e ) {
            Configuration.logWarning ( "Error in recoverCoordinators", e );
            errors.push ( e );
            throw new SysException ( "Error in recoverCoordinators: "
                    + e.getMessage (), errors );
        }

    }
View Full Code Here

                Configuration.logWarning ( "Error in recover: "
                        + e.getClass ().getName () + e.getMessage (), e );

                Stack errors = new Stack ();
                errors.push ( e );
                throw new SysException ( "Error in recovering: "
                        + e.getMessage (), errors );
            }

        }// end synchronized
View Full Code Here

TOP

Related Classes of com.atomikos.icatch.SysException

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.