问题标签 [pluggable]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
137 浏览

wordpress - 如何从 wordpress 子主题中过滤可插入功能

我需要将过滤器添加到特定的 wordpress 函数,该函数在可插入函数主题的函数 f 包含的文件中定义

函数.php:

颜色.php:

我使用了一个子主题,当我尝试从子主题的functions.php中过滤这个函数时,什么也没有发生。这是因为父主题的可插拔函数会在子主题调用过滤器之后被调用。

我在子主题的functions.php中的过滤功能是

我怎样才能让这个过滤器工作?

0 投票
1 回答
624 浏览

c# - C# 程序集在子域中创建实例

我正在尝试创建一个插件框架并通过 C# 中的反射加载依赖项。我目前的实现如下:

我有一个创建新应用程序域的 Windows 服务。然后它获取 PluginProxy 并调用 LoadDependencies 和 ProcessProxy。请注意,我正在尝试将依赖项加载到子域中。

问题在于 zGetTypes 方法。该方法能够找到 IPlugin 类型(智能感知显示它)。但是,即使调用 Activator.CreateInstance,类型也不会被初始化(null)。

请注意,如果我在子域中,zGetTypes 无法创建 IPlugin 类型的实例。

程序集程序集 = pluginDomain.Load(AssemblyName.GetAssemblyName(file.FullName));

如果我不创建单独的 appdomain 并且只是将程序集加载到主 appdomain 中,则可以创建实例。在我的例子中,Service 的 appdomain 创建了子 appdomain。我想将加载插件程序集的责任推给代理。代理从 MarshalByRefObject 派生,因此我可以创建一个实例并从 Windows 服务端解包它。

然后,该服务将插件的加载和生命周期管理委托给代理。代理将通过 LoadDependencies 的方法参数获取子 appdomain 的上下文。

任何想法为什么不创建 IPlugin 的实例?

0 投票
1 回答
2780 浏览

java - 如何构建一个可插拔的java应用程序?

如何编写可插入的 Java 应用程序。我阅读了有关 OSGI 和其他一些插件框架的信息,但我想自己做。有什么简单的方法可以写出我想要的吗?

0 投票
0 回答
224 浏览

spring - Jira Plugin Framework 比较(OSGI/Pluggable 解决方案)

我需要创建一个架构,提供可扩展且灵活的解决方案,以允许未来在许多方面进行自定义,就像“插件架构”通常提供的那样。Java 更可取,所以我现在正在研究 Jira Plugin Framework,它基于 Java,已经支持 Spring 和 OSGI,而且本身也是一个不错的架构。我们可以在这里找到它:https ://developer.atlassian.com/docs/atlassian-platform-common-components/plugin-framework/embedding-the-plugin-framework

很高兴清楚我不想扩展 Jira 本身。我需要使我的应用程序尽可能可扩展,并且我将使用 Jira 插件框架作为基础技术。

这里的任何人都对 jira 插件框架有任何经验,可以为我提供一些指导吗?您甚至知道其他用于构建可插拔和灵活架构的开源解决方案或任何相关的 Java 技术堆栈吗?

0 投票
1 回答
172 浏览

java - 是否可以在运行时添加 jar(带有 web-fragment.xml)(意味着在启动后)

我想在服务器启动并运行后添加可插入的 jar,即带有 web-fragment.xml 的 jar。并对这个jar进行扫描并初始化新添加的jar的web-fragment.xml中定义的servlet组件。

如果这不可能,请说明原因。

0 投票
1 回答
496 浏览

architecture - 我需要关于 c# 中可插拔架构的建议

我将开发一些逻辑来从第三方 API 获取日期。这些 API 有不同的方法名称和参数,我需要记住可插入组件。

我还必须维护成功、失败、获取记录数、凭据信息等的日志。

请在 C# 中提出一些示例,以便我可以开始研究它。

0 投票
2 回答
6962 浏览

database - 如何查找可插拔数据库(oracle)的数据文件

我有一个可插拔数据库。我需要找到这个可插拔数据库的数据文件所在的位置?有什么我可以执行的命令吗?我实际上不记得我在创建可插拔数据库时是否指定了数据文件。

一些指导表示赞赏。

0 投票
1 回答
4296 浏览

user-interface - How to load Typescript module from a file known at runtime (in angular2+electron)

I'm trying to write a little Prove of Concept to find out whether "Angular2 in typescript + Electron" will fullfill the requirements of a future Desktop App project.

But I'm having trouble... Am I trying to achieve the impossible or is there a way to do it? Here's my context:


Short version:

How can i make this run:

#xA;

Without getting this error:

#xA;

Long Version with Context:

Core requirement is a kind of "dynamic frontend plugin system" as I would call it. This means: One part of my UI must be replaceable at runtime - but I don't know the components that will be inserted there in advance.

Example scenario:

My App receives a "foo" event:

#xA;

So it will tell its Plugin manager: Hey I need a UI Component to render a 'foo' event.

The plugin manager searches for a 'fooplugin.ts' file which contains the component, loads the component class from this file dynamically and returns the type. If it does not have a foo plugin now, the user may download this file from the plugin market to the plugin folder and then tries again.

My app then uses DynamicComponentLoader.loadIntoLocation to integrate this dynamically loaded type to the dom and then tells the component to render(leEvent).

This last part with dynamic loading components in angular is no problem, my pain point is the plugin manager method to load a class from a file... The best thing I got so far is this:

#xA;

I run my tsc with "--module commonjs".

When I call the method it tells me that "../mtplugins/foorendererplugin.ts not declared as a dependency"... well, I can't declare the dependency in advance because its only known at runtime.


So, is there a way to load typescript classes from files that are only known at runtime? In Java I think I would do it with a Classloader, so i feel like I need typescript's counterpart of that thing. I actually thought I've read that typescript with commonjs and require() would support this, so maybe this mechanism and angular's system.js integration are biting each other?

I'm new to angular2 and typescript and electron and node, so please forgive if I overlook something basic.


EDIT

As pointed out by Louy the error message is nothing typescript specific. It was thrown by System.js...

Again it turns out that a bit more time spent on learning the technologies you want to use is always a good investment. Indeed I did a novice mistake here: mixing up different module-loading systems. I thought I had to work with CommonJS to be able to load external modules at runtime, but runtime loading is well supported by System.js, too - that means:

instead of

#xA;

I simply had to use

#xA;

Then all you have to do is keep the plugins independent of actual code of the application's core (as this causes module chaos... and is an architectural smell either way), instead depend only on interfaces (Typescript ftw!).

And that's all you need for your pluggable angular2 UI :)

0 投票
1 回答
1060 浏览

plugins - 如何制作可插拔架构 ASP.NET5/MVC 6?

我想构建一个无需重写我的源代码即可添加模块/插件的 Web 应用程序(ASP.NET MVC 6)。

已经阅读了有关 MEF 和区域的信息,但没有多大帮助。

已经克服了这个问题的人可以帮助我吗?

0 投票
1 回答
2907 浏览

database - 受限模式下的 Oracle 12c 可插拔数据库

我们创建了容器数据库,但是当我们尝试创建 PDB 时,它会在受限模式下创建。

以下是 dba_registry 的摘录;

以下是 pdb_plug_in_violations 的输出

有人可以建议我在创建 CDB/PDB 时犯了什么错误。

感谢期待。

问候, 罗希特·古拉蒂