Interface BlockAllocatorRegistry


  • public interface BlockAllocatorRegistry
    Used to track BlockAllocators in transactional environments where you want tighter control over how much memory a particular transaction uses. By using the same BlockAllocator for all resources in a given transaction you can limit the total memory used by that transaction. This also proves to be a useful mechanism to inject BlockAllocators in contexts which are difficult to access with more traditional dependency injection mechanism. One such example is in a ObjectMapper that is deserializing and incoming request.
    • Method Detail

      • getOrCreateAllocator

        BlockAllocator getOrCreateAllocator​(String id)
        Gets or creates a new Block Allocator for the given context (id).
        Parameters:
        id - The id of the context for which you'd like a BlockAllocator.
        Returns:
        The BlockAllocator associated with that id, or a new BlockAllocator for that id which will then be vended for any future calls for that id.