Code Search for Developers
 
 
  

LoggingPlugin.java from PovClipse at Krugle


Show LoggingPlugin.java syntax highlighted

package com.tools.logging;

import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
import java.util.*;

public class LoggingPlugin extends Plugin {
	
	private static LoggingPlugin plugin;

	private ArrayList logManagers = new ArrayList(); 
	
	public LoggingPlugin() {
		super();
		plugin = this;
	}

	public static LoggingPlugin getDefault() {
		return plugin;
	}
	
	/**
	 * Iterates over the list of active log managers and shutdowns each one
	 * before calling the base class implementation. 
	 * @see Plugin#stop
	 */
	public void stop(BundleContext context) throws Exception {
		synchronized (this.logManagers) {
			Iterator it = this.logManagers.iterator();
			while (it.hasNext()) {
				PluginLogManager logManager = (PluginLogManager) it.next();
				logManager.internalShutdown(); 
			}
			this.logManagers.clear(); 
		}
		super.stop(context);
	}
	
	/**
	 * Adds a log manager object to the list of active log managers
	 */	
	void addLogManager(PluginLogManager logManager) {
		synchronized (this.logManagers) {
			if (logManager != null)
				this.logManagers.add(logManager); 
		}
	}
	
	/**
	 * Removes a log manager object from the list of active log managers
	 */
	void removeLogManager(PluginLogManager logManager) {
		synchronized (this.logManagers) {
			if (logManager != null)
				this.logManagers.remove(logManager); 
		}
	}
}



See more files for this project here

PovClipse

PovClipse is an eclipse editor plugin for Povray (Persistence of Vision Raytracer) sceene- and include files.\r\nIt features syntax highlighting, code folding, code assist, outline view as well as running Povray using render configurations.

Project homepage: http://sourceforge.net/projects/povclipse
Programming language(s): Java
License: other

  LoggingPlugin.java
  PluginFileAppender.java
  PluginLogAppender.java
  PluginLogListener.java
  PluginLogManager.java