簡體   English   中英

Mule Java組件和線程安全

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM