com.instaclustr.guice.ServiceManagerModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons Show documentation
Show all versions of commons Show documentation
Common classes and utilities integrated with various projects
package com.instaclustr.guice;
import java.util.Set;
import com.google.common.util.concurrent.Service;
import com.google.common.util.concurrent.ServiceManager;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.multibindings.Multibinder;
public class ServiceManagerModule extends AbstractModule {
@Override
protected void configure() {
Multibinder.newSetBinder(binder(), Service.class);
}
@Provides
ServiceManager provideServiceManager(final Set services) {
return new ServiceManager(services);
}
}