Package org.apache.log4j.plugins

Examples of org.apache.log4j.plugins.Plugin


//    cc.activateOptions();
   
//    TODO this should also be fixed up, as VFS bits and pieces might not be built in an Ant build when they don't have all the VFS jars local
    try {
      Class vfsPluginClass = Class.forName("org.apache.log4j.chainsaw.vfs.VFSPlugin");
      Plugin vfsPlugin = (Plugin) vfsPluginClass.newInstance();
      vfsPlugin.activateOptions();
      pluginRegistry.addPlugin(vfsPlugin);
      MessageCenter.getInstance().getLogger().info("Looks like VFS is available... WooHoo!");
    } catch (Throwable e) {
      MessageCenter.getInstance().getLogger().error("Doesn't look like VFS is available", e);
    }
View Full Code Here


                public void run() {
                  PluginRegistry pluginRegistry = LogManager.getLoggerRepository().getPluginRegistry();
                  List list = pluginRegistry.getPlugins(Generator.class);

                  for (Iterator iter = list.iterator(); iter.hasNext();) {
                    Plugin plugin = (Plugin) iter.next();
                    pluginRegistry.stopPlugin(plugin.getName());
                  }
                }
              }).start();
            setEnabled(false);
            startTutorial.putValue("TutorialStarted", Boolean.FALSE);
View Full Code Here

              (DefaultMutableTreeNode) path.getLastPathComponent();

            if (
              (node != null) && (node.getUserObject() != null)
                && (node.getUserObject() instanceof Plugin)) {
              Plugin p = (Plugin) node.getUserObject();
              logger.debug("plugin=" + p);
              pluginEditorPanel.setPlugin(p);
            } else {
              pluginEditorPanel.setPlugin(null);
            }
View Full Code Here

                  panel.getOkPanel().getOkButton().addActionListener(
                    new ActionListener() {
                      public void actionPerformed(ActionEvent e2) {
                        dialog.dispose();
                        Plugin plugin = panel.getPlugin();
                        pluginRegistry.addPlugin(plugin);
                        plugin.activateOptions();
                        MessageCenter.getInstance().addMessage("Plugin '" + plugin.getName() + "' started");
                      }
                    });
                  dialog.show();
                } catch (Exception e1) {
                  e1.printStackTrace();
View Full Code Here

              (DefaultMutableTreeNode) path.getLastPathComponent();

            if (
              (node != null) && (node.getUserObject() != null)
                && (node.getUserObject() instanceof Plugin)) {
              Plugin p = (Plugin) node.getUserObject();
              logger.debug("plugin=" + p);
              pluginEditorPanel.setPlugin(p);
            } else {
              pluginEditorPanel.setPlugin(null);
            }
View Full Code Here

                  panel.getOkPanel().getOkButton().addActionListener(
                    new ActionListener() {
                      public void actionPerformed(ActionEvent e2) {
                        dialog.dispose();
                        Plugin plugin = panel.getPlugin();
                        pluginRegistry.addPlugin(plugin);
                        plugin.activateOptions();
                        MessageCenter.getInstance().addMessage("Plugin '" + plugin.getName() + "' started");
                      }
                    });
                  dialog.show();
                } catch (Exception e1) {
                  e1.printStackTrace();
View Full Code Here

        pluginEditorPanel.addPropertyChangeListener("plugin",
            new PropertyChangeListener() {

                public void propertyChange(PropertyChangeEvent evt) {

                    Plugin plugin = (Plugin) evt.getNewValue();
                    URL url = HelpManager.getInstance().getHelpForClass(
                            plugin.getClass());

                    try {
                        javaDocPane.setPage(url);
                    } catch (IOException e) {
                        MessageCenter.getInstance().getLogger().error(
                            "Failed to load the Help resource for " +
                            plugin.getClass(), e);
                    }
                }
            });
    }
View Full Code Here

  protected Plugin parsePlugin(Element pluginElement) {
    String className = subst(pluginElement.getAttribute(CLASS_ATTR));
    LogLog.debug("Creating plugin: [" + className + ']');

    try {
      Plugin plugin = (Plugin) Loader.loadClass(className).newInstance();
      PropertySetter propSetter = new PropertySetter(plugin);

      plugin.setName(subst(pluginElement.getAttribute(NAME_ATTR)));

      NodeList children = pluginElement.getChildNodes();
      final int length = children.getLength();

      for (int loop = 0; loop < length; loop++) {
View Full Code Here

      } else if (tagName.equals(ROOT_TAG)) {
        parseRoot(currentElement);
      } else if (tagName.equals(RENDERER_TAG)) {
        parseRenderer(currentElement);
      } else if (tagName.equals(PLUGIN_TAG)) {
        Plugin plugin = parsePlugin(currentElement);

        if (plugin != null) {
          repository.getPluginRegistry().addPlugin(plugin);
          plugin.activateOptions();
        }
      }
    }

    // let listeners know the configuration just changed
View Full Code Here

//    cc.activateOptions();
   
//    TODO this should also be fixed up, as VFS bits and pieces might not be built in an Ant build when they don't have all the VFS jars local
    try {
      Class vfsPluginClass = Class.forName("org.apache.log4j.chainsaw.vfs.VFSPlugin");
      Plugin vfsPlugin = (Plugin) vfsPluginClass.newInstance();
      vfsPlugin.activateOptions();
      pluginRegistry.addPlugin(vfsPlugin);
      MessageCenter.getInstance().getLogger().info("Looks like VFS is available... WooHoo!");
    } catch (Throwable e) {
      MessageCenter.getInstance().getLogger().error("Doesn't look like VFS is available", e);
    }
View Full Code Here

TOP

Related Classes of org.apache.log4j.plugins.Plugin

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.