You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Surprisingly, the PluginService API does not have a method to create a
plugin from its class. You can only create one from its associated
PluginInfo. So instantiating a plugin becomes a two-step process:
1. Ask the PluginService for the PluginInfo of a given plugin Class.
2. Tell the PluginService to create an instance from that PluginInfo.
And this process is not fully type-safe, since the
PluginInfo#createInstance(PluginInfo) method only knows the object is
of type PT, not P.
To help address this limitation, each PTService now has a handy
create(Class<P extends PT>) method for creating an instance of that
plugin class. This is useful, since using "new" directly is not enough;
the plugin will not have the application context injected as needed.
0 commit comments