Added: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/MessageFormatter.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/MessageFormatter.html?view=auto&rev=558355 ============================================================================== --- logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/MessageFormatter.html (added) +++ logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/MessageFormatter.html Sat Jul 21 10:20:56 2007 @@ -0,0 +1,166 @@ + + + +MessageFormatter xref + + + +
View Javadoc
+
+1   /*
+2    * Copyright 1999,2005 The Apache Software Foundation.
+3    *
+4    * Licensed under the Apache License, Version 2.0 (the "License");
+5    * you may not use this file except in compliance with the License.
+6    * You may obtain a copy of the License at
+7    *
+8    *      http://www.apache.org/licenses/LICENSE-2.0
+9    *
+10   * Unless required by applicable law or agreed to in writing, software
+11   * distributed under the License is distributed on an "AS IS" BASIS,
+12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+13   * See the License for the specific language governing permissions and
+14   * limitations under the License.
+15   */
+16  
+17  package org.apache.log4j.helpers;
+18  
+19  
+20  /***
+21   * Formats messages according to very simple rules.
+22   * See {@link #format(String,Object)} and
+23   * {@link #format(String,Object,Object)} for more details.
+24   *
+25   * @author Ceki Gülcü
+26   */
+27  public final class MessageFormatter {
+28      /***
+29       * Private formatter since all methods and members are static.
+30       */
+31      private MessageFormatter() {
+32          super();
+33      }
+34  
+35      /***
+36       * Start of replacement block.
+37       */
+38      private static final char DELIM_START = '{';
+39      /***
+40       * End of replacement block.
+41       */
+42      private static final char DELIM_STOP = '}';
+43  
+44      /***
+45       * Performs single argument substitution for the 'messagePattern' passed as
+46       * parameter.
+47       * <p/>
+48       * For example, <code>MessageFormatter.format("Hi {}.", "there");</code>
+49       * will return the string "Hi there.".
+50       * <p/>
+51       * The {} pair is called the formatting element. It serves to designate the
+52       * location where the argument needs to be inserted within the pattern.
+53       *
+54       * @param messagePattern
+55       *     The message pattern which will be parsed and formatted
+56       * @param argument
+57       *     The argument to be inserted instead of the formatting element
+58       * @return The formatted message
+59       */
+60      public static String format(final String messagePattern,
+61                                  final Object argument) {
+62          int j = messagePattern.indexOf(DELIM_START);
+63          int len = messagePattern.length();
+64          char escape = 'x';
+65  
+66          // if there are no { characters or { is the last character
+67          // then we just return messagePattern
+68          if (j == -1 || (j + 1 == len)) {
+69              return messagePattern;
+70          } else {
+71              char delimStop = messagePattern.charAt(j + 1);
+72              if (j > 0) {
+73                  escape = messagePattern.charAt(j - 1);
+74              }
+75              if ((delimStop != DELIM_STOP) || (escape == '//')) {
+76                  // invalid DELIM_START/DELIM_STOP pair or espace character is
+77                  // present
+78                  return messagePattern;
+79              } else {
+80                  StringBuffer sbuf = new StringBuffer(len + 20);
+81                  sbuf.append(messagePattern.substring(0, j));
+82                  sbuf.append(argument);
+83                  sbuf.append(messagePattern.substring(j + 2));
+84                  return sbuf.toString();
+85              }
+86          }
+87      }
+88  
+89      /***
+90       * /**
+91       * Performs a two argument substitution for the 'messagePattern' passed as
+92       * parameter.
+93       * <p/>
+94       * For example, <code>MessageFormatter.format("Hi {}. My name is {}.",
+95       * "there", "David");</code> will return the string
+96       * "Hi there. My name is David.".
+97       * <p/>
+98       * The '{}' pair is called a formatting element. It serves to designate the
+99       * location where the arguments need to be inserted within
+100      * the message pattern.
+101      *
+102      * @param messagePattern
+103      *     The message pattern which will be parsed and formatted
+104      * @param arg1
+105      *     The first argument to replace the first formatting element
+106      * @param arg2
+107      *     The second argument to replace the second formatting element
+108      * @return The formatted message
+109      */
+110     public static String format(final String messagePattern,
+111                                 final Object arg1,
+112                                 final Object arg2) {
+113         int i = 0;
+114         int len = messagePattern.length();
+115 
+116         StringBuffer sbuf = new StringBuffer(messagePattern.length() + 50);
+117 
+118         for (int l = 0; l < 2; l++) {
+119             int j = messagePattern.indexOf(DELIM_START, i);
+120 
+121             if (j == -1 || (j + 1 == len)) {
+122                 // no more variables
+123                 if (i == 0) { // this is a simple string
+124                     return messagePattern;
+125                 } else {
+126                     // add the tail string which contains no variables
+127                     // and return the result.
+128                     sbuf.append(messagePattern.substring(i,
+129                                     messagePattern.length()));
+130                     return sbuf.toString();
+131                 }
+132             } else {
+133                 char delimStop = messagePattern.charAt(j + 1);
+134                 if ((delimStop != DELIM_STOP)) {
+135                     // invalid DELIM_START/DELIM_STOP pair
+136                     sbuf.append(messagePattern.substring(i,
+137                             messagePattern.length()));
+138                     return sbuf.toString();
+139                 }
+140                 sbuf.append(messagePattern.substring(i, j));
+141                 if (l == 0) {
+142                     sbuf.append(arg1);
+143                 } else {
+144                     sbuf.append(arg2);
+145                 }
+146                 i = j + 2;
+147             }
+148         }
+149         // append the characters following the second {} pair.
+150         sbuf.append(messagePattern.substring(i, messagePattern.length()));
+151         return sbuf.toString();
+152     }
+153 }
+
+
+ + Propchange: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/MessageFormatter.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/package-frame.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/package-frame.html?view=auto&rev=558355 ============================================================================== --- logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/package-frame.html (added) +++ logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/package-frame.html Sat Jul 21 10:20:56 2007 @@ -0,0 +1,27 @@ + + + + + + Apache Component Companion for log4j 1.2. 1.0-SNAPSHOT Reference Package org.apache.log4j.helpers + + + + +

