Package org.exist.util

Examples of org.exist.util.Configuration$StartupTriggerConfig


            throws EXistException {
        this.broker = broker;
        this.transaction = transaction;
        // TODO : move the configuration in the constructor or in a dedicated
        // method
        final Configuration config = broker.getConfiguration();
        final String suppressWS = (String) config
            .getProperty(PROPERTY_SUPPRESS_WHITESPACE);
        if (suppressWS != null) {
            if ("leading".equals(suppressWS))
                {normalize = XMLString.SUPPRESS_LEADING_WS;}
            else if ("trailing".equals(suppressWS))
                {normalize = XMLString.SUPPRESS_TRAILING_WS;}
            else if ("none".equals(suppressWS))
                {normalize = 0;}
        }
        Boolean temp;
        if ((temp = (Boolean) config
                .getProperty(PROPERTY_PRESERVE_WS_MIXED_CONTENT)) != null)
            {suppressWSmixed = temp.booleanValue();}
    }
View Full Code Here


            JOptionPane.showMessageDialog( this, "The selected database configuration file " + confFile.getAbsolutePath() + " does not exist or is not readable.", "Configuration Error", JOptionPane.ERROR_MESSAGE );
            return( false );
        }

        try {
            final Configuration config = new Configuration( confFile.getAbsolutePath(), null );
            BrokerPool.configure( 1, 5, config );
            pool = BrokerPool.getInstance();
            return( true );
        }
        catch( final Exception e ) {
View Full Code Here

    };

    protected static BrokerPool startDB( String configFile )
    {
        try {
            Configuration config;

            if( configFile == null ) {
                config = new Configuration();
            } else {
                config = new Configuration( configFile, null );
            }
            config.setProperty(BrokerPool.PROPERTY_EXPORT_ONLY, Boolean.TRUE);
            BrokerPool.configure( 1, 5, config );
            return( BrokerPool.getInstance() );
        }
        catch( final DatabaseConfigurationException e ) {
            System.err.println( "ERROR: Failed to open database: " + e.getMessage() );
View Full Code Here

        }
    }

    private void startDB() {
        try {
            Configuration config = new Configuration();

            BrokerPool.configure(1, 5, config);
            pool = BrokerPool.getInstance();
        } catch (DatabaseConfigurationException e) {
            e.printStackTrace();
View Full Code Here

  private int availableBrokers = 0;
  private int maxBrokers = 0;
  private Map<String, IndexStats> indexStats = new TreeMap<String, IndexStats>();
 
  public DatabaseStatus(BrokerPool pool) {
    final Configuration conf = pool.getConfiguration();
   
    // get id for this instance
    id = pool.getId();
   
    // paths
    //confPath = conf.getPath();
    dataDir = (String)conf.getProperty(BrokerPool.PROPERTY_DATA_DIR);
   
    // broker statistics
    runningBrokers = pool.countActiveBrokers();
    availableBrokers = pool.available();
    maxBrokers = pool.getMax();
View Full Code Here

     *@exception  XMLDBException  Description of the Exception
   */
  private void configure(String instanceName) throws XMLDBException {
        // System.out.println("Configuring '" + instanceName + "' using " + Configuration.getPath(configuration, null));
    try {
      final Configuration config = new Configuration(configuration, null);
      BrokerPool.configure(instanceName, 1, 5, config);
            if (shutdown != null)
                {BrokerPool.getInstance(instanceName).registerShutdownListener(shutdown);}
        } catch (final Exception e ) {
            throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "configuration error: " + e.getMessage(), e );
View Full Code Here

                LOG.debug("No Catalog specified");

            } else if (args[2].isEmpty()) {
                // Use system catalog
                LOG.debug("Using system catalog.");
                final Configuration config = brokerPool.getConfiguration();
                entityResolver = (eXistXMLCatalogResolver) config.getProperty(XMLReaderObjectFactory.CATALOG_RESOLVER);
                setXmlReaderEnitityResolver(xmlReader, entityResolver);

            } else {
                // Get URL for catalog
                final String catalogUrls[] = Shared.getUrls(args[2]);
                final String singleUrl = catalogUrls[0];

                if (singleUrl.endsWith("/")) {
                    // Search grammar in collection specified by URL. Just one collection is used.
                    LOG.debug("Search for grammar in " + singleUrl);
                    entityResolver = new SearchResourceResolver(catalogUrls[0], brokerPool);
                    setXmlReaderEnitityResolver(xmlReader, entityResolver);

                } else if (singleUrl.endsWith(".xml")) {
                    LOG.debug("Using catalogs " + getStrings(catalogUrls));
                    entityResolver = new eXistXMLCatalogResolver();
                    ((eXistXMLCatalogResolver) entityResolver).setCatalogList(catalogUrls);
                    setXmlReaderEnitityResolver(xmlReader, entityResolver);

                } else {
                    LOG.error("Catalog URLs should end on / or .xml");
                }

            }

            // Use grammarpool
            final boolean useCache = ((BooleanValue) args[1].itemAt(0)).getValue();
            if (useCache) {
                LOG.debug("Grammar caching enabled.");
                final Configuration config = brokerPool.getConfiguration();
                grammarPool = (GrammarPool) config.getProperty(XMLReaderObjectFactory.GRAMMER_POOL);
                xmlReader.setProperty(XMLReaderObjectFactory.APACHE_PROPERTIES_INTERNAL_GRAMMARPOOL, grammarPool);
            }

            // Jaxp document
            LOG.debug("Start parsing document");
View Full Code Here

        this.launcher = launcher;
       
        final Properties vmProperties = LauncherWrapper.getVMProperties();
        try {
            Configuration existConfig = new Configuration();
            final int cacheSizeProp = existConfig.getInteger(DefaultCacheManager.PROPERTY_CACHE_SIZE);
            cacheSize.setValue(new Integer(cacheSizeProp));
           
            final int collectionCacheProp = existConfig.getInteger(CollectionCacheManager.PROPERTY_CACHE_SIZE);
            collectionCache.setValue(new Integer(collectionCacheProp));

            final String dir = existConfig.getProperty(BrokerPool.PROPERTY_DATA_DIR).toString();
            dataDir.setText(dir);
        } catch (DatabaseConfigurationException ex) {
            Logger.getLogger(ConfigurationDialog.class.getName()).log(Level.SEVERE, null, ex);
        }
       
View Full Code Here

  /**
   * Start a local database instance.
   */
  private void configure() {
    try {
      Configuration config = new Configuration();
      BrokerPool.configure(1, 5, config);
    } catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
    }
View Full Code Here

        DBBroker broker = null;
        TransactionManager txnManager = null;
        Txn txn = null;
        try {
            File confFile = ConfigurationHelper.lookup("conf.xml");
            Configuration config = new Configuration(confFile.getAbsolutePath());
            BrokerPool.configure(1, 5, config);
            pool = BrokerPool.getInstance();
          pool.getPluginsManager().addPlugin("org.exist.storage.md.Plugin");
          broker = pool.get(pool.getSecurityManager().getSystemSubject());
           
View Full Code Here

TOP

Related Classes of org.exist.util.Configuration$StartupTriggerConfig

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.