Class ServiceBinderImpl<T>
- All Implemented Interfaces:
- ServiceBinder<T>
ServiceBinder implementation.
 Provides some additional methods used in implementation.- 
Method SummaryModifier and TypeMethodDescriptionaddAdditionalClasses(Class<?>... additionalClasses) ServiceBinder.addAdditionalClasses(Class...)method implementation.addAdditionalClassesProvider(IAdditionalClassesProvider additionalClassesProvider) ServiceBinder.addAdditionalClassesProvider(IAdditionalClassesProvider)method implementation.addLibraries(String... librariesToAdd) ServiceBinder.addLibraries(String...)method implementation.addLibrariesProvider(ILibrariesProvider librariesProvider) ServiceBinder.addLibrariesProvider(ILibrariesProvider)method implementation.ServiceBinder.bindTo(Class)method implementation.voidThrowsIllegalStateExceptionif binding is not complete.voidThrowsIllegalStateExceptionif binding is complete.Collection<Class<?>>Returns all the additional classes were added to this binder in case of binding is complete.Returns the bound implementation class in case of binding is complete.String[]Returns all the libraries were added to this binder in case of binding is complete.ServiceBinder.getProcessBinder()method implementationServiceBinder.getService()method implementationbooleanisBound()ServiceBinder.isBound()method implementation.booleanReturns the value set bysetSingleton(boolean)method;falseif this value was not set.static <T> ServiceBinderImpl<T>newInstance(ProcessBinderImpl processBinderImpl, Class<T> service) Creates a new instance with given processBinder for given service.setSingleton(boolean singleton) ServiceBinder.setSingleton(boolean)method implementation.
- 
Method Details- 
newInstancepublic static <T> ServiceBinderImpl<T> newInstance(ProcessBinderImpl processBinderImpl, Class<T> service) Creates a new instance with given processBinder for given service. If given service is not interface, throwsIllegalArgumentException.- Parameters:
- processBinder- given processBinder (not- null)
- service- given service (must be interface, not- null)
 
- 
getServiceServiceBinder.getService()method implementation- Specified by:
- getServicein interface- ServiceBinder<T>
- Returns:
- a service corresponding to this service binder
 
- 
getProcessBinderServiceBinder.getProcessBinder()method implementation- Specified by:
- getProcessBinderin interface- ServiceBinder<T>
- Returns:
- a process binderfor which thisservice binderis created
 
- 
addLibrariesProviderServiceBinder.addLibrariesProvider(ILibrariesProvider)method implementation.- Specified by:
- addLibrariesProviderin interface- ServiceBinder<T>
- Parameters:
- librariesProvider- given- librariesProvider(not- null)
- Returns:
- this instance
 
- 
addLibrariesServiceBinder.addLibraries(String...)method implementation.- Specified by:
- addLibrariesin interface- ServiceBinder<T>
- Parameters:
- librariesToAdd- given list of libraries (not- null)
- Returns:
- this instance
 
- 
addAdditionalClassesProviderpublic ServiceBinderImpl<T> addAdditionalClassesProvider(IAdditionalClassesProvider additionalClassesProvider) ServiceBinder.addAdditionalClassesProvider(IAdditionalClassesProvider)method implementation.- Specified by:
- addAdditionalClassesProviderin interface- ServiceBinder<T>
- Parameters:
- additionalClassesProvider- given- additionalClassesProvider(not- null)
- Returns:
- this instance
 
- 
addAdditionalClassesServiceBinder.addAdditionalClasses(Class...)method implementation.- Specified by:
- addAdditionalClassesin interface- ServiceBinder<T>
- Parameters:
- additionalClasses- given additional classes (not- null)
- Returns:
- this instance
 
- 
setSingletonServiceBinder.setSingleton(boolean)method implementation.- Specified by:
- setSingletonin interface- ServiceBinder<T>
- Parameters:
- singleton- given parameter
- Returns:
- this instance
 
- 
bindToServiceBinder.bindTo(Class)method implementation.- Specified by:
- bindToin interface- ServiceBinder<T>
- Parameters:
- implementation- given implementation of service to bind to service for process with key key. Must be instantiable class. Not- null.
- Returns:
- instance of ProcessBinderfor that thisservice binderis created.
 
- 
isBoundpublic boolean isBound()ServiceBinder.isBound()method implementation.- Specified by:
- isBoundin interface- ServiceBinder<T>
- Returns:
- trueif this binding is complete,- falseotherwise
 
- 
getLibrariesReturns all the libraries were added to this binder in case of binding is complete. If the binding is not complete (not bound already), IllegalStateExceptionwill be thrown.- Specified by:
- getLibrariesin interface- ServiceBinder<T>
- Returns:
- all the libraries were added to this binder (not null)
- Throws:
- IllegalStateException- if the binding is not complete (not bound already)
 
- 
getAdditionalClassesReturns all the additional classes were added to this binder in case of binding is complete. If the binding is not complete (not bound already), IllegalStateExceptionwill be thrown.- Specified by:
- getAdditionalClassesin interface- ServiceBinder<T>
- Returns:
- all the additional classes were added to this binder (not null)
- Throws:
- IllegalStateException- if the binding is not complete (not bound already)
 
- 
getImplementationReturns the bound implementation class in case of binding is complete. If the binding is not complete (not bound already), IllegalStateExceptionwill be thrown.- Specified by:
- getImplementationin interface- ServiceBinder<T>
- Returns:
- the bound implementation class (not null)
- Throws:
- IllegalStateException- if the binding is not complete (not bound already)
 
- 
isSingletonpublic boolean isSingleton()Returns the value set by setSingleton(boolean)method;falseif this value was not set. If the binding is not complete (not bound already),IllegalStateExceptionwill be thrown.- Specified by:
- isSingletonin interface- ServiceBinder<T>
- Returns:
- the value set by setSingleton(boolean)method;falseif this value was not set
- Throws:
- IllegalStateException- if the binding is not complete (not bound already)
 
- 
checkNotBoundpublic void checkNotBound()ThrowsIllegalStateExceptionif binding is complete.
- 
checkBoundpublic void checkBound()ThrowsIllegalStateExceptionif binding is not complete.
 
-