+ org.apache.log4j.helpers +

+ +

Classes

+ + + + + \ No newline at end of file Propchange: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/package-frame.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/package-summary.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/package-summary.html?view=auto&rev=558355 ============================================================================== --- logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/package-summary.html (added) +++ logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/package-summary.html Sat Jul 21 10:20:56 2007 @@ -0,0 +1,72 @@ + + + + + + Apache Component Companion for log4j 1.2. 1.0-SNAPSHOT Reference Package $name + + + +
+ +
+
+ +
+ +

Package org.apache.log4j.helpers

+ + + + + + + + + + + + + + + +
Class Summary
+ Constants +
+ MessageFormatter +
+ +
+ +
+
+ +
+
+ Copyright © null Apache Software Foundation. All Rights Reserved. + + \ No newline at end of file Propchange: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/helpers/package-summary.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/package-frame.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/package-frame.html?view=auto&rev=558355 ============================================================================== --- logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/package-frame.html (added) +++ logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/package-frame.html Sat Jul 21 10:20:56 2007 @@ -0,0 +1,27 @@ + + + + + + Apache Component Companion for log4j 1.2. 1.0-SNAPSHOT Reference Package org.apache.log4j + + + + +

+ org.apache.log4j +

+ +

Classes

+ + + + + \ No newline at end of file Propchange: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/package-frame.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/package-summary.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/package-summary.html?view=auto&rev=558355 ============================================================================== --- logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/package-summary.html (added) +++ logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/package-summary.html Sat Jul 21 10:20:56 2007 @@ -0,0 +1,72 @@ + + + + + + Apache Component Companion for log4j 1.2. 1.0-SNAPSHOT Reference Package $name + + + +
+ +
+
+ +
+ +

Package org.apache.log4j

