GithubHelp home page GithubHelp logo

ehcache-shiro's People

Contributors

583479389 avatar akomakom avatar azure-pipelines[bot] avatar chrisdennis avatar henri-tremblay avatar ljacomet avatar nenko-tabakov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ehcache-shiro's Issues

NullPointerException in createCache(String name)

Hi there,

if a cache is not configured in ehcache.xml, you'll get a NPE.

The problamatic part is configurationbuilder which can be null. You still call the build() method without checking.

Suggestion:

      if (null == configurationBuilder) {
        throw new IllegalStateException("No configuration for the cache with the name [" + name + "] was found. "
            + "Please add it to your ehcache.xml file.");
      }

Provide a way to specify a configuration file

Current code hardcodes the configuration to a specific XML file.

There should be an option - in a Shiro compatible way ideally - to specify a custom config file.

Also we should not read the config file each time a cache needs to be created as is currently the case.

EhcacheShiroManager leaks CacheManagers

Calling EhcacheShiroManager.init() followed by EhcacheShiroManager.setCacheManager will make the EhCache's CacheManager created by 'EhcacheShiroManager' unreachable. Consider the following test case:

EhcacheShiroManager ehcacheShiroManager = new EhcacheShiroManager();
ehcacheShiroManager.init();
CacheManager firstCacheManager = ehcacheShiroManager.getCacheManager();
Assert.assertNotNull(firstCacheManager);

ehcacheShiroManager.setCacheManager(cacheManager);
CacheManager secondCacheManager = ehcacheShiroManager.getCacheManager();
Assert.assertNotSame(firstCacheManager, secondCacheManager);
Assert.assertNotEquals(firstCacheManager, secondCacheManager);

ehcacheShiroManager.destroy();

Assert.assertEquals(Status.UNINITIALIZED, firstCacheManager.getStatus());
Assert.assertEquals(Status.UNINITIALIZED, secondCacheManager.getStatus());

Make a decision on groupId and artifactId

Looking at what has been picked right now, I would change to the following:

  • groupId: org.ehcache.integrations.shiro
  • artifactId: shiro-ehcache3

And we also need to decide on a version. Something close to Shiro? To Ehcache 3? or simply independent?

Comments / counter proposals welcome!

the method getResource should have issue on line 164

Hi, I just tried use the library for my project.
but I found there is a issue in method getResource in class EhcacheShiroManager

the line 164. I found the code always strip the prefix. but when we put the path into. the code use a url for it.

then it always throws a MalformedURLException, and Caused by: java.net.MalformedURLException: no protocol:

I suppose this is a bug for this code.

thanks

Mike

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.