Class ServiceHolderImpl<T>
java.lang.Object
org.glassfish.jersey.internal.inject.ServiceHolderImpl<T>
- Type Parameters:
T- type of the kept instance.
- All Implemented Interfaces:
ServiceHolder<T>
Implementation of the instance keeper which kept the instance of the class from
InjectionManager and the other information about this instance.-
Constructor Summary
ConstructorsConstructorDescriptionCreates 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. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets all contracts which represents the kept instance.Gets an implementation class of the instance which is kept in this service holder.An instance of the service got fromInjectionManager.intgetRank()Gets ranking of the kept instance.inthashCode()
-
Constructor Details
-
ServiceHolderImpl
Creates a new instance of the service holder which keeps the concrete instance and its additional information.- Parameters:
service- service instance kept by this holder.contractTypes- types which represent the given instance.
-
ServiceHolderImpl
public 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.- Parameters:
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.
-
-
Method Details
-
getInstance
Description copied from interface:ServiceHolderAn instance of the service got fromInjectionManager.- Specified by:
getInstancein interfaceServiceHolder<T>- Returns:
- service instance.
-
getImplementationClass
Description copied from interface:ServiceHolderGets an implementation class of the instance which is kept in this service holder.- Specified by:
getImplementationClassin interfaceServiceHolder<T>- Returns:
- implementation class of the kept instance.
-
getContractTypes
Description copied from interface:ServiceHolderGets all contracts which represents the kept instance.- Specified by:
getContractTypesin interfaceServiceHolder<T>- Returns:
- all contracts.
-
getRank
public int getRank()Description copied from interface:ServiceHolderGets ranking of the kept instance.- Specified by:
getRankin interfaceServiceHolder<T>- Returns:
- instance's ranking.
-
equals
-
hashCode
public int hashCode()
-