+ + + + + + + + + + + + + + + +
Class Summary
+ LoggerRepositoryExImpl +
+ ULogger +
+ +
+ +
+
+ +
+
+ Copyright © null Apache Software Foundation. All Rights Reserved. + + \ No newline at end of file Propchange: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/package-summary.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/plugins/Pauseable.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/plugins/Pauseable.html?view=auto&rev=558355 ============================================================================== --- logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/plugins/Pauseable.html (added) +++ logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/plugins/Pauseable.html Sat Jul 21 10:20:56 2007 @@ -0,0 +1,52 @@ + + + +Pauseable xref + + + +
View Javadoc
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one or more
+3    * contributor license agreements.  See the NOTICE file distributed with
+4    * this work for additional information regarding copyright ownership.
+5    * The ASF licenses this file to You under the Apache License, Version 2.0
+6    * (the "License"); you may not use this file except in compliance with
+7    * the License.  You may obtain a copy of the License at
+8    *
+9    *      http://www.apache.org/licenses/LICENSE-2.0
+10   *
+11   * Unless required by applicable law or agreed to in writing, software
+12   * distributed under the License is distributed on an "AS IS" BASIS,
+13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+14   * See the License for the specific language governing permissions and
+15   * limitations under the License.
+16   */
+17  
+18  package org.apache.log4j.plugins;
+19  
+20  
+21  /***
+22   * Instances of this interface can be paused, and resumed.
+23   *
+24   * @author Paul Smith (psmith@apache.org)
+25   *
+26   */
+27  public interface Pauseable {
+28      /***
+29       * Set paused state.
+30       * @param paused new value
+31       */
+32    void setPaused(boolean paused);
+33  
+34      /***
+35       * Get paused state.
+36       * @return paused state.
+37       */
+38    boolean isPaused();
+39  }
+
+
+ + Propchange: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/plugins/Pauseable.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/plugins/Plugin.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/plugins/Plugin.html?view=auto&rev=558355 ============================================================================== --- logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/plugins/Plugin.html (added) +++ logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/plugins/Plugin.html Sat Jul 21 10:20:56 2007 @@ -0,0 +1,158 @@ + + + +Plugin xref + + + +
View Javadoc
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one or more
+3    * contributor license agreements.  See the NOTICE file distributed with
+4    * this work for additional information regarding copyright ownership.
+5    * The ASF licenses this file to You under the Apache License, Version 2.0
+6    * (the "License"); you may not use this file except in compliance with
+7    * the License.  You may obtain a copy of the License at
+8    *
+9    *      http://www.apache.org/licenses/LICENSE-2.0
+10   *
+11   * Unless required by applicable law or agreed to in writing, software
+12   * distributed under the License is distributed on an "AS IS" BASIS,
+13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+14   * See the License for the specific language governing permissions and
+15   * limitations under the License.
+16   */
+17  
+18  package org.apache.log4j.plugins;
+19  
+20  import org.apache.log4j.spi.LoggerRepository;
+21  import org.apache.log4j.spi.OptionHandler;
+22  
+23  import java.beans.PropertyChangeListener;
+24  
+25  
+26  /***
+27   * Defines the required interface for all Plugin objects.
+28   * <p/>
+29   * <p>A plugin implements some specific functionality to extend
+30   * the log4j framework.  Each plugin is associated with a specific
+31   * LoggerRepository, which it then uses/acts upon.  The functionality
+32   * of the plugin is up to the developer.
+33   * <p/>
+34   * <p>Examples of plugins are Receiver and Watchdog. Receiver plugins
+35   * allow for remote logging events to be received and processed by
+36   * a repository as if the event was sent locally. Watchdog plugins
+37   * allow for a repository to be reconfigured when some "watched"
+38   * configuration data changes.
+39   *
+40   * @author Mark Womack (mwomack@apache.org)
+41   * @author Nicko Cadell
+42   * @author Paul Smith (psmith@apache.org)
+43   * @since 1.3
+44   */
+45  public interface Plugin extends OptionHandler {
+46      /***
+47       * Gets the name of the plugin.
+48       *
+49       * @return String the name of the plugin.
+50       */
+51      String getName();
+52  
+53      /***
+54       * Sets the name of the plugin.
+55       *
+56       * @param name the name of the plugin.
+57       */
+58      void setName(String name);
+59  
+60      /***
+61       * Gets the logger repository for this plugin.
+62       *
+63       * @return the logger repository to which this plugin is attached.
+64       */
+65      LoggerRepository getLoggerRepository();
+66  
+67      /***
+68       * Sets the logger repository used by this plugin. This
+69       * repository will be used by the plugin functionality.
+70       *
+71       * @param repository the logger repository to attach this plugin to.
+72       */
+73      void setLoggerRepository(LoggerRepository repository);
+74  
+75      /***
+76       * Adds a PropertyChangeListener to this instance which is
+77       * notified only by changes of the property with name propertyName.
+78       *
+79       * @param propertyName
+80       *    the name of the property in standard JavaBean syntax
+81       *    (e.g. for setName(), property="name")
+82       * @param l listener
+83       */
+84      void addPropertyChangeListener(
+85              String propertyName, PropertyChangeListener l);
+86  
+87      /***
+88       * Adds a PropertyChangeListener that will be notified of all property
+89       * changes.
+90       *
+91       * @param l The listener to add.
+92       */
+93      void addPropertyChangeListener(PropertyChangeListener l);
+94  
+95      /***
+96       * Removes a specific PropertyChangeListener from this instances
+97       * registry that has been mapped to be notified of all property
+98       * changes.
+99       *
+100      * @param l The listener to remove.
+101      */
+102     void removePropertyChangeListener(PropertyChangeListener l);
+103 
+104     /***
+105      * Removes a specific PropertyChangeListener from this instance's
+106      * registry which has been previously registered to be notified
+107      * of only a specific property change.
+108      *
+109      * @param propertyName property name, may not be null.
+110      * @param l listener to be removed.
+111      */
+112     void removePropertyChangeListener(
+113             String propertyName, PropertyChangeListener l);
+114 
+115     /***
+116      * True if the plugin is active and running.
+117      *
+118      * @return boolean true if the plugin is currently active.
+119      */
+120     boolean isActive();
+121 
+122     /***
+123      * Returns true if the testPlugin is considered to be "equivalent" to the
+124      * this plugin.  The equivalency test is at the discretion of the plugin
+125      * implementation.  The PluginRegistry will use this method when starting
+126      * new plugins to see if a given plugin is considered equivalent to an
+127      * already running plugin with the same name.  If they are considered to
+128      * be equivalent, the currently running plugin will be left in place, and
+129      * the new plugin will not be started.
+130      * <p/>
+131      * It is possible to override the equals() method, however this has
+132      * more meaning than is required for this simple test and would also
+133      * require the overriding of the hashCode() method as well.  All of this
+134      * is more work than is needed, so this simple method is used instead.
+135      *
+136      * @param testPlugin The plugin to test equivalency against.
+137      * @return Returns true if testPlugin is considered to be equivelent.
+138      */
+139     boolean isEquivalent(Plugin testPlugin);
+140 
+141     /***
+142      * Call when the plugin should be stopped.
+143      */
+144     void shutdown();
+145 }
+
+
+ + Propchange: logging/site/trunk/docs/log4j/companions/component/xref/org/apache/log4j/plugins/Plugin.html ------------------------------------------------------------------------------ svn:mime-type = text/html