Friday, June 13, 2008

Working with Multiple LogServices

The fact that there can be multiple registered services of a particular type can sometimes be problematic. Consider the LogService and it's cousin the LogReaderService. When there are multiple registered LogService and LogReaderService pairs it can be tricky for an application to be able to present a single view of the application's logged messages.

It is this reason that SAT now has a LogReaderAggregatorService. As its name implies, it aggregates each registered LogReaderService and presents a single service API with which to work with the application's entire log. The LogReaderAggregatorService is straight forward:
public interface LogReaderAggregatorService extends LogReaderService {
public Enumeration/*<LogEntry>*/ getLogInOrder();
public boolean isLoggingToConsole();
public void setLogToConsole(boolean logToConsole);
}
Since the interface extends the OSGi-defined LogReaderService you can use the API you're familiar with, such as getLog(), but of course what you'll get back is an Enumeration of every LogEvent for every registered LogReaderService, in reverse chronological order.

The LogReaderAggregatorService interfaces adds the method getLogInOrder() for accessing every logged message in chronological order, and a couple of methods for controlling whether logged messages will be echoed to the console.

While the LogReaderAggregatorService interface is part of the required bundle org.eclipse.soda.sat.core, the implementation lives in the optional bundle org.eclipse.soda.sat.core.log.

Wednesday, June 11, 2008

Eclipse 3.4 is almost here...

If you've not heard, Ganyemede is coming... Time is running out fast, so please consider downloading Eclipse 3.4RC4 and kicking the tires a little. Likewise, Equinox 3.4RC4 is available too. There is still time to report any bugs you might find.

Planet Eclipse

Jazz Community News