Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the framework class isolation mechanism (Class Isolation Mechanism 2.0) #1235

Closed
12 tasks done
luanwenfei-venus opened this issue Jun 25, 2023 · 0 comments
Closed
12 tasks done
Assignees
Labels
area/framework Issues or PRs releated to sermant core service kind/enhancement Issues or PRs releated to sermant enhancement
Milestone

Comments

@luanwenfei-venus
Copy link
Collaborator

luanwenfei-venus commented Jun 25, 2023

What would you like to be added?

  • Set the Interceptor, ExecuteContext, and Advice interfaces to be globally visible
  • Develop launcher based on Premain: enable user SermantClassLoader to load the framework and start it
  • When creating an Interceptor, there is no longer a distinction between creating it through a fully qualified class name or creating it through new
  • Load plug-in service module through ServiceClassLoader
  • Load the plug-in main module through PluginClassLoader. For non-Sermant classes, PluginClassLoader gives priority to loading through the thread context class loader.
  • Added PluginClassLoader priority loading list,
  • Support PluginClassLoader to configure additional class loaders to obtain classes, mainly loaders for enhanced host service classes
  • Provide an enhanced entrance for the host service class loader, allowing it to use the Sermant class first through the Sermant own loader (the plug-in needs to perform index injection and specify the class loader when loading the Sermant class)
  • For multi-deployment and multi-product Sermant scenarios, they must not affect each other during deployment, and use isolation policies to override the profile configuration scheme.

Compatibility CHECK-LIST

  • Compatible with the situation where the Interceptor scene can be created using the Interceptor name and the host class can be used before refactoring
  • Compatible with the scenario of using SPI to specify ClassLoader in the plug-in before reconstruction (this scenario requires code modification)
  • Compatible with the scenario of injecting classes into Spring before refactoring

Why is this needed?

In the practice of version 1.0, Sermant’s current class isolation architecture solves most of the class conflict problems, but there are also some drawbacks in ease of use and applicability:

  1. When enhancing the classes loaded by BootstrapClassLoader, based on the principle of parental delegation, Sermant cannot directly call the interceptor interface, so it must be done through reflection.
  2. If the classes defined in the plug-in (classes other than the interceptor) use the host service class, they need to be Define when the interceptor is initialized, which will have a great impact on the usability of the plug-in development.
  3. ...
@luanwenfei-venus luanwenfei-venus added area/framework Issues or PRs releated to sermant core service kind/refactor labels Jun 25, 2023
@luanwenfei-venus luanwenfei-venus added this to the v1.2.0 milestone Jun 25, 2023
@luanwenfei-venus luanwenfei-venus self-assigned this Aug 12, 2023
@luanwenfei-venus luanwenfei-venus added the kind/enhancement Issues or PRs releated to sermant enhancement label Sep 28, 2023
@kkf1 kkf1 changed the title 重构框架类隔离机制(类隔离机制2.0) Refactor the framework class isolation mechanism (Class Isolation Mechanism 2.0) Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/framework Issues or PRs releated to sermant core service kind/enhancement Issues or PRs releated to sermant enhancement
Projects
None yet
Development

No branches or pull requests

1 participant