package
yourpackage;
import
java.util.Collections;
import
java.util.HashMap;
import
java.util.HashSet;
import
java.util.Set;
import
javax.ws.rs.core.Application;
import
javax.ws.rs.ext.Provider;
import
org.apache.cxf.jaxrs.provider.AtomEntryProvider;
import
org.apache.cxf.jaxrs.provider.AtomFeedProvider;
import
org.apache.cxf.management.web.logging.atom.AtomPullServer;
import
org.apache.cxf.management.web.logging.logbrowser.bootstrapping.BootstrapStorage;
import
org.apache.cxf.management.web.logging.logbrowser.bootstrapping.SimpleAuthenticationFilter;
import
org.apache.cxf.management.web.logging.logbrowser.bootstrapping.SimpleXMLSettingsStorage;
@Provider
public
class
LogBrowserApp
extends
Application {
Set<Object> classes =
new
HashSet<Object>();
static
{
AtomPullServer aps =
new
AtomPullServer();
aps.setLoggers(
"yourpackage:INFO"
);
aps.init();
classes.add(aps);
classes.add(
new
AtomFeedProvider());
classes.add(
new
AtomEntryProvider());
classes.add(
new
BootstrapStorage(
new
SimpleXMLSettingsStorage()));
classes.add(
new
SimpleAuthenticationFilter(
new
HashMap<String, String>() {
{
}
}));
classes.add(
new
BootstrapStorage.StaticFileProvider());
classes.add(
new
BootstrapStorage.SettingsProvider());
}
@Override
public
Set<Class<?>> getClasses() {
return
Collections.emptySet();
}
@Override
public
Set<Object> getSingletons() {
return
classes;
}
}