pfirmstone / JGDMS

Infrastructure for providing secured micro services, that are dynamically discoverable and searchable over ipv6 networks
https://pfirmstone.github.io/JGDMS/
Apache License 2.0
14 stars 4 forks source link

net.jini.loader.LoadClass creating too many threads. #129

Closed pfirmstone closed 3 years ago

pfirmstone commented 3 years ago

Describe the bug Previously service proxy's were loaded by the same ClassLoader if their codebase annotations and client's ClassLoader (typically the application class loader) were identical. This used the RMIClassLoading mechanism to resolve loaders.

With this mechanism, synchronization on ClassLoader's was found to be a point of contention, so LoadClass was designed to assign one thread to each ClassLoader, to avoid contention.

RMIClassLoader also allowed proxy's from different services to share the same ClassLoader, even if their servers had different identities, which meant that permissions granted to one proxy, could be attained by another.

With the advent of net.jini.jeri.AtomicILFactory, ClassLoaders now also contained the ObjectEndpoint's identity, so that different services didn't share the same ClassLoader, in addition, a ClassLoader is assigned to the Endpoint, and is responsible for class resolution, rather than RMIClassLoading.

This means that many more ClassLoaders are created, in addition there is no longer contention on class loading.