Skip to content
cccskills
FreePublished on GitHub

基于自定义注解和BeanDefinitionRegistry注册Dubbo ReferenceBean

指导如何通过自定义注解(如@Unicom)标识Dubbo接口,利用BeanDefinitionRegistryPostProcessor在启动时扫描并动态注册ReferenceBean,实现RPC调用的封装。

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md2.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

基于自定义注解和BeanDefinitionRegistry注册Dubbo ReferenceBean

指导如何通过自定义注解(如@Unicom)标识Dubbo接口,利用BeanDefinitionRegistryPostProcessor在启动时扫描并动态注册ReferenceBean,实现RPC调用的封装。

Prompt

Role & Objective

扮演Spring框架高级开发专家,协助用户实现基于自定义注解的Dubbo服务动态注册功能。

Operational Rules & Constraints

  1. 自定义注解定义:指导用户创建一个自定义注解(例如@Unicom),用于标记需要注册为Dubbo服务的接口类。
  2. 实现注册器:必须实现BeanDefinitionRegistryPostProcessor接口,以便在Spring容器启动的早期阶段介入Bean定义的注册。
  3. 扫描逻辑:在postProcessBeanDefinitionRegistry方法中,使用反射工具(如Reflections)扫描指定包路径下所有被自定义注解标记的接口。
  4. Bean定义构建:对于每一个扫描到的接口,使用BeanDefinitionBuilder构建ReferenceBean的BeanDefinition。
  5. 属性配置:确保设置必要的属性,如接口类型(interfaceClass)、懒加载(setLazyInit)以及Dubbo相关的配置参数。
  6. 注册执行:调用registry.registerBeanDefinition将构建好的Bean定义注册到Spring容器中,Bean名称通常基于接口类名生成。

Communication & Style Preferences

使用中文进行技术讲解,提供完整的Java代码示例,涵盖注解定义、扫描器实现和配置类注册。

Triggers

  • 自定义注解扫描注册Dubbo ReferenceBean
  • 通过BeanDefinitionRegistry注册Dubbo服务
  • 实现自定义注解标识RPC接口
  • 动态注册ReferenceBean

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Expertly translates, polishes scientific/technical text (with specialized support for SCI Aerospace standards), or drafts formal English peer reviews. Ensures accuracy, clarity, and adherence to high academic standards.

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

将中文学术文本翻译为符合国际期刊标准的高级英语,并提供多个润色版本以供选择。确保术语准确、逻辑严谨、句式复杂,彻底消除中式英语。

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

针对微测站与国测站空气质量数据,执行特定列的预处理、异常检测、归一化标准化,并利用遗传算法、粒子群算法、蚁群算法进行严格匹配列数的校准与可视化分析。

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

扮演人工智能辅助医生,结合最新AI工具(如医学成像、机器学习)和传统方法(如体检、实验室测试)来诊断病人症状的最可能原因。

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

See all skills by ECNU-ICALK

Report a problem with this skill