Comments (4)
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.
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.
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.
@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)
- How to get all annotations declared on a class
- org.springframework.transaction.annotation.Transactional
- "NEW followed by no DUP was found" check is probably not necessary
- Exception: java.lang.reflect.InaccessibleObjectException: Unable to make protected
- java.lang.ClassFormatError: Truncated class file HOT 1
- Add contributing and other community docs to javassist
- HotSwapper Cannot be used multiple times
- Triple Licensing HOT 3
- feature request: support for adding Annotations to dynamic Proxies
- How want insert Runnable HOT 1
- Complete example.md
- In Java21, the ConstPool API throws NPE for MethodParameters attributes without parameter names
- NPE of javassist.bytecode.stackmap.TypeData HOT 1
- Can I restore a line bytecode after transformed?
- Bad OSGi metadata in https://repo1.maven.org/maven2/org/javassist/javassist/3.30.0-GA HOT 9
- License condition HOT 4
- Replacing a method call to a private static function of an outer class from within an inner class leads to NoSuchMethodError
- javassist creates invalid class files for Java records when injecting static fields and adding static initializer code
- Request for posting of Maven signing key(s) HOT 2
- Asking about licenses issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javassist.