Interface ServiceProviderInterface<T>


  • public interface ServiceProviderInterface<T>
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default T factoryCreate()
      Provides a factory method to create an instance of the ServiceProvider provides item.
      default int getPriority()
      Indicate the order in which to use this provider if there are multiple providers for a given service
      default boolean isSingleton()
      Indicate whether one instance of this service should be created and reused by all clients or if a new instance should be created each time.
      default boolean useFactory()
      Returns a boolean that indicates if the PluginServiceLoader should use the factoryCreate method to build and return the service provided by the provides tag.
      default boolean useProxyWrap()
      Returns a boolean if the PluginServiceLoader should use the java.lang.reflect.Proxy that sets the Thread Context ClassLoader on the service
    • Method Detail

      • useProxyWrap

        default boolean useProxyWrap()
        Returns a boolean if the PluginServiceLoader should use the java.lang.reflect.Proxy that sets the Thread Context ClassLoader on the service
        Returns:
        A boolean where true indicates to proxy wrap
      • useFactory

        default boolean useFactory()
        Returns a boolean that indicates if the PluginServiceLoader should use the factoryCreate method to build and return the service provided by the provides tag. If true, the factoryCreate method must be implemented. Otherwise, the PluginRegistry will load the class and call newInstance() of the Class in the provides property of the ServiceLoader annotation.
        Returns:
        A boolean where true indicates to use the factoryCreate method.
      • factoryCreate

        default T factoryCreate()
        Provides a factory method to create an instance of the ServiceProvider provides item.
        Returns:
        An instance of the provided service
      • isSingleton

        default boolean isSingleton()
        Indicate whether one instance of this service should be created and reused by all clients or if a new instance should be created each time.
        Returns:
        A boolean where true indicates that one instance should be created and reused for the lifetime of the application.
      • getPriority

        default int getPriority()
        Indicate the order in which to use this provider if there are multiple providers for a given service
        Returns:
        An int where a higher number is a higher priority (should be used before lower priorities)