此内容没有您所选择的语言版本。

3.2. Writing Server-Side Plug-ins


Server-side plug-ins are flexible and while there are some categories that structure the behavior of server-side plug-ins (alerts, content, GUI), generic plug-ins can cover almost any server function.
The outline of writing server-side plug-ins is:
  1. Optional. Manually download example plug-ins to use as a template from The RHQ Project GitHub Page.
  2. Identify the type of plug-in. Each server-side plug-in is managed by a higher level plug-in container, which correlates to the type or function of the plug-in.
  3. Optional. Write custom schema for the plug-in configuration.
  4. Create the directory for the custom plugin in the sourceRoot/modules/enterprise/server/plugins directory. For example:
    mkdir myPlugin
    cd myPlugin/
    mkdir -p src/main/java/org/rhq/enterprise/server/plugins/myPlugin
    mkdir -p src/main/resources/META-INF
    Copy to Clipboard Toggle word wrap
  5. Copy the pom.xml file from a similar existing plug-in to use for the Maven builds to package your new plug-in. For example:
    cp ../alert-email/pom.xml .
    Copy to Clipboard Toggle word wrap
  6. Edit the pom.xml file so that its properties reflect the new plug-in.
    NOTE
    Be sure to include the location of the parent repositories used by server-side plug-ins, which are in https://repository.jboss.org/nexus/content/groups/public/org/rhq/rhq-enterprise-server-plugins-parent/. For example:
      <repositories>
       <repository>
        <snapshots>
         <enabled>true</enabled>
        </snapshots>
        <id>jboss</id>
        <name>JBoss Repository</name>
        <url>https://repository.jboss.org/nexus/content/groups/public/org/rhq/rhq-enterprise-server-plugins-parent/</url>
       </repository>
    ...
      </repositories>
    Copy to Clipboard Toggle word wrap
  7. Write the plug-in descriptor that defines that specific plug-in instance. The plug-in descriptor defines everything from the plug-in classes to scheduled jobs. Plug-in descriptor elements are covered in Section 2.2.1.4, “Plug-in Configuration (Both Global and Local)”.
  8. Implement the Java classes for the plug-in.
  9. Build the plug-in. During the Maven build process, the plug-in files can be validated.
    mvn install
    
    Copy to Clipboard Toggle word wrap
  10. Deploy the plug-in, as in Section 3.4, “Deploying Server-Side Plug-ins”. When a server-side plug-in is deployed on one server, it is automatically propagated to all of the other JBoss ON servers in the cloud.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat