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

com.github.nill14.utils.init.api.IServiceRegistry Maven / Gradle / Ivy

The newest version!
package com.github.nill14.utils.init.api;

import java.util.Collection;
import java.util.Optional;

import javax.inject.Provider;

import com.github.nill14.utils.init.impl.CallerContext;
import com.github.nill14.utils.init.impl.ServiceRegistry;

@Deprecated
public interface IServiceRegistry {

	 void addSingleton(T serviceBean);
	
	 void addSingleton(String name, T serviceBean);
	
	 void addService(Class serviceBean, IServiceContext context);
	
	 void addService(String name, Class serviceBean, IServiceContext context);
	
	> void addServiceFactory(
			Class iface, String name, Class factoryBean, IServiceContext context);
	
	> void addServiceFactory(
			Class iface, Class factoryBean, IServiceContext context);
	
	 S getService(Class iface);

	 Optional getOptionalService(Class iface);
	
	 S getService(Class iface, String name);

	 Optional getOptionalService(Class iface, String name);
	
	 Collection getServices(Class registrable);

	IPropertyResolver toResolver();

	IBeanInjector toBeanInjector(CallerContext context);


	static IServiceRegistry newRegistry() {
		return new ServiceRegistry();
	}

}