All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.intarsys.tools.logging.MemoryLogRegistry Maven / Gradle / Ivy

There is a newer version: 4.11
Show newest version
package de.intarsys.tools.logging;

import java.util.HashMap;
import java.util.Map;

public class MemoryLogRegistry {

	final private static MemoryLogRegistry ACTIVE = new MemoryLogRegistry();

	public static MemoryLogRegistry get() {
		return ACTIVE;
	}

	final private Map handlers = new HashMap();

	public MemoryLogHandler[] getHandlers() {
		return (MemoryLogHandler[]) handlers.values().toArray();
	}

	public MemoryLogHandler lookup(String id) {
		return handlers.get(id);
	}

	public void register(MemoryLogHandler handler) {
		handlers.put(handler.getId(), handler);
	}

	public void unregister(MemoryLogHandler handler) {
		handlers.remove(handler.getId());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy