In which scenarios the remote class loading are needed?

北战南征 提交于 2021-01-29 07:14:02

问题


Remote class loading means load classes which are not presented in the place where they are executed.

For example, Java Applet needs to load classes from server to local and execute them locally.

Some programs containing URLClassLoader need load classes from network, and execute locally.

How about RMI? I found a class called RMIClassLoader? Is it remote class loading?


回答1:


A class loader is a way to load classes of any sort: Files, network, memory, even dynamically generated ones. A classloader can exist for any way to obtain a valid set of bytes representing a class. The ones you give are good examples. URLClassLoader loads a class from a known URL. RMIClassLoader is used by RMI to load the classes that are unmarshalled locally via classes defined remotely.




回答2:


If you are writing an application server or similar. I.e. JPPF uses remote class loading to perform your distributed computations.



来源:https://stackoverflow.com/questions/19594929/in-which-scenarios-the-remote-class-loading-are-needed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!