Coder Social home page Coder Social logo

Comments (4)

chibash avatar chibash commented on July 19, 2024

I don't. So the variability is implemented out of the ClassPool object.
Making it an interface is just one option to support variability.

from javassist.

publicocean0 avatar publicocean0 commented on July 19, 2024

I wished to realize a pool using ehcache ... so memory can not overcome a limit .... but can use it also for a huge number of classes created on the fly.....
A simple solution seemed to override variable classes in ClassPool with new Map .... but variable i not defined as Map but Hashtable.
Finally i find a solution but it is not so elegant .... saving class bytecode externally in the ehcache and a different classloader for every call

from javassist.

LunNova avatar LunNova commented on July 19, 2024

It would be nice if it was an interface, but at this point it would be a breaking change - many people will be relying on creating new ClassPool(). Maybe for the next major version?

You can always just extend ClassPool like this: https://github.com/nallar/ModPatcher/blob/master/src/main/java/javassist/ClassLoaderPool.java

Not ideal, as you need to put it in the javassist package for access to many things, but sometimes it's the only option.

from javassist.

LunNova avatar LunNova commented on July 19, 2024

@publicocean0
For the Hashtable issue, you could either override all the methods in ClassPool that use the Hashtable, or if that's not feasible you can extend Hashtable and override every method in it to delegate to your cache. Not nice either, but it works.

from javassist.

Related Issues (20)

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.