Package org.infinispan.persistence
Class InitializationContextImpl
- java.lang.Object
-
- org.infinispan.persistence.InitializationContextImpl
-
- All Implemented Interfaces:
InitializationContext
public class InitializationContextImpl extends Object implements InitializationContext
- Since:
- 6.0
- Author:
- Mircea Markus
-
-
Constructor Summary
Constructors Constructor Description InitializationContextImpl(StoreConfiguration configuration, Cache cache, KeyPartitioner keyPartitioner, PersistenceMarshaller marshaller, org.infinispan.commons.time.TimeService timeService, ByteBufferFactory byteBufferFactory, MarshallableEntryFactory marshallableEntryFactory, Executor nonBlockingExecutor, GlobalConfiguration globalConfiguration, org.infinispan.util.concurrent.BlockingManager blockingManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.infinispan.util.concurrent.BlockingManagergetBlockingManager()Returns a manager that is designed to execute tasks that may block.ByteBufferFactorygetByteBufferFactory()To be used for buildingByteBufferobjects.CachegetCache()StoreConfigurationgetConfiguration()ExecutorServicegetExecutor()Deprecated.GlobalConfigurationgetGlobalConfiguration()Returns the global configurationKeyPartitionergetKeyPartitioner()The configured partitioner that can be used to determine which segment a given key belongs to.<K,V>
MarshallableEntryFactory<K,V>getMarshallableEntryFactory()Should be used to build allMarshallableEntryobjects.ExecutorgetNonBlockingExecutor()Returns an executor that Infinispan uses internally for non blocking tasks.PersistenceMarshallergetPersistenceMarshaller()Returns the persistence marshaller which should be used to marshall/unmarshall all stored bytes.org.infinispan.commons.time.TimeServicegetTimeService()
-
-
-
Constructor Detail
-
InitializationContextImpl
public InitializationContextImpl(StoreConfiguration configuration, Cache cache, KeyPartitioner keyPartitioner, PersistenceMarshaller marshaller, org.infinispan.commons.time.TimeService timeService, ByteBufferFactory byteBufferFactory, MarshallableEntryFactory marshallableEntryFactory, Executor nonBlockingExecutor, GlobalConfiguration globalConfiguration, org.infinispan.util.concurrent.BlockingManager blockingManager)
-
-
Method Detail
-
getConfiguration
public StoreConfiguration getConfiguration()
- Specified by:
getConfigurationin interfaceInitializationContext
-
getCache
public Cache getCache()
- Specified by:
getCachein interfaceInitializationContext
-
getKeyPartitioner
public KeyPartitioner getKeyPartitioner()
Description copied from interface:InitializationContextThe configured partitioner that can be used to determine which segment a given key belongs to. This is useful when a store is segmented (ie. implementsSegmentedAdvancedLoadWriteStore).- Specified by:
getKeyPartitionerin interfaceInitializationContext- Returns:
- partitioner that can provide what segment a key maps to
-
getTimeService
public org.infinispan.commons.time.TimeService getTimeService()
- Specified by:
getTimeServicein interfaceInitializationContext
-
getByteBufferFactory
public ByteBufferFactory getByteBufferFactory()
Description copied from interface:InitializationContextTo be used for buildingByteBufferobjects.- Specified by:
getByteBufferFactoryin interfaceInitializationContext
-
getMarshallableEntryFactory
public <K,V> MarshallableEntryFactory<K,V> getMarshallableEntryFactory()
Description copied from interface:InitializationContextShould be used to build allMarshallableEntryobjects.- Specified by:
getMarshallableEntryFactoryin interfaceInitializationContext
-
getExecutor
@Deprecated public ExecutorService getExecutor()
Deprecated.Description copied from interface:InitializationContextReturns the preferred executor to be used by stores if needed. Stores normally shouldn't need this unless they *must* perform some blocking code asynchronously.- Specified by:
getExecutorin interfaceInitializationContext- Returns:
- the executor to be used with stores
-
getNonBlockingExecutor
public Executor getNonBlockingExecutor()
Description copied from interface:InitializationContextReturns an executor that Infinispan uses internally for non blocking tasks. The user must guarantee tasks submitted to this executor will not block the thread it is ran on. Failure to do so can slow down Infinispan's handling of operations as these threads are limited to the number of cores and are used extensively.- Specified by:
getNonBlockingExecutorin interfaceInitializationContext- Returns:
- an executor that can be used to submit tasks that will not block the thread it runs on
-
getBlockingManager
public org.infinispan.util.concurrent.BlockingManager getBlockingManager()
Description copied from interface:InitializationContextReturns a manager that is designed to execute tasks that may block. This manager ensures that only the blocking portion is ran on a blocking thread and any stage is continued on a non blocking thread.- Specified by:
getBlockingManagerin interfaceInitializationContext- Returns:
- a manager that should be used to execute blocking operations
-
getPersistenceMarshaller
public PersistenceMarshaller getPersistenceMarshaller()
Description copied from interface:InitializationContextReturns the persistence marshaller which should be used to marshall/unmarshall all stored bytes.- Specified by:
getPersistenceMarshallerin interfaceInitializationContext
-
getGlobalConfiguration
public GlobalConfiguration getGlobalConfiguration()
Description copied from interface:InitializationContextReturns the global configuration- Specified by:
getGlobalConfigurationin interfaceInitializationContext
-
-