Top Description Methods
org.jboss.logmanager.configuration

public Interface ConfigurationResource<T>

extends Supplier<T>, AutoCloseable
Known Direct Implementers
org.jboss.logmanager.configuration.ConstantConfigurationResource, org.jboss.logmanager.configuration.LazyConfigurationResource
Imports
java.util.function.Supplier

Represents a configuration resource. If the resource is a AutoCloseable, then invoking close() on this resource will close the resource.
Author
James R. Perkins

Method Summary

Modifier and TypeMethod and Description
public static <T> ConfigurationResource<T>

Returns:

the configuration resource represented by a lazy instance
of
(final Supplier<T>
the supplier used to create the configuration resource
supplier
)

Creates a configuration resource which lazily invokes the supplier.

public static <T> ConfigurationResource<T>

Returns:

the configuration resource represented by a constant instance
of
(final T
the constant instance
instance
)

Creates a configuration resource with the instance as a constant.

Inherited from java.lang.AutoCloseable:
close
Inherited from java.util.function.Supplier:
get

Method Detail

ofback to summary
public static <T> ConfigurationResource<T> of(final Supplier<T> supplier)

Creates a configuration resource which lazily invokes the supplier. Note that close() will only close the resource if get() was first invoked to retrieve the value from the supplier.

Parameters
supplier:Supplier<T>

the supplier used to create the configuration resource

Returns:ConfigurationResource<T>

the configuration resource represented by a lazy instance

ofback to summary
public static <T> ConfigurationResource<T> of(final T instance)

Creates a configuration resource with the instance as a constant. Note that if close() is invoked, get() will return null.

Parameters
instance:T

the constant instance

Returns:ConfigurationResource<T>

the configuration resource represented by a constant instance