1.组件简介
Service components contain the business logic for working with the messages passed through Mule ESB. A service component can be any type
of object, including a Spring bean, POJO, script, web service, or REST call.
Because they are highly specific to your implementation, you will typically create your own custom components, or simply use an existing POJO
(由于它们是一种非常特殊的组件,所以你可能去自定义,或者使用一个已经存在的pojo)
Mule also ships with some standard components you can use or extend as needed. (Mule 也提供了一些按照你的需要去使用或拓展的组件).
2.组件分类介绍
(1) Simple Components
There are several simple components included with Mule that are useful for testing or bypassing component execution
这些组件有 <log-component/> <echo-component/> <null-component/> <passthrough-component> <bridge-component/> <test:component/>
(2) Java Components
Java components can be configured quickly and easily by simply specifying the service component implementation class name on the
<component> or <pooled-component> element. The <pooled-component> element allows you to establish a pooling profile for the service
(see Tuning Performance). In both cases, the PrototypeObjectFactory will be used by default and a new object instance will be created for
each request or (for pooled components) for each new object in the pool .
<component class="org.my.ServiceComponentImpl"/>
...
<pooled-component class="org.my.ServiceComponentImpl"/>
Alternatively, you can explicitly specify object factories, such as the SingletonObjectFactory that creates a single instance of the object:
<component>
<singleton-object class="org.my.ServiceComponentImpl"/>
</component>
(3). Other Components
Thereare several other components available that allow you to use different technologies such as web services for your service components.
这些组件有 <http:rest-service-component/> <cxf:wrapper-component/> <script:component/>
(4).Lifecycle 生命周期
Components have a lifecycle like any other object in the Mule registry. Lifecycle can be configured by adding one or more lifecycle interfaces to
your component. Since Mule 3.0 JSR-250 annotations can be used to configure initialise and destroy methods. The following list describes in
order the lifecycle phases for component objects.
这些接口有 initialise start stop dispose
3.Java Component z组件的配置
...先留着...