Package javax.jdo

Examples of javax.jdo.JDOFatalException


        try {
            resultStream = new PrintStream(
                    new FileOutputStream(path, true));
            resultStream.println(message);
        } catch (FileNotFoundException e) {
            throw new JDOFatalException("Cannot create file " + path, e);
        } finally {
            if (resultStream != null)
                resultStream.close();
        }
    }
View Full Code Here


        try {
            resultStream = new PrintStream(
                    new FileOutputStream(fileName, true));
            resultStream.println(message);
        } catch (FileNotFoundException e) {
            throw new JDOFatalException("Cannot create file "+fileName, e);
        } finally {
            if (resultStream != null)
                resultStream.close();
        }
    }
View Full Code Here

                }
            }
        } catch (FileNotFoundException e) {
            result = null;
        } catch (IOException e) {
            throw new JDOFatalException(
                    "Cannot deserialize result summary in file "
                    +fileName, e);
        } catch (ClassNotFoundException e) {
            throw new JDOFatalException(
                    "Cannot deserialize result summary in file "
                    +fileName, e);
        }
        return result;
    }
View Full Code Here

                if (oos != null) {
                    oos.close();
                }
            }
        } catch (FileNotFoundException e) {
            throw new JDOFatalException(
                    "Cannot create file " + fileName, e);
        } catch (IOException e) {
            throw new JDOFatalException(
                    "Cannot serialize result summary to file "
                    + fileName, e);
        }
    }
View Full Code Here

        SimpleDateFormat formatter = new SimpleDateFormat(pattern, locale);
        formatter.setTimeZone(TimeZone.getTimeZone(timezone));
        try {
            return formatter.parse(value);
        } catch (ParseException e) {
            throw new JDOFatalException("", e);
        }
    }
View Full Code Here

            setTearDownThrowable("cleanupPM", t);
        }
       
        if ((pmf == null || pmf.isClosed()) &&
            (this.tearDownInstances.size() > 0 || this.tearDownClasses.size() > 0))
            throw new JDOFatalException ("PMF must not be nullified or closed when tear down instances and /or classes have been added.");
       
        if (pmf != null && pmf.isClosed())
            pmf = null;
       
        try {
            if (cleanupData) {
                localTearDown();
            }
        }
        catch (Throwable t) {
            setTearDownThrowable("localTearDown", t);
        }
       
        if (closePMFAfterEachTest) {
            try {
                closePMF();
            }
            catch (Throwable t) {
                setTearDownThrowable("closePMF", t);
            }
        }
       
        if (this.tearDownThrowable != null) {
            Throwable t = this.tearDownThrowable;
            this.tearDownThrowable = null;
            if (testSucceeded) {
                // runTest succeeded, but this method threw exception => error
                throw new JDOFatalException("Exception during tearDown", t);
            }
        }
    }
View Full Code Here

            JDOException exc = (JDOException)nesteds[i];
            Object failedObject = exc.getFailedObject();
            if (exc.getFailedObject() instanceof PersistenceManager) {
                result[i] = (PersistenceManager)failedObject;
            } else {
                throw new JDOFatalException(assertionFailure,
                     "Unexpected failed object of type: " +
                     failedObject.getClass().getName());
            }
        }
        return result;
View Full Code Here

            resultStream = new PrintStream(new FileOutputStream(file));
            for (Iterator it = supportedOptions.iterator(); it.hasNext();) {
                resultStream.println((String)it.next());
            }
        } catch (FileNotFoundException e) {
            throw new JDOFatalException(
                "dumpSupportedOptions: cannot create file " + file.getName(), e);
        } finally {
            if (resultStream != null)
                resultStream.close();
        }
View Full Code Here

                {
                    // Abstract class, so we need an implementation
                    ClassMetaData cmd = (ClassMetaData)metaDataMgr.getMetaDataForClass(cls, clr);
                    if (cmd == null)
                    {
                        throw new JDOFatalException("Could not find metadata for class " + cls.getName());
                    }

                    Object obj = newInstance(cmd, clr);
                    if (obj == null)
                    {
                        throw new JDOFatalException(LOCALISER.msg("ImplementationCreator.InstanceCreateFailed", cls.getName()));
                    }
                    if (!metaDataMgr.hasMetaDataForClass(obj.getClass().getName()))
                    {
                        // No metadata yet present for the implementation so register it
                        metaDataMgr.registerImplementationOfAbstractClass(cmd, obj.getClass(), clr);
                    }
                    return obj;
                }
                else
                {
                    // Concrete class that is PC so just create an instance using its no args constructor
                    return cls.newInstance();
                }
            }
            else
            {
                // Interface, so we need an implemenation
                InterfaceMetaData imd = metaDataMgr.getMetaDataForInterface(cls, clr);
                if (imd == null)
                {
                    throw new JDOFatalException("Could not find metadata for class/interface "+cls.getName());
                }

                Object obj = newInstance(imd, clr);
                if (obj == null)
                {
                    throw new JDOFatalException(LOCALISER.msg("ImplementationCreator.InstanceCreateFailed", cls.getName()));
                }
                if (!metaDataMgr.hasMetaDataForClass(obj.getClass().getName()))
                {
                    // No metadata yet present for the implementation so register it
                    metaDataMgr.registerPersistentInterface(imd, obj.getClass(), clr);
View Full Code Here

                {
                    // Abstract class, so we need an implementation
                    ClassMetaData cmd = (ClassMetaData)mmgr.getMetaDataForClass(cls, clr);
                    if (cmd == null)
                    {
                        throw new JDOFatalException("Could not find metadata for class " + cls.getName());
                    }

                    Object obj = newInstance(cmd, clr);
                    if (!mmgr.hasMetaDataForClass(obj.getClass().getName()))
                    {
                        // No metadata yet present for the implementation so register it
                        mmgr.registerImplementationOfAbstractClass(cmd, obj.getClass(), clr);
                    }
                    if (obj == null)
                    {
                        throw new JDOFatalException(LOCALISER.msg("ImplementationCreator.InstanceCreateFailed", cls.getName()));
                    }
                    return obj;
                }
                else
                {
                    // Concrete class that is PC so just create an instance using its no args constructor
                    return cls.newInstance();
                }
            }
            else
            {
                // Interface, so we need an implemenation
                InterfaceMetaData imd = mmgr.getMetaDataForInterface(cls, clr);
                if (imd == null)
                {
                    throw new JDOFatalException("Could not find metadata for class/interface "+cls.getName());
                }

                Object obj = newInstance(imd, clr);
                if (!mmgr.hasMetaDataForClass(obj.getClass().getName()))
                {
                    // No metadata yet present for the implementation so register it
                    mmgr.registerPersistentInterface(imd, obj.getClass(), clr);
                }
                if (obj == null)
                {
                    throw new JDOFatalException(LOCALISER.msg("ImplementationCreator.InstanceCreateFailed", cls.getName()));
                }
                return obj;
            }
        }
        catch (ClassNotFoundException e)
View Full Code Here

TOP

Related Classes of javax.jdo.JDOFatalException

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.