[英]Mule Java Component and Thread Safe
此http://www.mulesoft.org/documentation/display/current/Configuring+Java+Components的摘录为:
When you specify the class directly on the component or pooled-component element, the PrototypeObjectFactory is used by default, and a new instance is created for each invocation, or a new pooled component is created in the case of the PooledJavaComponent
而且,我已经将Java类配置为Mule Java组件,如下所示:
<component class="com.mycompany.SalesOrderProductsHandler" doc:name="Java" />
。 SalesOrderProductsHandler
类已实现org.mule.api.lifecycle.Callable
并具有一个名为targetProductsIndex的状态变量。
我的问题如下:
每次收到新请求时,都会创建com.mycompany.SalesOrderProductsHandler
的新实例吗?
该文档是绝对正确的。 附:
<component class="com.mycompany.SalesOrderProductsHandler" />
您将为每次调用获得com.mycompany.SalesOrderProductsHandler
的新实例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.