How to reload a specific service in java? -



How to reload a specific service in java? -

how can reload specific .class without having restart entire program? possible accomplish using public void reload ()? if is, how going declare that? want restart .class files (service.class) using service.getinstance ().reload() trigger if possible.

if want load new implementation of class you've loaded, you'll need create new classloader find new implementation , request class and/or object instance through that. note not alter of instances of class in use. tutorials classloader exist on web; i'll refer them details.

if want modify class behind objects are active... that's hot-swapping. not jvms back upwards it, , has limitations in changes can made (nothing changes function signatures, example). it's intended utilize interactive debugging tools, beingness able modify line of code , test new version in context important... , fragility isn't problem because if swap can't made that's lost developer convenience, not end-user data. generally, if think need hot-swapping in debugging environment, you're wrong.

java

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -