Class SupplierSourceContextImpl
- java.lang.Object
-
- net.officefloor.frame.impl.construct.source.SourcePropertiesImpl
-
- net.officefloor.frame.impl.construct.source.SourceContextImpl
-
- net.officefloor.compile.impl.supplier.SupplierSourceContextImpl
-
- All Implemented Interfaces:
SupplierCompileConfiguration
,SupplierCompileContext
,SupplierCompletionContext
,SupplierSourceContext
,ServiceContext
,SourceContext
,SourceProperties
public class SupplierSourceContextImpl extends SourceContextImpl implements SupplierSourceContext, SupplierCompletionContext, SupplierCompileConfiguration
SupplierSourceContext
implementation.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description SupplierSourceContextImpl(java.lang.String supplierSourceName, boolean isLoadingType, java.lang.String[] additionalProfiles, PropertyList propertyList, NodeContext context)
Initiate.
-
Method Summary
-
Methods inherited from class net.officefloor.frame.impl.construct.source.SourceContextImpl
getClassLoader, getClock, getLogger, getName, getOptionalResource, getProfiles, getResource, isLoadingType, loadClass, loadOptionalClass, loadOptionalService, loadOptionalServices, loadService, loadService, loadServices
-
Methods inherited from class net.officefloor.frame.impl.construct.source.SourcePropertiesImpl
addProperty, getProperties, getProperty, getProperty, getPropertyNames
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.officefloor.frame.api.source.SourceContext
getClassLoader, getClock, getLogger, getName, getOptionalResource, getProfiles, getResource, isLoadingType, loadClass, loadOptionalClass, loadOptionalService, loadOptionalServices, loadService, loadService, loadServices
-
Methods inherited from interface net.officefloor.frame.api.source.SourceProperties
getProperties, getProperty, getProperty, getPropertyNames
-
-
-
-
Constructor Detail
-
SupplierSourceContextImpl
public SupplierSourceContextImpl(java.lang.String supplierSourceName, boolean isLoadingType, java.lang.String[] additionalProfiles, PropertyList propertyList, NodeContext context)
Initiate.- Parameters:
supplierSourceName
- Name of theSupplierSource
.isLoadingType
- Indicates if loading type.additionalProfiles
- Additional profiles.propertyList
-PropertyList
.context
-NodeContext
.
-
-
Method Detail
-
getSupplierThreadLocalTypes
public SupplierThreadLocalType[] getSupplierThreadLocalTypes()
Description copied from interface:SupplierCompileConfiguration
Obtains theSupplierThreadLocalType
instances.- Specified by:
getSupplierThreadLocalTypes
in interfaceSupplierCompileConfiguration
- Returns:
SupplierThreadLocalType
instances.
-
getThreadSynchronisers
public ThreadSynchroniserFactory[] getThreadSynchronisers()
Description copied from interface:SupplierCompileConfiguration
Obtains theThreadSynchroniserFactory
instances.- Specified by:
getThreadSynchronisers
in interfaceSupplierCompileConfiguration
- Returns:
ThreadSynchroniserFactory
instances.
-
getSuppliedManagedObjectSourceTypes
public SuppliedManagedObjectSourceType[] getSuppliedManagedObjectSourceTypes()
Description copied from interface:SupplierCompileConfiguration
Obtains theSuppliedManagedObjectSourceType
instances.- Specified by:
getSuppliedManagedObjectSourceTypes
in interfaceSupplierCompileConfiguration
- Returns:
SuppliedManagedObjectSourceType
instances.
-
getInternalSuppliers
public InternalSupplier[] getInternalSuppliers()
Description copied from interface:SupplierCompileConfiguration
Obtains theInternalSupplier
instances.- Specified by:
getInternalSuppliers
in interfaceSupplierCompileConfiguration
- Returns:
InternalSupplier
instances.
-
getCompileCompletions
public SupplierCompileCompletion[] getCompileCompletions()
Description copied from interface:SupplierCompileConfiguration
Obtains theSupplierCompileCompletion
instances.- Specified by:
getCompileCompletions
in interfaceSupplierCompileConfiguration
- Returns:
SupplierCompileCompletion
instances.
-
addSupplierThreadLocal
public <T> SupplierThreadLocal<T> addSupplierThreadLocal(java.lang.String qualifier, java.lang.Class<? extends T> type)
Description copied from interface:SupplierCompileContext
Adds a
SupplierThreadLocal
.This allows integrating third party libraries that require
ThreadLocal
access to objects.- Specified by:
addSupplierThreadLocal
in interfaceSupplierCompileContext
- Type Parameters:
T
- Type of object to be returned from theSupplierThreadLocal
.- Parameters:
qualifier
- Qualifier for theAutoWire
. May benull
to match only on type.type
- Type forAutoWire
.- Returns:
SupplierThreadLocal
to obtain the object.
-
addThreadSynchroniser
public void addThreadSynchroniser(ThreadSynchroniserFactory threadSynchroniserFactory)
Description copied from interface:SupplierCompileContext
Adds a
ThreadSynchroniser
.This enables keeping the
ThreadLocal
instances of the integrating third party library consistent across theThread
instances.- Specified by:
addThreadSynchroniser
in interfaceSupplierCompileContext
- Parameters:
threadSynchroniserFactory
-ThreadSynchroniserFactory
.
-
addManagedObjectSource
public <D extends java.lang.Enum<D>,F extends java.lang.Enum<F>> SuppliedManagedObjectSource addManagedObjectSource(java.lang.String qualifier, java.lang.Class<?> type, ManagedObjectSource<D,F> managedObjectSource)
Description copied from interface:SupplierCompileContext
Adds a potentialManagedObjectSource
for dependency injection.- Specified by:
addManagedObjectSource
in interfaceSupplierCompileContext
- Type Parameters:
D
- Dependency type keys.F
-Flow
type keys.- Parameters:
qualifier
- Qualifier for theManagedObjectSource
. May benull
to match only on type.type
- Type of theManagedObjectSource
.managedObjectSource
-ManagedObjectSource
.- Returns:
SuppliedManagedObjectSource
.
-
addInternalSupplier
public void addInternalSupplier(InternalSupplier internalSupplier)
Description copied from interface:SupplierCompileContext
Adds anInternalSupplier
.- Specified by:
addInternalSupplier
in interfaceSupplierCompileContext
- Parameters:
internalSupplier
-InternalSupplier
.
-
addCompileCompletion
public void addCompileCompletion(SupplierCompileCompletion completion)
Description copied from interface:SupplierSourceContext
Adds aSupplierCompileCompletion
to be invoked after compilation of respectiveOfficeFloor
/Office
functionality.- Specified by:
addCompileCompletion
in interfaceSupplierSourceContext
- Parameters:
completion
-SupplierCompileCompletion
.
-
getAvailableTypes
public AvailableType[] getAvailableTypes()
Description copied from interface:SupplierCompletionContext
Obtains the
AvailableType
instances.Note that
ManagedObject
instances provided bySupplierSource
instances are not included. This is becauseSupplierSource
instances are not completed at this time to list their availableManagedObject
instances.- Specified by:
getAvailableTypes
in interfaceSupplierCompletionContext
- Returns:
AvailableType
instances.
-
-