T - type of the kept instance.public class ServiceHolderImpl<T> extends Object implements ServiceHolder<T>
InjectionManager and the other information about this instance.| Constructor and Description | 
|---|
ServiceHolderImpl(T service,
                 Class<T> implementationClass,
                 Set<Type> contractTypes,
                 int rank)
Creates a new instance of the service holder which keeps the concrete instance and its additional information. 
 | 
ServiceHolderImpl(T service,
                 Set<Type> contractTypes)
Creates a new instance of the service holder which keeps the concrete instance and its additional information. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
equals(Object o)  | 
Set<Type> | 
getContractTypes()
Gets all contracts which represents the kept instance. 
 | 
Class<T> | 
getImplementationClass()
Gets an implementation class of the instance which is kept in this service holder. 
 | 
T | 
getInstance()
An instance of the service got from  
InjectionManager. | 
int | 
getRank()
Gets ranking of the kept instance. 
 | 
int | 
hashCode()  | 
public ServiceHolderImpl(T service, Set<Type> contractTypes)
service - service instance kept by this holder.contractTypes - types which represent the given instance.public ServiceHolderImpl(T service, Class<T> implementationClass, Set<Type> contractTypes, int rank)
service - service instance kept by this holder.implementationClass - implementation class of the given instance.contractTypes - types which represent the given instance.rank - ranking of the given instance.public T getInstance()
ServiceHolderInjectionManager.getInstance in interface ServiceHolder<T>public Class<T> getImplementationClass()
ServiceHoldergetImplementationClass in interface ServiceHolder<T>public Set<Type> getContractTypes()
ServiceHoldergetContractTypes in interface ServiceHolder<T>public int getRank()
ServiceHoldergetRank in interface ServiceHolder<T>Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.