Package cz.o2.proxima.direct.core
Class Context
- java.lang.Object
-
- cz.o2.proxima.direct.core.Context
-
- All Implemented Interfaces:
ContextProvider
,java.io.Serializable
@Stable public class Context extends java.lang.Object implements java.io.Serializable, ContextProvider
Context created in local instance that can be distributed over wire.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Context(UnaryFunction<AttributeFamilyDescriptor,DirectAttributeFamilyDescriptor> attributeFamilyResolver, Factory<java.util.concurrent.ExecutorService> executorFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Context
getContext()
Factory<java.util.concurrent.ExecutorService>
getExecutorFactory()
java.util.concurrent.ExecutorService
getExecutorService()
Get executor for asynchronous tasks.java.util.Optional<DirectAttributeFamilyDescriptor>
resolve(AttributeFamilyDescriptor family)
Convert the givenAttributeFamilyDescriptor
toDirectAttributeFamilyDescriptor
, if possible.DirectAttributeFamilyDescriptor
resolveRequired(AttributeFamilyDescriptor family)
-
-
-
Constructor Detail
-
Context
protected Context(UnaryFunction<AttributeFamilyDescriptor,DirectAttributeFamilyDescriptor> attributeFamilyResolver, Factory<java.util.concurrent.ExecutorService> executorFactory)
-
-
Method Detail
-
getExecutorService
public java.util.concurrent.ExecutorService getExecutorService()
Get executor for asynchronous tasks.- Returns:
ExecutorService
to use in runtime
-
getExecutorFactory
public Factory<java.util.concurrent.ExecutorService> getExecutorFactory()
-
resolve
public java.util.Optional<DirectAttributeFamilyDescriptor> resolve(AttributeFamilyDescriptor family)
Convert the givenAttributeFamilyDescriptor
toDirectAttributeFamilyDescriptor
, if possible.- Parameters:
family
- the family to convert- Returns:
- optionally, the converted family
-
resolveRequired
public DirectAttributeFamilyDescriptor resolveRequired(AttributeFamilyDescriptor family)
-
getContext
public Context getContext()
- Specified by:
getContext
in interfaceContextProvider
-
-