Package org.compass.core

Examples of org.compass.core.CompassException


        try {
            emfWrapperClass = GlassfishV3NativeJpaExtractor.class.getClassLoader().loadClass(EMF_WRAPPER_CLASS);
            emfGetDelegateMethod = emfWrapperClass.getDeclaredMethod("getDelegate");
            emfGetDelegateMethod.setAccessible(true);
        } catch (ClassNotFoundException e) {
            throw new CompassException("Failed to find Glassfish EMF wrapper class [" + EMF_WRAPPER_CLASS + "]");
        } catch (NoSuchMethodException e) {
            throw new CompassException("Failed to find Glassfish getDelegate method within wrapper class [" + EMF_WRAPPER_CLASS + "]");
        }
        try {
            emWrapperClass = GlassfishV3NativeJpaExtractor.class.getClassLoader().loadClass(EM_WRAPPER_CLASS);
            emGetDelegateMethod = emWrapperClass.getDeclaredMethod("getDelegate");
            emGetDelegateMethod.setAccessible(true);
        } catch (ClassNotFoundException e) {
            throw new CompassException("Failed to find Glassfish EM wrapper class [" + EM_WRAPPER_CLASS + "]");
        } catch (NoSuchMethodException e) {
            throw new CompassException("Failed to find Glassfish getDelegate method within wrapper class [" + EM_WRAPPER_CLASS + "]");
        }
    }
View Full Code Here


    public void doConfigure(CompassSettings settings) throws CompassException {

        try {
            context = NamingHelper.getInitialContext(settings);
        } catch (NamingException ne) {
            throw new CompassException("Could not obtain initial context", ne);
        }

        utName = settings.getSetting(CompassEnvironment.Transaction.USER_TRANSACTION);

        TransactionManagerLookup lookup = TransactionManagerLookupFactory.getTransactionManagerLookup(settings);
        if (lookup != null) {
            transactionManager = lookup.getTransactionManager(settings);
            if (transactionManager == null) {
                throw new CompassException("Failed to find transaction manager");
            }
            if (utName == null) {
                utName = lookup.getUserTransactionName();
            }
        } else {
            throw new CompassException("Must register a transaction manager lookup using the "
                    + CompassEnvironment.Transaction.MANAGER_LOOKUP + " property");
        }

        if (utName == null) {
            utName = DEFAULT_USER_TRANSACTION_NAME;
View Full Code Here

        try {
            return getUserTransaction().getStatus() != Status.STATUS_NO_TRANSACTION;
        } catch (java.lang.IllegalStateException ex) {
            return true;
        } catch (SystemException e) {
            throw new CompassException("Failed to get staus on JTA transaciton", e);
        }
    }
View Full Code Here

    public void doConfigure(CompassSettings settings) throws CompassException {

        try {
            context = NamingHelper.getInitialContext(settings);
        } catch (NamingException ne) {
            throw new CompassException("Could not obtain initial context", ne);
        }

        utName = settings.getSetting(CompassEnvironment.Transaction.USER_TRANSACTION);

        TransactionManagerLookup lookup = TransactionManagerLookupFactory.getTransactionManagerLookup(settings);
        if (lookup != null) {
            transactionManager = lookup.getTransactionManager(settings);
            if (transactionManager == null) {
                throw new CompassException("Failed to find transaction manager");
            }
            if (utName == null) {
                utName = lookup.getUserTransactionName();
            }
        } else {
            throw new CompassException("Must register a transaction manager lookup using the "
                    + CompassEnvironment.Transaction.MANAGER_LOOKUP + " property");
        }

        if (utName == null) {
            utName = DEFAULT_USER_TRANSACTION_NAME;
View Full Code Here

        try {
            return getUserTransaction().getStatus() != Status.STATUS_NO_TRANSACTION;
        } catch (java.lang.IllegalStateException ex) {
            return true;
        } catch (SystemException e) {
            throw new CompassException("Failed to get staus on JTA transaciton", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.compass.core.CompassException

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.