参考:
https://www.ebayopensource.org/wiki/display/TURMERICDOC/Turmeric+Documentation+Overview
Turmeric是一个综合的、由策略驱动的SOA平台,提供了对SOA服务及其消费者的开发、部署、保护、运行和监控等方面的支持。该平台基于Java语言开发;遵循(SOAP、XML、JSON、XACML等)标准;支持WSDL(Doc/Lit模式的SOAP风格以及REST风格);支持多种协议和数据格式。
该平台包括设计时及运行时工具。运行时工具包括核心组件,策略、服务、监控子系统及管理控制台。存储服务、Eclipse开发者工具以及WSDL文档工具则列在设计时工具箱之中。Turmeric的一个独特的功能是,用户可以选择本地绑定(local
binding),从而完全省去序列化及反序列化的工作。
核心组件是服务、消费者以及代码生成等组件的运行时平台。它为其他的协议处理器提供了集成点(Integration
Point)。服务端(SPF,Service Provider Framework)和客户端(SIF,Service
Invocation Framework)平台可通过配置文件及请求/响应处理器进行扩展。
存储(repository)的职责是维护服务及数据资产类型的生命周期并管理它们的变更。它还通过安全的服务暴露出来,用户可使用任何受支持的协议访问它。除设计时服务发现和治理之外,存储(repository)还可用于运行时查找和发现。
策略管理工具提供了对认证、授权、流量控制、限流策略等运行时策略的配置功能。它们通过一个称为“PolicyEnforcement服务”的运行时代理服务执行。
Eclipse插件主要用于类型库创建、浏览、查找及管理。一般来说,所有的Java类型都存在类型库存储中,这些类型是通过XML模式文件和Eclipse插件自动生成的。依赖关系管理以及类型治理并不在此构建系统的功能范围之列,所以必须通过外部的人工流程来完成。
Turmeric is a comprehensive, policy-driven SOA platform that you
can use to develop, deploy, secure, run and monitor SOA services
and consumers. It is a Java based platform, and follows the
standards (WSDL, SOAP, XML, JSON, XACML, etc.).
Eclipse plugins help with the development of services and
consumers. Other important features include:
- Various Quality of Service (QoS) features such as
authentication, authorization, and rate limiting, which you control
by defining respective policies.
- Monitoring capabilities.
- A Repository Service that enables service registration and
governance.
- The Type Library, which provides the ability to define and
manage reusable schema type definitions across services, and
hierarchically organizes them.
- The Error Library, another useful capability that lets you
define and re-use error definitions across services.
- Local binding, which lets you locally bind services to
consumers as a deployment time option, for optimization, without
loss of any generality or changing code.
The Turmeric platform is highly extensible and customizable. For
example, you can easily plug in additional protocol processors,
data formats, handlers and various other capabilities. The platform
is also highly optimized for large-scale environments. eBay uses
this platform internally. Most parts of it are now open source,
replacing functionality dependent on commercial products with
equivalent, open-source implementations. It also has new package
names to match the open-source spirit. This is the first version of
the open-source release of Turmeric, and might have some rough
edges, so please provide feedback and contribute as you see
fit.
What does the Turmeric platform include?
Service Provider Framework (SPF)
Architecture
SOA Service Server-side processing starts from the Framework
Servlet.
- The Framework Servlet (SPFServlet) is the servlet entry point
for the Turmeric Service Provider Framework.
- SPFServlet constructs the MessageContext for the
request. (1)
- It then passes the context to the controller of the provider
framework, Server Message Processor. (2)
- The Server Message Processor manages the provider framework
flow by first executing the inbound pipelines with all its attached
handlers. (3).
- Then the control dispatches the call to the service
implementation. (4)
- The service implementation performs the business logic and
returns the response object in message context. (5)
- The Server Message Processor then passes the control to
outbound pipeline line. (6)
- HTTPServletResponseTransport sends the response back to the
caller. (7, 8, and 9)
- Both in the inbound flow and the outbound flow, appropriate
protocol processors, if any, intercept the handle the message
protocol- specific aspects.
备注:可以看到对于入口的消息,出口的消息分别会被in
pipeline和out
pipeline接管。接管作用类似对整个消息流的AOP横切。在pipeline上可以进行日志和实例记录,访问控制盒授权等相关工作。由Proxy服务转到原生服务在Server
Message Processor完成。
Service Invocation Framework (SIF)
Architecture
Service Invocation Framework (SIF) provides APIs and the
client-side runtime for invoking SOA Services
that publish their interface through a WSDL (Web Services
Description Language):
-
Primarily available as Java API.
- Supports
XML over SOAP (the standard protocol to access WSDL based
services).
- You can
use other data-bindings such as JSON, NV, Fast Infoset for better
performance.
The following diagram and the subsequent explanation provides an
overview of SIF:
- SIF API is exposed through the framework class Service, which
for a client represents an instance of access to a given
service.
- When you invoke a service operation either through
Service.invoke(...) or through
Service.createDispatch(...).invoke(), (1) the request call flow is
routed through the Client Message Processor. (2)
- The Client Message Processor first runs the outbound pipelines
by executing all configured handlers. (3)
- It then forwards the request to the Request Dispatcher.
(4)
- The Request Dispatcher typically passes the request to the
Transport. (5)
- The Transport, based on the type of transport, now calls the
appropriate serializer if serialization is required, and then
routes the request to the appropriate service endpoint. (6)
- When the response is received, Client Message Processor again
runs the inbound pipelines and the response is then routed back to
the client that invoked the request. (7, 8, 9, 10)
- Both in the inbound flow and the outbound flow, appropriate
protocol processors, if any, intercept the handle the message
protocol-specific aspects.
备注:可以看到Transport
factory在末端,实现序列号和反序列号相关操作。并实现相应的路由和Proxy代理操作。对于序列化和反序列化相关架构参考下面。
Serialization and
Deserialization Architecture
- The Turmeric Serialization/Deserialization module is highly
customizable and extensible.
- Using the Serialization Factory and Deserialization Factory,
you can plugin any data format.
- The interactions to the core runtime itself are preformed
through these uniform interfaces.
- Tumeric uses the JAXB interface for many data formats, but
format-specific stream readers and writers are plugged in
underneath.
- Using JAXB for your interface is not mandatory; that logic is
completely self-contained in the respective factories.
- Many formats like XML, JSON, NV, and FastInfoSet are supported,
and you can easily add more, such as Avro or ProtoBuf.
备注:Turmeric的序列化和反序列化模块具有高度的可定制性和可扩展性。Turmeric使用序列化工厂类,可以插件式的加入对任何数据格式的支持。Turmeric使用JAXB接口支持XML,
JSON, NV, and FastInfoSet等多种数据格式。
青春就应该这样绽放 游戏测试:三国时期谁是你最好的兄弟!! 你不得不信的星座秘密