SCA Service Component Architecture SCA
服务构件架构
——
2008.9
5 / 58
SCA Java Common Annotations and APIs Specification 1.00 ,Java 通用注解和 API 规范 v1.00
目录
Copyright Notice ............................................................................................................................................................ 3
License ............................................................................................................................................................................ 3
目录 ................................................................................................................................................................................... 5
1. 通用注解、API、客户程序和实现模型 ................................................................................................................. 7
1.1. 简介 ........................................................................................................................................................................... 7
1.2. 实现的元数据 ........................................................................................................................................................... 7
1.2.1. 服务元数据 ............................................................................................................................................................ 8
1.2.2.@Reference ........................................................................................................................................................... 8
1.2.3. @Property ............................................................................................................................................................. 9
1.2.4. 实现作用域:@Scope、@Init、@Destroy ....................................................................................................... 9
1.3 接口元数据 .............................................................................................................................................................. 10
1.3.1. @Remotable ....................................................................................................................................................... 10
1.3.2. @Conversational ................................................................................................................................................ 11
1.4. 客户 API .................................................................................................................................................................. 11
1.4.1. SCA 构件访问服务 .............................................................................................................................................. 11
1.4.2. 非 SCA 构件的实现访问服务 ............................................................................................................................ 11
1.5. 错误处理 ................................................................................................................................................................. 12
1.6. 异步与会话编程 ..................................................................................................................................................... 12
1.6.1. @OneWay ........................................................................................................................................................... 12
1.6.2. 会话型服务 .......................................................................................................................................................... 13
1.6.3. 将会话型服务作为参数传递 .............................................................................................................................. 13
1.6.4. 会话型客户程序 .................................................................................................................................................. 14
1.6.5. 会话生命周期总结 .............................................................................................................................................. 15
1.6.6. Conversations ID ................................................................................................................................................ 15
1.6.7. 回调 .................................................................................................................................................................... 16
1.6.8. 会话与回调的绑定 ............................................................................................................................................ 21
1.7. Java API .................................................................................................................................................................... 21
1.7.1. Component Context ............................................................................................................................................ 21
1.7.2. Request Context .................................................................................................................................................. 23
1.7.3. CallableReference ............................................................................................................................................... 24
1.7.4. ServiceReference ................................................................................................................................................ 25
1.7.5 Conversation 会话 .................................................................................................................................................. 26
1.7.6. NoRegisteredCallbackException 异常 ....................................................................................................... 26
1.7.7. Service Runtime Exception ................................................................................................................................ 26
1.7.8. Service Unavailable Exception ........................................................................................................................... 27
1.7.9. Conversation Ended Exception........................................................................................................................... 27
1.8 Java 注解 ................................................................................................................................................................... 27
1.8.1. @AllowsPassByReference ................................................................................................................................. 27
1.8.2. @Callback .......................................................................................................................................................... 28
1.8.3. @ComponentName ............................................................................................................................................ 30
1.8.4. @Conversation ................................................................................................................................................... 30