Package com.levigo.jadice.web.server
Interface DocumentDataProviderRegistry
public interface DocumentDataProviderRegistry
Central registration for
DocumentDataProvider
implementations. A
DocumentDataProviderRegistry
manages instances of DocumentDataProvider
implementations for given Source
and PageSegmentHandle
instances.
Usually accessed by calling
com.levigo.jadice.web.conn.server.WebtoolkitServerContext#getDocumentDataProviderRegistry()
.-
Method Summary
Modifier and TypeMethodDescription<SH extends PageSegmentHandle>
ContextualFactory<DocumentDataProvider<?,SH>> getProviderByHandle
(Class<SH> sourceHandle) Gets a previously registeredContextualFactory
instance to create aDocumentDataProvider
.<S extends Source>
ContextualFactory<DocumentDataProvider<S,?>> getProviderBySource
(Class<S> source) Gets a previously registeredContextualFactory
instance to create aDocumentDataProvider
.<S extends Source,
SH extends PageSegmentHandle>
voidregisterProvider
(Class<S> source, Class<SH> sourceHandle, ContextualFactory<? extends DocumentDataProvider<S, SH>> providerFactory) Registers aContextualFactory
instance to create aDocumentDataProvider
.<S extends Source,
SH extends PageSegmentHandle>
voidregisterProvider
(Class<S> source, Class<SH> sourceHandle, DocumentDataProvider<S, SH> provider) Registers aDocumentDataProvider
implementation for the providedSource
andPageSegmentHandle
types.
-
Method Details
-
registerProvider
<S extends Source,SH extends PageSegmentHandle> void registerProvider(Class<S> source, Class<SH> sourceHandle, DocumentDataProvider<S, SH> provider) Registers aDocumentDataProvider
implementation for the providedSource
andPageSegmentHandle
types.- Type Parameters:
S
- The actualSource
.SH
- The actualPageSegmentHandle
.- Parameters:
source
- A use-case-specific implementation of aSource
.sourceHandle
- A use-case-specific implementation of aPageSegmentHandle
.provider
- TheDocumentDataProvider
implementation to be used for a givenSource
orPageSegmentHandle
.
-
registerProvider
<S extends Source,SH extends PageSegmentHandle> void registerProvider(Class<S> source, Class<SH> sourceHandle, ContextualFactory<? extends DocumentDataProvider<S, SH>> providerFactory) Registers aContextualFactory
instance to create aDocumentDataProvider
. TheContextualFactory
indirection allows to create instances specific to the context of the invocation.- Type Parameters:
S
- the actualSource
.SH
- the actualPageSegmentHandle
- Parameters:
source
- aclass
extendingSource
sourceHandle
- aclass
extendingPageSegmentHandle
providerFactory
- aContextualFactory
in charge to createDocumentDataProvider
implementations based on theInvocationContext
-
getProviderBySource
<S extends Source> ContextualFactory<DocumentDataProvider<S,?>> getProviderBySource(Class<S> source) Gets a previously registeredContextualFactory
instance to create aDocumentDataProvider
.- Type Parameters:
S
- The actualSource
.- Parameters:
source
- A use-case-specific implementation of aSource
.- Returns:
- the
ContextualFactory
instance
-
getProviderByHandle
<SH extends PageSegmentHandle> ContextualFactory<DocumentDataProvider<?,SH>> getProviderByHandle(Class<SH> sourceHandle) Gets a previously registeredContextualFactory
instance to create aDocumentDataProvider
.- Type Parameters:
SH
- the actualPageSegmentHandle
- Parameters:
sourceHandle
- aclass
extendingPageSegmentHandle
- Returns:
- the
ContextualFactory
instance
-