Component Import Module

Purpose of this Module Type

Component Import plugin Moduleは、Conponentがランタイムにアップグレードされても、他のpluginsによって共有されるJava Componentにアクセスすることを可能にします。

Configuration

Component Import plugin Moduleのroot elementはcomponent-importです。
次の属性と子エレメントを持ちます。

Attribute

Name Required Description
Interface コンポーネントをインポートするためのJava Interface。
この属性は、インターフェイスが使われなかったときのみ要求される。
key plugin moduleの識別子。
keyはユニークである必要がある。
filter The LDAP filter to use to match public components (OSGi services). Note: The format of the filter must be a valid LDAP filter. (Plugin Framework 2.3 and later.)

Element

interface The Java interface under which the component to retrieve is registered. This element can appear zero or more times, but is required if the interface attribute is not used.

Example

1つのコンポーネントのインポートを含むコード片。
   <atlassian-plugin name="Hello World" key="example.plugin.helloworld" plugins-version="2">
       <plugin-info>
           <description>A basic component import module test</description>
           <vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
           <version>1.0</version>
       </plugin-info>
    
       <component-import key="helloWorldService">
           <interface>com.myapp.HelloWorldService</interface>
       </component-import>
   </atlassian-plugin>

異なるpluginによって利用可能になったコンポーネントを消費します。
   <atlassian-plugin name="Hello World Provider" key="example.plugin.helloworld.provider" plugins-version="2">
       <plugin-info>
           <description>A basic component module test</description>
           <vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
           <version>1.0</version>
       </plugin-info>

       <component key="helloWorldService" class="com.myapp.internal.MyHelloWorldService" public="true">
           <interface>com.myapp.HelloWorldService</interface>
       </component>
   </atlassian-plugin>

LDAPフィルターの例
   <component-import key="dictionaryService" interface="com.myapp.DictionaryService"
                     filter="(language=English)" />

タグ:

+ タグ編集
  • タグ:
最終更新:2012年07月03日 10:19