Package org.exist.xmldb

Examples of org.exist.xmldb.DatabaseInstanceManager


                    } catch (final Exception e) {
                        System.err.println("Exception: " + e.getMessage());
                    }
                }
            } else if (args[0].equalsIgnoreCase("shutdown")) {
                final DatabaseInstanceManager mgr = (DatabaseInstanceManager) current
                    .getService("DatabaseInstanceManager", "1.0");
                if (mgr == null) {
                    messageln("Service is not available");
                    return true;
                }
                mgr.shutdown();
                return true;
            } else if (args[0].equalsIgnoreCase("help") || "?".equals(args[0])) {
                displayHelp();
            } else if (args[0].equalsIgnoreCase("quit")) {
                return false;
View Full Code Here


                traceWriter.close();
            } catch (final IOException e1) {
            }
        }
        try {
            final DatabaseInstanceManager mgr = (DatabaseInstanceManager) current.getService("DatabaseInstanceManager", "1.0");
            if (mgr == null) {
                System.err.println("service is not available");
            } else if (mgr.isLocalInstance() || force) {
                System.out.println("shutting down database...");
                mgr.shutdown();
            }
        } catch (final XMLDBException e) {
            System.err.println("database shutdown failed: ");
            e.printStackTrace();
        }
View Full Code Here

        }           
    }
   
    protected void tearDown() {
      try {
        DatabaseInstanceManager manager =
          (DatabaseInstanceManager) root.getService("DatabaseInstanceManager", "1.0");
        assertNotNull(manager);
        manager.shutdown();
      } catch (Exception e) {           
            fail(e.getMessage());
        }         
    }
View Full Code Here

                } else {
                    log( msg, Project.MSG_ERR );
                }

            } else {
                final DatabaseInstanceManager mgr = (DatabaseInstanceManager)root.getService( "DatabaseInstanceManager", "1.0" );
                log( "Shutdown database instance", Project.MSG_INFO );
                mgr.shutdown();
            }

        }
        catch( final XMLDBException e ) {
            final String msg = "Error during database shutdown: " + e.getMessage();
View Full Code Here


    private static void shutdown( Collection root )
    {
        try {
            final DatabaseInstanceManager mgr = (DatabaseInstanceManager)root.getService( "DatabaseInstanceManager", "1.0" );

            if( mgr == null ) {
                System.err.println( "service is not available" );
            } else if( mgr.isLocalInstance() ) {
                System.out.println( "shutting down database..." );
                mgr.shutdown();
            }
        }
        catch( final XMLDBException e ) {
            System.err.println( "database shutdown failed: " );
            e.printStackTrace();
View Full Code Here

     * @see TestCase#tearDown()
     */
    public void tearDown() throws Exception {
        // testCollection.removeResource( testCollection .getResource(file_name));
        TestUtils.cleanupDB();
        DatabaseInstanceManager dim =
                (DatabaseInstanceManager) DatabaseManager.getCollection("xmldb:exist:///db", "admin", null).getService("DatabaseInstanceManager", "1.0");
        dim.shutdown();
        DatabaseManager.deregisterDatabase(database);
        database = null;

        System.out.println("tearDown PASSED");
    }
View Full Code Here

    }
   
    public static void shutdownDB(String uri) throws XMLDBException {
        Collection collection = DatabaseManager.getCollection(uri, "admin", "");
        if (collection != null) {
            DatabaseInstanceManager manager = (DatabaseInstanceManager)
            collection.getService("DatabaseInstanceManager","1.0");
            manager.shutdown();
            collection.close();
        }
    }
View Full Code Here

    @AfterClass
    public static void closeDB() {
        TestUtils.cleanupDB();
        try {
            Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
            DatabaseInstanceManager mgr = (DatabaseInstanceManager) root.getService("DatabaseInstanceManager", "1.0");
            mgr.shutdown();
        } catch (XMLDBException e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
    }
View Full Code Here

    @AfterClass
    public static void shutdownDB() {
        TestUtils.cleanupDB();
        try {
            org.xmldb.api.base.Collection root = DatabaseManager.getCollection("xmldb:exist://" + XmldbURI.ROOT_COLLECTION, "admin", "");
            DatabaseInstanceManager mgr = (DatabaseInstanceManager) root.getService("DatabaseInstanceManager", "1.0");
            mgr.shutdown();
        } catch (XMLDBException e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
        testCollection = null;
View Full Code Here

    @AfterClass
    public static void shutdownDB() throws XMLDBException {
        TestUtils.cleanupDB();
        final Collection root = DatabaseManager.getCollection("xmldb:exist://" + XmldbURI.ROOT_COLLECTION, "admin", "");
        final DatabaseInstanceManager mgr = (DatabaseInstanceManager) root.getService("DatabaseInstanceManager", "1.0");
        mgr.shutdown();
        testCollection = null;
    }
View Full Code Here

TOP

Related Classes of org.exist.xmldb.DatabaseInstanceManager

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.