-
Notifications
You must be signed in to change notification settings - Fork 625
Add an extension point to ComponentRuntime. #3967
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
Conversation
It allows augmenting/replacing components as they are requested from ComponentRegistrars. The motivation is to be able to measure initialization time of certain components and at the same time not to introduce this measurement logic directly to the components framework.
Size Report 1Affected Products
Test Logs
Notes |
Coverage Report 1Affected Products
Test Logs
Notes |
Unit Test Results 346 files - 45 346 suites - 45 14m 29s ⏱️ - 2m 15s For more details on these failures, see this check. Results for commit b1cdc39. ± Comparison against base commit 381bf87. ♻️ This comment has been updated with latest results. |
/** Creates a copy of the component with {@link ComponentFactory} replaced. */ | ||
public Component<T> withFactory(ComponentFactory<T> factory) { | ||
return new Component<>( | ||
name, providedInterfaces, dependencies, instantiation, type, factory, publishedEvents); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this for testing only? Looks like the purpose of ComponentFactory
is only for product teams to implement. Once a product defined its factory in its registrars (and supply it via the component builder), it never needs to change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's intended to be used outside of tests, for existing use example see:
Lines 80 to 84 in da0f593
cmp.withFactory( | |
wrap( | |
libraryVersion.getLibraryName(), | |
libraryVersion.getVersion(), | |
cmp.getFactory())); |
* Add an extension point to ComponentRuntime. It allows augmenting/replacing components as they are requested from ComponentRegistrars. The motivation is to be able to measure initialization time of certain components and at the same time not to introduce this measurement logic directly to the components framework. * add license.
It allows augmenting/replacing components as they are requested from
ComponentRegistrars.
The motivation is to be able to measure initialization time of
certain components and at the same time not to introduce this
measurement logic directly to the components framework.