Package org.objectweb.howl.log

Examples of org.objectweb.howl.log.Configuration


            return new JournalImpl(directory,logFileCount,logFileSize);
        }
       
        if( HOWL_JOURNAL_TYPE.equals(journalType) ) {
            try {
                Configuration config = new Configuration();
                config.setLogFileDir(directory.getCanonicalPath());
                return new HowlJournal(config);
            } catch (IOException e) {
                throw e;
            } catch (Exception e) {
                throw (IOException)new IOException("Could not open HOWL journal: "+e.getMessage()).initCause(e);
View Full Code Here


   * @throws IOException
   */
  public XALogger()
    throws IOException
  {
    super(new Configuration());
    init();
  }
View Full Code Here

    }

    protected Configuration createConfiguration() throws IOException, LogConfigurationException {
        String[] names = {"org/codehaus/activemq/howl.properties", "org/codehaus/activemq/defaultHowl.properties"};

        Configuration answer = null;
        for (int i = 0; i < names.length; i++) {
            InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(names[i]);
            if (in == null) {
                in = getClass().getClassLoader().getResourceAsStream(names[i]);
            }
            if (in != null) {
                Properties properties = new Properties();
                properties.load(in);
                answer = new Configuration(properties);
            }
        }
        if (answer == null) {
            log.warn("Could not find file: " + names[0] + " or: " + names[1] + " on the classpath to initialise Howl");
            answer = new Configuration();
        }
        if (directory != null) {
            answer.setLogFileDir(directory.getAbsolutePath());
        }
        return answer;
    }
View Full Code Here

      e.printStackTrace();
    }
  }

  public Journal createJournal() throws Exception {
    Configuration c = new Configuration();
    c.setLogFileDir(journalDirectory.getPath());
    c.setMaxLogFiles(maxLogFiles);
    c.setBufferSize(bufferSize);
    c.setMaxBuffers(maxBuffers);
    c.setMaxBlocksPerFile(maxBlocksPerFile);
    return new HowlJournal( c );
  }
View Full Code Here

            return new JournalImpl(directory);
        }
       
        if( HOWL_JOURNAL_TYPE.equals(journalType) ) {
            try {
                Configuration config = new Configuration();
                config.setLogFileDir(directory.getCanonicalPath());
                return new HowlJournal(config);
            } catch (IOException e) {
                throw e;
            } catch (Exception e) {
                throw (IOException)new IOException("Could not open HOWL journal: "+e.getMessage()).initCause(e);
View Full Code Here

      e.printStackTrace();
    }
  }

  public Journal createJournal() throws Exception {
    Configuration c = new Configuration();
    c.setLogFileDir(journalDirectory.getPath());
    c.setMaxLogFiles(maxLogFiles);
    c.setBufferSize(bufferSize);
    c.setMaxBuffers(maxBuffers);
    c.setMaxBlocksPerFile(maxBlocksPerFile);
    return new HowlJournal( c );
  }
View Full Code Here

            return new JournalImpl(directory);
        }
       
        if( HOWL_JOURNAL_TYPE.equals(journalType) ) {
            try {
                Configuration config = new Configuration();
                config.setLogFileDir(directory.getCanonicalPath());
                return new HowlJournal(config);
            } catch (IOException e) {
                throw e;
            } catch (Exception e) {
                throw (IOException)new IOException("Could not open HOWL journal: "+e.getMessage()).initCause(e);
View Full Code Here

    }

    protected Configuration createConfiguration() throws IOException, LogConfigurationException {
        String[] names = {"org/codehaus/activemq/howl.properties", "org/codehaus/activemq/defaultHowl.properties"};

        Configuration answer = null;
        for (int i = 0; i < names.length; i++) {
            InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(names[i]);
            if (in == null) {
                in = getClass().getClassLoader().getResourceAsStream(names[i]);
            }
            if (in != null) {
                Properties properties = new Properties();
                properties.load(in);
                answer = new Configuration(properties);
            }
        }
        if (answer == null) {
            log.warn("Could not find file: " + names[0] + " or: " + names[1] + " on the classpath to initialise Howl");
            answer = new Configuration();
        }
        if (directory != null) {
            answer.setLogFileDir(directory.getAbsolutePath());
        }
        return answer;
    }
View Full Code Here

            return new JournalImpl(directory,logFileCount,logFileSize);
        }
       
        if( HOWL_JOURNAL_TYPE.equals(journalType) ) {
            try {
                Configuration config = new Configuration();
                config.setLogFileDir(directory.getCanonicalPath());
                return new HowlJournal(config);
            } catch (IOException e) {
                throw e;
            } catch (Exception e) {
                throw (IOException)new IOException("Could not open HOWL journal: "+e.getMessage()).initCause(e);
View Full Code Here

            return new JournalImpl(directory,logFileCount,logFileSize);
        }
       
        if( HOWL_JOURNAL_TYPE.equals(journalType) ) {
            try {
                Configuration config = new Configuration();
                config.setLogFileDir(directory.getCanonicalPath());
                return new HowlJournal(config);
            } catch (IOException e) {
                throw e;
            } catch (Exception e) {
                throw (IOException)new IOException("Could not open HOWL journal: "+e.getMessage()).initCause(e);
View Full Code Here

TOP

Related Classes of org.objectweb.howl.log.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.