Skip to content

Package io.github.qishr.cascara.common.service

Interface SPL

java.lang.Object
        io.github.qishr.cascara.common.service.SPL

All Implemented Interfaces:
    TreeNode<SPL>


public interface SPL

Field Summary

Modifier and Type Field Description
public static final String CONTENT_TYPE
public static final String JAR_PATH
public static final String JVM_TYPE
public static final String MODULE_NAME
public static final String MODULE_VERSION
public static final String PROVIDER_NAME
public static final String SERVICE_NAME
public static final String TITLE

Method Summary

Modifier and Type Method Description
public static SPL getRoot() Retrieves the root Service Provider Layer.
public static boolean isBooting()
public static T load(Class serviceType, ServiceMetadata metadata) Returns an instance of a specific service provider.
public static T load(Class serviceType) Returns an instance of a service provider.
public static T load(Class serviceType, String defaultProviderFqcn) Returns an instance of a service provider.
public abstract String getName()
public abstract TrackableArray<String> getModules()
public abstract TrackableArray<ServiceMetadata> getDeclaredProviders()
public abstract TrackableArray<ServiceMetadata> getVisibleProviders()
public abstract boolean isPublic()
public abstract SPL getParent()
public abstract List<SPL> getChildren()
public abstract SPL getChild(String name)
public abstract boolean hasChild(String name)
public abstract SPL create(String name) Creates a service provider layer with the specified name.
public abstract SPL createPrivate(String name) Creates private a service provider layer with the specified name.
public abstract void remove(String name)
public abstract Set<Class<ServiceProvider>> findServiceTypes() Returns a list of all known service types.
public abstract Set<ServiceMetadata> findServices() Returns a list of metadata for all known service types.
public abstract ServiceMetadata findProvider(Class<? extends ServiceProvider> serviceType) Retrieves metadata of the nearest known provider of the specified service type.
public abstract ServiceMetadata findProvider(Class<? extends ServiceProvider> serviceType, Predicate<ServiceMetadata> capabilityPredicate) Retrieves metadata of the nearest known provider whose capabilities satisfy the given predicate.
public abstract List<ServiceMetadata> findAllProviders(Class<? extends ServiceProvider> serviceType) Retrieves metadata of all known providers of the specified service type.
public abstract List<ServiceMetadata> findAllProviders(Class<? extends ServiceProvider> serviceType, Predicate<ServiceMetadata> capabilityPredicate) Retrieves metadata of all known providers whose capabilities satisfy the given predicate.
public abstract ServiceMetadata getProvider(String providerName) Retrieves metadata of the specified provider if it exists in this layer, otherwise null is returne.
public abstract List<ServiceMetadata> getProviders() Retrieves metadata of providers in this layer.
public abstract List<ServiceMetadata> getProviders(Class<? extends ServiceProvider> serviceType) Retrieves metadata of providers of the specified service type in this layer.
public abstract List<ServiceMetadata> getProviders(Class<? extends ServiceProvider> serviceType, Predicate<ServiceMetadata> capabilityPredicate) Retrieves metadata of providers in this layer whose capabilities satisfy the given predicate.
public abstract boolean hasProvider(String name)
public abstract void registerClass(Class<?> clazz)
public abstract void registerJar(Path jarPath)

Field Details

CONTENT_TYPE

public static final String CONTENT_TYPE

See Also:

Constant Field Values


JAR_PATH

public static final String JAR_PATH

See Also:

Constant Field Values


JVM_TYPE

public static final String JVM_TYPE

See Also:

Constant Field Values


MODULE_NAME

public static final String MODULE_NAME

See Also:

Constant Field Values


MODULE_VERSION

public static final String MODULE_VERSION

See Also:

Constant Field Values


PROVIDER_NAME

public static final String PROVIDER_NAME

See Also:

Constant Field Values


SERVICE_NAME

public static final String SERVICE_NAME

See Also:

Constant Field Values


TITLE

public static final String TITLE

See Also:

Constant Field Values


Method Details

getRoot

@io.github.qishr.cascara.common.annotation.NonNull
public static SPL getRoot()

Retrieves the root Service Provider Layer.


isBooting

public static boolean isBooting()


load

@io.github.qishr.cascara.common.annotation.NonNull
public static T load(Class serviceType, ServiceMetadata metadata)

Returns an instance of a specific service provider.


load

@io.github.qishr.cascara.common.annotation.NonNull
public static T load(Class serviceType)

Returns an instance of a service provider.


load

@io.github.qishr.cascara.common.annotation.NonNull
public static T load(Class serviceType, String defaultProviderFqcn)

Returns an instance of a service provider.If there is no provider registered, and the FQCN of a valid provider is supplied, an attempt will be made to use the supplied provider.


getName

public abstract String getName()


getModules

public abstract TrackableArray<String> getModules()


getDeclaredProviders

public abstract TrackableArray<ServiceMetadata> getDeclaredProviders()


getVisibleProviders

public abstract TrackableArray<ServiceMetadata> getVisibleProviders()


isPublic

public abstract boolean isPublic()


getParent

public abstract SPL getParent()

Specified By:

TreeNode


getChildren

public abstract List<SPL> getChildren()

Specified By:

TreeNode


getChild

public abstract SPL getChild(String name)


hasChild

public abstract boolean hasChild(String name)


create

public abstract SPL create(String name)

Creates a service provider layer with the specified name.


createPrivate

public abstract SPL createPrivate(String name)

Creates private a service provider layer with the specified name.Providers in a private layer can only be found by searching the private layer or its descendants.


remove

public abstract void remove(String name)


findServiceTypes

public abstract Set<Class<ServiceProvider>> findServiceTypes()

Returns a list of all known service types.


findServices

public abstract Set<ServiceMetadata> findServices()

Returns a list of metadata for all known service types.


findProvider

public abstract ServiceMetadata findProvider(Class<? extends ServiceProvider> serviceType)

Retrieves metadata of the nearest known provider of the specified service type.


findProvider

public abstract ServiceMetadata findProvider(Class<? extends ServiceProvider> serviceType, Predicate<ServiceMetadata> capabilityPredicate)

Retrieves metadata of the nearest known provider whose capabilities satisfy the given predicate.


findAllProviders

public abstract List<ServiceMetadata> findAllProviders(Class<? extends ServiceProvider> serviceType)

Retrieves metadata of all known providers of the specified service type.


findAllProviders

public abstract List<ServiceMetadata> findAllProviders(Class<? extends ServiceProvider> serviceType, Predicate<ServiceMetadata> capabilityPredicate)

Retrieves metadata of all known providers whose capabilities satisfy the given predicate.


getProvider

public abstract ServiceMetadata getProvider(String providerName)

Retrieves metadata of the specified provider if it exists in this layer, otherwise null is returne.


getProviders

public abstract List<ServiceMetadata> getProviders()

Retrieves metadata of providers in this layer.


getProviders

public abstract List<ServiceMetadata> getProviders(Class<? extends ServiceProvider> serviceType)

Retrieves metadata of providers of the specified service type in this layer.


getProviders

public abstract List<ServiceMetadata> getProviders(Class<? extends ServiceProvider> serviceType, Predicate<ServiceMetadata> capabilityPredicate)

Retrieves metadata of providers in this layer whose capabilities satisfy the given predicate.


hasProvider

public abstract boolean hasProvider(String name)


registerClass

public abstract void registerClass(Class<?> clazz)


registerJar

public abstract void registerJar(Path jarPath)