Java Code Examples for org.ehcache.xml.model.SizeOfEngineLimits

Following code examples demonstrate how to use org.ehcache.xml.model.SizeOfEngineLimitsfrom ehcache. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.ehcache.xml.model.SizeOfEngineLimitsand various code implementation of this class.

  public DefaultSizeOfEngineProviderConfigurationParser() {
    super(DefaultSizeOfEngineProviderConfiguration.class,
      ConfigType::getHeapStore, ConfigType::setHeapStore,
      config -> {
        SizeOfEngineLimits sizeOfEngineLimits = new SizeOfEngineLimits(config);
        return new DefaultSizeOfEngineProviderConfiguration(sizeOfEngineLimits.getMaxObjectSize(),
          sizeOfEngineLimits.getUnit(), sizeOfEngineLimits.getMaxObjectGraphSize());
      },
      config -> new SizeofType()
        .withMaxObjectGraphSize(new SizeofType.MaxObjectGraphSize().withValue(BigInteger.valueOf(config.getMaxObjectGraphSize())))
        .withMaxObjectSize(new MemoryType()
          .withValue(BigInteger.valueOf(config.getMaxObjectSize()))
          .withUnit(MemoryUnit.fromValue(config.getUnit().toString()))
        )
    );
  } 


Advertisement
Advertisement