Package com.dbxml.util

Examples of com.dbxml.util.Configuration


   }

   public static final String[] PARAMS_createExtension = {"configuration"};

   public String createExtension(Document configuration) throws DBException {
      Configuration cfg = new Configuration(configuration);
      String name = col.getExtensionManager().create(cfg).getName();
      return col.getExtensionManager().getCanonicalName(name);
   }
View Full Code Here


      if ( !passthru ) {
         SQLBuilder sb;
         if ( mapFile != null && mapFile.length() > 0 ) {
            try {
               Document doc = DOMHelper.parse(new File(mapFile));
               Configuration mapCfg = new Configuration(doc);
               sb = new SQLBuilder(mapCfg);
            }
            catch ( IOException e ) {
               throw new dbXMLException(e);
            }
View Full Code Here

         }

         // Process each child table recursively
         Iterator iter = tbls.iterator();
         while ( iter.hasNext() ) {
            Configuration tbl = (Configuration)iter.next();
            TableInfo mapTbl = new TableInfo();
            mapTbl.parent = map;
            map.tables.add(mapTbl);
            generateMap(mapTbl, tbl);
         }
View Full Code Here

   }

   public void setConfig(Configuration config) throws dbXMLException {
      this.config = config;

      Configuration colConfig = config.getChild(COLLECTIONS);
      if ( colConfig != null ) {
         colConfig.processChildren(COLLECTION,
            new ConfigurationCallback() {
               public void process(Configuration cfg) throws dbXMLException {
                  Collection col = new Collection((Collection)CollectionManager.this);
                  col.setConfig(cfg);
                  collections.put(col.getName(), col);
View Full Code Here

      else {
         final String name = collection.getName();
         boolean dropped = collection.drop();
         if ( dropped ) {
            collections.remove(name);
            Configuration colConfig = config.getChild(COLLECTIONS);
            colConfig.processChildren(COLLECTION,
               new ConfigurationCallback() {
                  public void process(Configuration cfg) {
                     try {
                        if ( cfg.getAttribute(NAME).equals(name) )
                           cfg.delete();
View Full Code Here

         }

         if ( found )
            throw new DBException(FaultCodes.COL_DUPLICATE_COLLECTION, "Duplicate Collection '" + n + "'");

         Configuration colConfig = this.config.getChild(COLLECTIONS, true);
         colConfig.add(cfg);

         collection.setConfig(cfg);
         collections.put(n, collection);

         getDatabase().fireCreateCollection(collection);
View Full Code Here

         System.err.println("FATAL ERROR: Reading configuration file '" + name + "'");
         e.printStackTrace(System.err);
         System.exit(1);
      }
      final Document doc = tmp;
      config = new Configuration(doc);

      Configuration serverConfig = config.getChild(SERVER);

      try {
         boolean logging = config.getBooleanAttribute(LOGGING, true);
         if ( logging ) {
            // Hijack System.out and System.err
            File logFile = null;
            String log = config.getAttribute(LOG);
            if ( log != null && log.length() > 0 )
               logFile = new File(log);
            else
               logFile = new File(new File(System.getProperty(dbXML.PROP_DBXML_HOME)), LOG_FILE);

            if ( logFile != null ) {
               boolean header = !logFile.exists();
               System.out.println("Logging to " + logFile.getPath());

               FileOutputStream fos = new FileOutputStream(logFile.getPath(), true);
               LoggingStream ls = new LoggingStream(fos);
               PrintStream ps = new PrintStream(ls, true);

               if ( header ) {
                  String s = dbXML.Title + " " + dbXML.Version + " Console Log File";
                  ps.println(s);
                  StringBuffer sb = new StringBuffer(s.length());
                  for ( int i = 0; i < s.length(); i++ )
                     sb.append('-');
                  ps.println(sb.toString());
               }
               System.setOut(ps);
               System.setErr(ps);
            }
         }
         else
            System.out.println("Logging to standard output");

      }
      catch ( Exception e ) {
         System.err.println("FATAL ERROR: Can't override standard logging");
         e.printStackTrace(System.err);
         System.exit(1);
      }

      System.out.println("Server startup");

      // Configure the Service Manager
      services.setServer(this);
      services.setConfig(serverConfig.getChild(SERVICES));

      if ( !services.startServices() ) {
         System.err.println("FATAL ERROR: Service manager could not be started");
         System.exit(1);
      }
View Full Code Here

TOP

Related Classes of com.dbxml.util.Configuration

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.