问题标签 [ipojo]
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.
java - ipojo 重新配置期间的数据传输
在重新配置期间,我遇到了与组件之间的数据传输相关的问题ipojo
。这是一个例子:
- 组件
Calcul_1
提供计算服务以返回值(a+b)
(例如f(a,b)=> (a+b)
:) - 组件
Calcul_2
提供计算服务以返回值(a*b)
(例如f(a,b)=> (a*b)
:)
这两个组件实现了相同的计算服务(例如:)f
。
- 现在,我有一个
CallCalcul
使用计算服务的组件Calcul_1
。组件在组件中CallCalcul
调用。然后,接收值 11。f(5,6)
Calcul_1
CallCalcul component
问题:
当
Calcul_1
从 接收到值(5,6)
(尚未计算)时CallCalcul
,CallCalcul
通过将连接器更改为 重新配置Calcul_2
,即它绑定到Calcul_2
。在这种情况下,我如何(5,6)
从Calcul_1
to传输Calcul_2
和返回(5*6=30)
toCallCalcul
?当
Calcul_1
从 接收到值(5,6)
(并计算它们,即 5+6=11)时CallCalcul
,CallCalcul
重新配置。在这种情况下,我怎样才能传输11
和Calcul_2
返回这个值CallCalcul
呢?
java - 休眠一个 iPOJO 组件,全部禁用
我有一个关于 iPOJO 的简单问题。
当组件 iPOJO 休眠时,所有剩余组件也将禁用,尽管它们之间没有依赖关系。为什么?这是一个例子:
组件 1:
组件 2:
两个组件已部署并正在运行。有两个独立的组件。但我单击“打印机 1”按钮。“frame1”组件在 5 秒内处于休眠状态。在这 5 秒内,我无法单击“frame2”组件的“打印机 2”。
java - 如何在 Apache iPOJO 中使用 JPA(休眠)
有没有人有一个如何将JPA(Hibernate)与iPOJO一起使用的例子?
OSGi 捆绑包(使用 iPOJO)与数据库交互的常用方式是什么。例如,EntityManagerFactory 是否作为服务提供?或者是否有一个服务负责使用数据库(并且该服务使用工厂创建一个 EntityManager)?
dependency-injection - How to get an iPojo factory based on the interface it provides
If I want to have a service injected in iPojo using method injection I need to do
Based on the type of the argument it knows which impl to inject just based on the interface. If there are two impls of the same interface it will choose based on some algorithm (service rank?)
Now, if I need multiple intances of the service that need to be created on demand based on an event, I understand I'm supposed to use org.apache.felix.ipojo.Factory and construct the instances through it. The problem I have is that I have not found a way to specify which factory to have injected using only the Interface of the instances of the factory
In other words
is ambiguous. The only way I have found to get the factory injected is using @Bind(filter="(factory.name=myServiceFactoryImpl)"
but this couples the consumer to a concrete provider, which defeats the whole point of OSGi services. What I want to do is in plain english "bind me to a factory whose instances implement the interface MyService". If there are again many providers' factories of the same interface, it should use the same disambiguation mechanism as when injecting instances directly. Is this possible?
osgi - 在 JavaFX 应用程序中使用 iPOJO
我正在做一个Javafx
应用程序Apache Felix
以及一些使用iPOJO
.
首先是我Application.launch()
在另一个类中调用该方法,然后启动另一个包含iPOJO @Requires
这样的类:
这个实现抛出了这个异常,java.lang.IllegalStateException: Toolkit not initialized
但是定位到了接口iPOJO
的实现类。LibraryClass
经过一些研究,我发现应用程序应该在扩展的类中,javafx.application.Application
所以我做了一些重组。
编辑
LibraryClass
接口和实现:
现在iPOJO
throws aRuntimeException
和LibraryClass
becomenull
并且应用程序抛出 a NullPointerException
。
我的问题是:
- 这种情况下可以使用
iPOJO
吗? - 如果是
iPOJO
在JavaFX
应用程序中使用的正确方法是什么?
提前致谢!:D
osgi - 使用 apache cxf 将 osgi 服务公开为 JAX-RS
有人可以为我提供一个简单的示例,以在部署在 apache felix 上的 osgi 包中使用 apache cxf 公开 Restful 服务。我们没有使用 Apache Karaf 或任何其他应用程序服务器的选项。另外,我们计划使用 iPojo 进行依赖注入。
osgi - 使用 UDP 配置 DOSGi
我使用 DOSGi 通过本地网络连接两个 OSGi 组件(iPOJO 组件)。我使用 SOAP 或 RESTful-JAX RS 对其进行了配置。但是,两者都使用 TCP 进行通信(我在 Wireshark 中看到了这一点)。
现在,我想用 UDP 配置 SOAP 或 RESTful-JAX RS。我怎样才能做到这一点?谢谢您的帮助。
osgi - 使用 IPOJO 的 OSGI 应用程序
我是 OSGI 应用程序编程的新手 我已经成功使用 KNOPFLERFISH 和 felix gogo 但我的主管要求我使用 IPOJO,IPOJO 和其他有什么区别?你能帮我开始吗!
java - IPOJO:为应用程序提供安全性
IPOJO 如何使用 xml 文件和 java 类为 OSGI 应用程序提供安全性!?我想使用这些属性
H
,L
但我不知道如何
java - iPojo 实例创建和管理
由于我们忘记处理的构造实例,我目前在 iPojo 泄漏方面遇到了很多麻烦。我认为这是使用 ipojo 工厂技术使用命令式实例化的一个不可避免的缺点:基本上,您可以通过调用来说明何时需要您的服务factory.createComponentInstance(config)
,因此您有责任说明何时完成。这迫使我保留两个引用,一个用于我想要使用的服务,还有一个 iPojo 的引用ComponentInstance
,这样当消费者完成时,它可以调用componentInstance.dispose()
. 如果没有,那就有泄漏
在消费者不需要处理 iPojo 服务及其实例的生命周期的情况下,是否有一种更具声明性的方式来做到这一点?
为了简化我的用例,假设有一个带有按钮的 UI,每次按下按钮时,我都需要一个新的、唯一的 iPojo 服务实例。理想情况下,当实例超出范围时,该实例将被 GC 处理,而消费者无需执行任何操作
也许我的错误是将服务用作实例,但我有三个理由使用服务而不是普通类并调用new
.
- 服务实现应该是可替代的
- 消费者应该依赖于一个接口,而不是一个实现/提供者,这不仅是因为#1,而且还因为依赖于具体的 impl 时会产生更多的传递依赖
- 服务 impl 本身有一些依赖项,我希望这些依赖项会被 iPojo 注入(依赖注入)。
作为第二个请求,是否有人知道使用 iPojo 的任何开源、真实(即不是虚拟、演示)项目,我可以将其用作 iPojo 的良好使用示例?