OSGi.NET框架说明

本文档主要针对OSGi.NET模块化框架使用进行了描述

OSGi.NET框架是一个参照了OSGi规范的模块化管理框架。框架为应用程序（组件（bundle））提供了一个标准环境。整个框架可以划分为一些层次：
  • 1.运行环境
  • 2.模块（Bundle）
  • 3.生命周期管理
  • 4.服务注册
  • 5.扩展点支持
目前OSGi.NET具有如下特色：
  • 1.组件的可插拔性：组件可根据业务需要在运行时进行装载、卸载操作
  • 2.组件的动态更新：组件在运行时可更新替换当前版本
  • 3.组件的版本隔离：不同组件引用相同产品的不同版本程序集可以版本隔离
  • 4.组件完整的生命周期：包括已安装、已装载、已激活、启动中、停止中、已卸载
  • 5.组件的加载顺序：组件加载根据业务要求可设置加载级别来控制加载次序
  • 6.组件的通信支持：组件间通过面向服务的编程模型来达到组件间通信、调用的目的
  • 7.组件的扩展支持：组件提供了扩展点及其扩展来满足某个组件的扩展性支持
启动一个OSGi.NET应用程序仅需要如下代码

using System;

using OSGi.NET.Core.Root;

namespace ConsoleDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            //创建框架工厂
            var frameworkFactory = new FrameworkFactory();
            //创建框架内核
            var framework = frameworkFactory.CreateFramework();
            //初始化框架
            framework.Init();
            //启动框架
            framework.Start();

            Console.ReadLine();
        }
    }
}

下面是一个OSGi.NET主程序项目结构

创建一个OSGi.NET项目需要：
1.引用框架内核程序集OSGi.NET.dll
2.添加框架内核配置文件OSGi.NET.properties
3.如需要日志支持，添加log4net.config文件及log4net.dll程序集引用

OSGi.NET项目的默认文件目录结构如下
/程序目录
/程序目录/Bundles/
/程序目录/Bundles/模块A/
/程序目录/Bundles/模块A/Manifest.xml
/程序目录/Bundles/模块A/模块A.dll
/程序目录/Bundles/模块A/Libs/
/程序目录/Bundles/模块A/Libs/*.dll
/程序目录/Bundles/模块B/
/程序目录/Bundles/模块C/
/程序目录/Libs/(可选)
/程序目录/OSGi.NET.properties

注：
程序目录中的Libs文件夹存放个Bundles的共享程序集(也可通过在配置文件中配置共享清单)，如接口契约、公共第三方类库等。
模块A中的Libs文件夹存放其私有程序集。
Manifest.xml作为程序清单文件对模块进行自描述。
OSGi.NET.properties为框架内核配置文件

关于加载次序：
由于业务需求，各模块存在依赖关系的可能，所以模块加载也会有加载顺序的要求，此时可以通过清单文件中Manifest.xml，Bundle节点的StartLevel属性对其加载次序进行设置。数值越小，加载越前。

关于Bundle引用程序集搜索原则：
1.根据加载的Bundle引用程序集，依据程序集名称+版本号匹配原则，优先从[/程序目录/Libs/]目录或共享清单中搜索。
2.如第一步无匹配，则根据程序集名称从[/程序目录/Bundles/模块A/Libs/*.dll]目录搜索，并将搜索到的程序集对应版本关联Bundle。
3.各Bundle下Libs目录程序集在加载中做了Bundle间的隔离，确保不同的Bundle引用的程序集间不会造成影响。即：如存在共享程序集请放置[/程序目录/Libs/]目录或在共享清单配置。


如何使用服务

面向服务的编程模型作为OSGi.NET中模块通信的主要手段，有效隔离了个组件间的依赖，给予了我们一种即插即用的软件开发方法，意味着更强的灵活性。

在OSGi.NET中开发服务，首先需要在公共组件中定义服务契约，特定模块针对服务契约进行实现并将实现服务通过OSGi.NET服务注册机制进行发布，其他关心这个服务的模块仅需要订阅获取这个服务即可使用，这避免了组件间的直接依赖，减少了不必要的耦合。

下面说明在OSGi.NET中服务的使用方式：

1.建立服务契约项目

2.在服务契约组件中定义接口契约IHelloWord

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ServiceContract
{
    public interface IHelloWord
    {
        string SayHi(string name);
    }
}

3.指定组件对服务契约进行实现

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ServiceContract;

namespace BundleDemoA
{
    public class BundleAHelloWord : IHelloWord
    {
        public string SayHi(string name)
        {
            return string.Format("{0} answer: Hi {1}!", "BundleDemoA", name);
        }
    }
}

4.组件进行服务注册发布操作。发布需要指定契约接口IHelloWord，及发布服务对象

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using OSGi.NET.Core;
using OSGi.NET.Event;
using OSGi.NET.Service;

using ServiceContract;

namespace BundleDemoA
{
    public class BundleActivator : IBundleActivator
    {

        private IServiceRegistration serviceRegistration;

        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        public void Start(IBundleContext context)
        {
            //注册发布一个服务
            serviceRegistration = context.RegisterService<IHelloWord>(new BundleAHelloWord());
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        public void Stop(IBundleContext context)
        {
            //取消注册服务
            serviceRegistration.Unregister();
        }
    }
}

5.关注服务的模块订阅获取需要的服务。通过契约接口IHelloWord获取其服务引用

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using OSGi.NET.Core;
using OSGi.NET.Event;

using ReferenceLibrary;

using ServiceContract;

namespace BundleDemoB
{
    public class BundleActivator : IBundleActivator
    {

        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        public void Start(IBundleContext context)
        {
            context.ServiceChanged += ContextOnServiceChanged;
            var serviceReference = context.GetServiceReference<IHelloWord>();
            var service = context.GetService<IHelloWord>(serviceReference);
            service.SayHi("BundleDemoB" + ReferenceClass.GetName());
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ContextOnServiceChanged(object sender, ServiceEventArgs e)
        {
            if (e.GetSercieContracts().Contains(typeof(IHelloWord).Name) && e.GetState() == ServiceEventArgs.REGISTERED)
            {
                //模块注册服务，获取感兴趣的服务
            }
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        public void Stop(IBundleContext context)
        {
            context.ServiceChanged -= ContextOnServiceChanged;
        }
    }
}

6.说明：接口组件定义服务契约，同时被服务实现模块A与服务消费模块B引用。在模块A中对服务契约进行实现，并注册服务。在模块B中通过框架提供的服务获取接口获取服务引用及实例，消费服务。在模块关系上，接口组件属于公共组件，会存放于框架公共组件目录中，而模块A与模块B作为系统模块存放于模块目录中，全部由OSGi框架负责管理加载。

注：由于Bundle在加载过程中有加载级别的概念（即：加载次序），所以在服务获取时，如模块B优先加载并已注册服务，模块A是可以在其激活器的Start方法中访问服务的，反之如果模块A优先于与模块B加载，则模块A如需访问模块B的服务，可以通过ServiceChanged事件中获取服务，或在相应的触发事件中再获取服务，避免无法获取服务的情况。


如何使用激活器

模块激活器作为OSGi.NET中模块的启动装置，负责处理模块的启动和停止操作，对模块提供了访问上下文对象。

任何一个模块都需要包含一个启动激活器，激活器继承自IBundleActivator接口，实现Start和Stop方法，下面是一个激活器及其实现示例。

public interface IBundleActivator
{
   /// <summary>
   /// 插件启动入口。当插件被启动时，如果指定了激活器时，内核会调用激活器的Start方法来完成插件启动。
   /// </summary>
   /// <param name="context">当前插件上下文。</param>
   void Start(IBundleContext context);

    /// <summary>
    /// 插件停止入口。当插件被停止时，如果指定了激活器时，内核会调用激活器的Stop方法来完成插件停止。
    /// </summary>
   /// <param name="context">当前插件上下文。</param>
    void Stop(IBundleContext context);
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using OSGi.NET.Core;
using OSGi.NET.Event;
using OSGi.NET.Service;

using ServiceContract;

namespace BundleDemoA
{
    public class BundleActivator : IBundleActivator
    {

        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        private IServiceRegistration serviceRegistration;

        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        public void Start(IBundleContext context)
        {
            context.ServiceChanged += contextServiceChanged;
            context.ExtensionChanged += ContextOnExtensionChanged;
            serviceRegistration = context.RegisterService<IHelloWord>(new BundleAHelloWord());
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ContextOnExtensionChanged(object sender, ExtensionEventArgs e)
        {
            var stateStr = string.Empty;
            if (e.GetState() == ExtensionEventArgs.LOAD)
            {
                stateStr = "Load";
            }
            else if (e.GetState() == ExtensionEventArgs.UNLOAD)
            {
                stateStr = "UnLoad";
            }
            var extensionStr = new StringBuilder();
            foreach (var xmlNode in e.GetExtensionData().ExtensionList)
            {
                extensionStr.Append(xmlNode.InnerXml);
            }
            log.Info(string.Format("{0} {1} {2} Extension {3}", ((IBundle)sender).GetSymbolicName(), stateStr, e.GetExtensionPoint().Name, extensionStr));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void contextServiceChanged(object sender, OSGi.NET.Event.ServiceEventArgs e)
        {
            log.Info(string.Format("{0} {1} Service {2}", ((IBundle)sender).GetSymbolicName(), e.GetState(), string.Join(",", e.GetSercieContracts())));
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        public void Stop(IBundleContext context)
        {
            serviceRegistration.Unregister();
            context.ServiceChanged -= contextServiceChanged;
            context.ExtensionChanged -= ContextOnExtensionChanged;
        }
    }
}


如何使用扩展点

扩展点为OSGi.NET模块提供了灵活的扩展性。

模块通过暴露扩展点提供扩展，这样其它模块可以实现对指定扩展点进行扩展然后来添加新的功能。被扩展的模块和扩展的模块通过扩展点建立关联。扩展点与扩展都是通过模块清单文件Manifest.xml定义。 扩展点通过ExtensionPoint节点来定义并指定Point属性（即扩展点名称）；扩展则通过Extension来定义，需要指定 Point属性即扩展点名称，并在子节点定义扩展的信息。暴露扩展点的模块通过IBundleContext来获取对指定扩展点 的扩展信息并监听扩展变更事件来动态更新扩展功能。

1.模块A在程序集清单中定义扩展点WpfLeftMenu.TopMenuExtension

<?xml version="1.0" encoding="utf-8"?>
<Bundle AssemblyName="WpfLeftMenu" StartLevel="1">
  <ExtensionPoint Point="WpfLeftMenu.TopMenuExtension" />
</Bundle>

2.模块B在程序清单对扩展点WpfLeftMenu.TopMenuExtension进行扩展

<?xml version="1.0" encoding="utf-8"?>
<Bundle AssemblyName="WpfTopMenuContent" StartLevel="3">
  <Extension Point="WpfLeftMenu.TopMenuExtension">
    <Item Name="菜单A"></Item>
    <Item Name="菜单B"></Item>
    <Item Name="菜单C"></Item>
  </Extension>
</Bundle>

3.在模块A中针对模块B的扩展信息进行支持，注册扩展变更事件，在其加载扩展信息时对其自身功能进行扩展，而在其扩展信息卸载时则移除相应功能

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Xml;

using DevExpress.Xpf.NavBar;

using OSGi.NET.Core;
using OSGi.NET.Event;
using OSGi.NET.Service;

using WpfServiceContract;

namespace WpfLeftMenu
{
    public class BundleActivator : IBundleActivator
    {

        private IServiceRegistration serviceRegistration;
        public static UserControl1 LeftMenu;

        public static IBundleContext BundleContext;

        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        public void Start(IBundleContext context)
        {

            BundleContext = context;

            LeftMenu = new UserControl1();
            context.ExtensionChanged += ContextOnExtensionChanged;

            serviceRegistration = context.RegisterService<ILoadMenuView>(new LoadMenuView());
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        public void Stop(IBundleContext context)
        {
            context.ExtensionChanged -= ContextOnExtensionChanged;
            serviceRegistration.Unregister();
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ContextOnExtensionChanged(object sender, ExtensionEventArgs e)
        {
            if (e.GetState() == ExtensionEventArgs.LOAD)
            {
                if (e.GetExtensionData().Name == "WpfLeftMenu.TopMenuExtension")
                {
                    LeftMenu.TopGroup.Items.Clear();
                    foreach (XmlNode xmlNode in e.GetExtensionData().ExtensionList)
                    {
                        foreach (XmlNode childNode in xmlNode.ChildNodes)
                        {
                            if (childNode.Attributes != null && childNode.Attributes["Name"] != null)
                            {
                                var item = new NavBarItem { Content = childNode.Attributes["Name"].Value };
                                item.Click += ItemOnClick;
                                LeftMenu.TopGroup.Items.Add(item);
                            }
                        }
                    }
                }
            }
            else if (e.GetState() == ExtensionEventArgs.UNLOAD)
            {
                if (e.GetExtensionData().Name == "WpfLeftMenu.TopMenuExtension")
                {
                    LeftMenu.TopGroup.Items.Clear();
                }
            }

        }

        private void ItemOnClick(object sender, EventArgs eventArgs)
        {

            var serviceRef = BundleContext.GetServiceReference<IMenuItemEvent>();
            var servcie = BundleContext.GetService<IMenuItemEvent>(serviceRef);
            servcie.FireEvent(((NavBarItem)sender).Content.ToString());
        }
    }
}


OSGi.NET.Core Namespace

OSGi.NET API
OSGi.NET.Core Namespace
Classes
 | Class | Description
Public class | BundleStateConst | Bunble模块状态
Interfaces
 | Interface | Description
Public interface | IBundle | Bundle表示由内核创建的一个插件
Public interface | IBundleActivator | Bundle激活器
Public interface | IBundleContext | 表示模块上下文，暴露了内核的操作


BundleStateConst Class

BundleStateConst Class
Bunble模块状态
Inheritance Hierarchy
SystemObject
OSGi.NET.CoreBundleStateConst

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public class BundleStateConst
Public Class BundleStateConst

The BundleStateConst type exposes the following members.

Constructors
 | Name | Description
Public method | BundleStateConst | Initializes a new instance of the BundleStateConst class
Top
Fields
Name | Description
ACTIVE | 已激活
INSTALLED | 已安装
RESOLVED | 已装载
STARTING | 正在启动
STOPPING | 正在停止
UNINSTALLED | 已卸载
Top
See Also

Reference

OSGi.NET.Core Namespace


BundleStateConst Constructor

BundleStateConst Constructor
Initializes a new instance of the BundleStateConst class

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public BundleStateConst()
Public Sub New
See Also

Reference

BundleStateConst Class
OSGi.NET.Core Namespace


BundleStateConst Fields

BundleStateConst Fields

The BundleStateConst type exposes the following members.

Fields
Name | Description
ACTIVE | 已激活
INSTALLED | 已安装
RESOLVED | 已装载
STARTING | 正在启动
STOPPING | 正在停止
UNINSTALLED | 已卸载
Top
See Also

Reference

BundleStateConst Class
OSGi.NET.Core Namespace


BundleStateConst.ACTIVE Field

BundleStateConstACTIVE Field
已激活

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int ACTIVE
Public Const ACTIVE As Integer

Field Value

Type: Int32
See Also

Reference

BundleStateConst Class
OSGi.NET.Core Namespace


BundleStateConst.INSTALLED Field

BundleStateConstINSTALLED Field
已安装

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int INSTALLED
Public Const INSTALLED As Integer

Field Value

Type: Int32
See Also

Reference

BundleStateConst Class
OSGi.NET.Core Namespace


BundleStateConst.RESOLVED Field

BundleStateConstRESOLVED Field
已装载

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int RESOLVED
Public Const RESOLVED As Integer

Field Value

Type: Int32
See Also

Reference

BundleStateConst Class
OSGi.NET.Core Namespace


BundleStateConst.STARTING Field

BundleStateConstSTARTING Field
正在启动

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int STARTING
Public Const STARTING As Integer

Field Value

Type: Int32
See Also

Reference

BundleStateConst Class
OSGi.NET.Core Namespace


BundleStateConst.STOPPING Field

BundleStateConstSTOPPING Field
正在停止

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int STOPPING
Public Const STOPPING As Integer

Field Value

Type: Int32
See Also

Reference

BundleStateConst Class
OSGi.NET.Core Namespace


BundleStateConst.UNINSTALLED Field

BundleStateConstUNINSTALLED Field
已卸载

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int UNINSTALLED
Public Const UNINSTALLED As Integer

Field Value

Type: Int32
See Also

Reference

BundleStateConst Class
OSGi.NET.Core Namespace


IBundle Interface

IBundle Interface
Bundle表示由内核创建的一个插件

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public interface IBundle
Public Interface IBundle

The IBundle type exposes the following members.

Methods
 | Name | Description
Public method | GetBundleAssemblyFileName | 获取当前Bundle程序集文件名称
Public method | GetBundleAssemblyFullName | 获取当前Bundle程序集全名
Public method | GetBundleContext | 获取当前Bundle上下文对象
Public method | GetBundleDirectoryPath | 获取当前Bundle目录
Public method | GetBundleManifestData | 获取模块清单数据
Public method | GetBundleStartLevel | 获取当前Bundle启动级别
Public method | GetExtensionDatas | 获取当前Bundle扩展的扩展数据
Public method | GetExtensionPoints | 获取当前Bundle扩展点
Public method | GetManifest | 获取当前Bundle程序集清单数据
Public method | GetState | 获取当前Bundle状态
Public method | GetSymbolicName | 获取当前Bundle符号名称
Public method | GetVersion | 获取当前Bundle版本信息
Public method | Start | 启动
Public method | Stop | 停止
Public method | UnInstall | 卸载当前Bundle
Public method | Update | 指定路径更新当前Bundle
Top
See Also

Reference

OSGi.NET.Core Namespace


IBundle Methods

IBundle Methods

The IBundle type exposes the following members.

Methods
 | Name | Description
Public method | GetBundleAssemblyFileName | 获取当前Bundle程序集文件名称
Public method | GetBundleAssemblyFullName | 获取当前Bundle程序集全名
Public method | GetBundleContext | 获取当前Bundle上下文对象
Public method | GetBundleDirectoryPath | 获取当前Bundle目录
Public method | GetBundleManifestData | 获取模块清单数据
Public method | GetBundleStartLevel | 获取当前Bundle启动级别
Public method | GetExtensionDatas | 获取当前Bundle扩展的扩展数据
Public method | GetExtensionPoints | 获取当前Bundle扩展点
Public method | GetManifest | 获取当前Bundle程序集清单数据
Public method | GetState | 获取当前Bundle状态
Public method | GetSymbolicName | 获取当前Bundle符号名称
Public method | GetVersion | 获取当前Bundle版本信息
Public method | Start | 启动
Public method | Stop | 停止
Public method | UnInstall | 卸载当前Bundle
Public method | Update | 指定路径更新当前Bundle
Top
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.GetBundleAssemblyFileName Method

IBundleGetBundleAssemblyFileName Method
获取当前Bundle程序集文件名称

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
string GetBundleAssemblyFileName()
Function GetBundleAssemblyFileName As String

Return Value

Type: String
Bundle程序集文件名称
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.GetBundleAssemblyFullName Method

IBundleGetBundleAssemblyFullName Method
获取当前Bundle程序集全名

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
string GetBundleAssemblyFullName()
Function GetBundleAssemblyFullName As String

Return Value

Type: String
Bundle程序集全名
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.GetBundleContext Method

IBundleGetBundleContext Method
获取当前Bundle上下文对象

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IBundleContext GetBundleContext()
Function GetBundleContext As IBundleContext

Return Value

Type: IBundleContext
Bundle上下文对象
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.GetBundleDirectoryPath Method

IBundleGetBundleDirectoryPath Method
获取当前Bundle目录

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
string GetBundleDirectoryPath()
Function GetBundleDirectoryPath As String

Return Value

Type: String
Bundle目录
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.GetBundleManifestData Method

IBundleGetBundleManifestData Method
获取模块清单数据

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
XmlNode GetBundleManifestData()
Function GetBundleManifestData As XmlNode

Return Value

Type: XmlNode
清单数据节点
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.GetBundleStartLevel Method

IBundleGetBundleStartLevel Method
获取当前Bundle启动级别

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
int GetBundleStartLevel()
Function GetBundleStartLevel As Integer

Return Value

Type: Int32
Bundle启动级别
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.GetExtensionDatas Method

IBundleGetExtensionDatas Method
获取当前Bundle扩展的扩展数据

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IList<ExtensionData> GetExtensionDatas()
Function GetExtensionDatas As IList(Of ExtensionData)

Return Value

Type: IList ExtensionData
扩展数据列表
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.GetExtensionPoints Method

IBundleGetExtensionPoints Method
获取当前Bundle扩展点

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IList<ExtensionPoint> GetExtensionPoints()
Function GetExtensionPoints As IList(Of ExtensionPoint)

Return Value

Type: IList ExtensionPoint
扩展点列表
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.GetManifest Method

IBundleGetManifest Method
获取当前Bundle程序集清单数据

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IDictionary<string, string> GetManifest()
Function GetManifest As IDictionary(Of String, String)

Return Value

Type: IDictionary String, String
Bundle程序清单数据
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.GetState Method

IBundleGetState Method
获取当前Bundle状态

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
int GetState()
Function GetState As Integer

Return Value

Type: Int32
Bundle状态
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.GetSymbolicName Method

IBundleGetSymbolicName Method
获取当前Bundle符号名称

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
string GetSymbolicName()
Function GetSymbolicName As String

Return Value

Type: String
Bundle符号名称
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.GetVersion Method

IBundleGetVersion Method
获取当前Bundle版本信息

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
Version GetVersion()
Function GetVersion As Version

Return Value

Type: Version
Bundle版本信息
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.Start Method

IBundleStart Method
启动

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void Start()
Sub Start
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.Stop Method

IBundleStop Method
停止

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void Stop()
Sub Stop
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.UnInstall Method

IBundleUnInstall Method
卸载当前Bundle

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void UnInstall()
Sub UnInstall
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundle.Update Method

IBundleUpdate Method
指定路径更新当前Bundle

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void Update(
    string zipFile
)
Sub Update (
    zipFile As String
)

Parameters

zipFile
Type: SystemString
更新的Bundle路径
See Also

Reference

IBundle Interface
OSGi.NET.Core Namespace


IBundleActivator Interface

IBundleActivator Interface
Bundle激活器

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public interface IBundleActivator
Public Interface IBundleActivator

The IBundleActivator type exposes the following members.

Methods
 | Name | Description
Public method | Start | 激活器启动
Public method | Stop | 激活器停止
Top
See Also

Reference

OSGi.NET.Core Namespace


IBundleActivator Methods

IBundleActivator Methods

The IBundleActivator type exposes the following members.

Methods
 | Name | Description
Public method | Start | 激活器启动
Public method | Stop | 激活器停止
Top
See Also

Reference

IBundleActivator Interface
OSGi.NET.Core Namespace


IBundleActivator.Start Method

IBundleActivatorStart Method
激活器启动

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void Start(
    IBundleContext context
)
Sub Start (
    context As IBundleContext
)

Parameters

context
Type: OSGi.NET.CoreIBundleContext

[Missing <param name="context"/> documentation for "M:OSGi.NET.Core.IBundleActivator.Start(OSGi.NET.Core.IBundleContext)"]

See Also

Reference

IBundleActivator Interface
OSGi.NET.Core Namespace


IBundleActivator.Stop Method

IBundleActivatorStop Method
激活器停止

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void Stop(
    IBundleContext context
)
Sub Stop (
    context As IBundleContext
)

Parameters

context
Type: OSGi.NET.CoreIBundleContext

[Missing <param name="context"/> documentation for "M:OSGi.NET.Core.IBundleActivator.Stop(OSGi.NET.Core.IBundleContext)"]

See Also

Reference

IBundleActivator Interface
OSGi.NET.Core Namespace


IBundleContext Interface

IBundleContext Interface
表示模块上下文，暴露了内核的操作

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public interface IBundleContext
Public Interface IBundleContext

The IBundleContext type exposes the following members.

Methods
 | Name | Description
Public method | AddBundleListener | 添加一个Bundle监听器实例
Public method | AddExtensionListener | 添加一个Extension监听器实例
Public method | AddServiceListener | 添加一个服务监听器实例
Public method | GetBundle | 获取当前上下文关联的Bundle模块
Public method | GetBundle(Int32) | 根据序号获取已装载的指定Bundle
Public method | GetBundle(String) | 根据程序集名称获取已装载的指定Bundle
Public method | GetBundles | 获取所有Bundle模块
Public method | GetService(IServiceReference) | 根据服务引用获取对应的服务实例
Public method | GetServiceT(IServiceReference) | 根据服务引用获取对应的服务实例(强类型版本)
Public method | GetServiceReference(String) | 根据服务约束获取服务(根据注册顺序获取第一个服务引用)
Public method | GetServiceReferenceT | 以泛型方式根据服务约束类型获取服务
Public method | GetServiceReferences(String) | 根据服务约束获取服务引用列表
Public method | GetServiceReferences(String, IDictionaryString, Object) | 根据服务约束及服务属性获取服务引用列表
Public method | GetServiceReferencesT | 以泛型方式根据服务约束类型获取服务引用列表
Public method | GetServiceReferencesT(IDictionaryString, Object) | 以泛型方式根据服务约束类型获取服务引用列表
Public method | GetUsingBundles | 获取正在使用指定服务的所有Bundle模块
Public method | InstallBundle | 安装指定路径下的Bundle模块
Public method | RegisterService(String, Object, IDictionaryString, Object) | 实现了一个服务接口的服务对象注册
Public method | RegisterService(String, Object, IDictionaryString, Object) | 实现了多个服务接口的服务对象注册
Public method | RegisterServiceT(Object, IDictionaryString, Object) | 以泛型的方式注册服务对象
Public method | RemoveBundleListener | 移除一个Bundle监听器实例
Public method | RemoveExtensionListener | 移除一个Extension监听器实例
Public method | RemoveServiceListener | 移除一个服务监听器
Public method | UnGetService | 取消调用指定服务引用的服务实例
Public method | UnRegisterService | 取消注册公开的服务对象
Top
Events
 | Name | Description
Public event | ExtensionChanged | 扩展点变更事件
Public event | ServiceChanged | 服务变更事件
Top
See Also

Reference

OSGi.NET.Core Namespace


IBundleContext Methods

IBundleContext Methods

The IBundleContext type exposes the following members.

Methods
 | Name | Description
Public method | AddBundleListener | 添加一个Bundle监听器实例
Public method | AddExtensionListener | 添加一个Extension监听器实例
Public method | AddServiceListener | 添加一个服务监听器实例
Public method | GetBundle | 获取当前上下文关联的Bundle模块
Public method | GetBundle(Int32) | 根据序号获取已装载的指定Bundle
Public method | GetBundle(String) | 根据程序集名称获取已装载的指定Bundle
Public method | GetBundles | 获取所有Bundle模块
Public method | GetService(IServiceReference) | 根据服务引用获取对应的服务实例
Public method | GetServiceT(IServiceReference) | 根据服务引用获取对应的服务实例(强类型版本)
Public method | GetServiceReference(String) | 根据服务约束获取服务(根据注册顺序获取第一个服务引用)
Public method | GetServiceReferenceT | 以泛型方式根据服务约束类型获取服务
Public method | GetServiceReferences(String) | 根据服务约束获取服务引用列表
Public method | GetServiceReferences(String, IDictionaryString, Object) | 根据服务约束及服务属性获取服务引用列表
Public method | GetServiceReferencesT | 以泛型方式根据服务约束类型获取服务引用列表
Public method | GetServiceReferencesT(IDictionaryString, Object) | 以泛型方式根据服务约束类型获取服务引用列表
Public method | GetUsingBundles | 获取正在使用指定服务的所有Bundle模块
Public method | InstallBundle | 安装指定路径下的Bundle模块
Public method | RegisterService(String, Object, IDictionaryString, Object) | 实现了一个服务接口的服务对象注册
Public method | RegisterService(String, Object, IDictionaryString, Object) | 实现了多个服务接口的服务对象注册
Public method | RegisterServiceT(Object, IDictionaryString, Object) | 以泛型的方式注册服务对象
Public method | RemoveBundleListener | 移除一个Bundle监听器实例
Public method | RemoveExtensionListener | 移除一个Extension监听器实例
Public method | RemoveServiceListener | 移除一个服务监听器
Public method | UnGetService | 取消调用指定服务引用的服务实例
Public method | UnRegisterService | 取消注册公开的服务对象
Top
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.AddBundleListener Method

IBundleContextAddBundleListener Method
添加一个Bundle监听器实例

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void AddBundleListener(
    IBundleListener listener
)
Sub AddBundleListener (
    listener As IBundleListener
)

Parameters

listener
Type: OSGi.NET.ListenerIBundleListener
Bundle监听器实例
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.AddExtensionListener Method

IBundleContextAddExtensionListener Method
添加一个Extension监听器实例

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void AddExtensionListener(
    IExtensionListener listener
)
Sub AddExtensionListener (
    listener As IExtensionListener
)

Parameters

listener
Type: OSGi.NET.ListenerIExtensionListener
Extension监听器实例
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.AddServiceListener Method

IBundleContextAddServiceListener Method
添加一个服务监听器实例

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void AddServiceListener(
    IServiceListener listener
)
Sub AddServiceListener (
    listener As IServiceListener
)

Parameters

listener
Type: OSGi.NET.ListenerIServiceListener
服务监听器实例
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.GetBundle Method

IBundleContextGetBundle Method
Overload List
 | Name | Description
Public method | GetBundle | 获取当前上下文关联的Bundle模块
Public method | GetBundle(Int32) | 根据序号获取已装载的指定Bundle
Public method | GetBundle(String) | 根据程序集名称获取已装载的指定Bundle
Top
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.GetBundle Method

IBundleContextGetBundle Method
获取当前上下文关联的Bundle模块

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IBundle GetBundle()
Function GetBundle As IBundle

Return Value

Type: IBundle
Bundle模块
See Also

Reference

IBundleContext Interface
GetBundle Overload
OSGi.NET.Core Namespace


IBundleContext.GetBundle Method (Int32)

IBundleContextGetBundle Method (Int32)
根据序号获取已装载的指定Bundle

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IBundle GetBundle(
    int index
)
Function GetBundle (
    index As Integer
) As IBundle

Parameters

index
Type: SystemInt32
序号

Return Value

Type: IBundle
Bundle模块
See Also

Reference

IBundleContext Interface
GetBundle Overload
OSGi.NET.Core Namespace


IBundleContext.GetBundle Method (String)

IBundleContextGetBundle Method (String)
根据程序集名称获取已装载的指定Bundle

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IBundle GetBundle(
    string assemblyName
)
Function GetBundle (
    assemblyName As String
) As IBundle

Parameters

assemblyName
Type: SystemString
程序集名称

Return Value

Type: IBundle
Bundle模块
See Also

Reference

IBundleContext Interface
GetBundle Overload
OSGi.NET.Core Namespace


IBundleContext.GetBundles Method

IBundleContextGetBundles Method
获取所有Bundle模块

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IList<IBundle> GetBundles()
Function GetBundles As IList(Of IBundle)

Return Value

Type: IList IBundle
Bundle模块列表
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.GetService Method

IBundleContextGetService Method
Overload List
 | Name | Description
Public method | GetService(IServiceReference) | 根据服务引用获取对应的服务实例
Public method | GetServiceT(IServiceReference) | 根据服务引用获取对应的服务实例(强类型版本)
Top
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.GetService Method (IServiceReference)

IBundleContextGetService Method (IServiceReference)
根据服务引用获取对应的服务实例

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
Object GetService(
    IServiceReference reference
)
Function GetService (
    reference As IServiceReference
) As Object

Parameters

reference
Type: OSGi.NET.ServiceIServiceReference
服务引用

Return Value

Type: Object
服务对象
See Also

Reference

IBundleContext Interface
GetService Overload
OSGi.NET.Core Namespace


IBundleContext.GetService(T) Method (IServiceReference)

IBundleContextGetServiceT Method (IServiceReference)
根据服务引用获取对应的服务实例(强类型版本)

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
T GetService<T>(
    IServiceReference reference
)
where T : class

Function GetService(Of T As Class) (
    reference As IServiceReference
) As T

Parameters

reference
Type: OSGi.NET.ServiceIServiceReference
服务引用

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:OSGi.NET.Core.IBundleContext.GetService``1(OSGi.NET.Service.IServiceReference)"]

Return Value

Type: T
服务对象
See Also

Reference

IBundleContext Interface
GetService Overload
OSGi.NET.Core Namespace


IBundleContext.GetServiceReference Method

IBundleContextGetServiceReference Method
Overload List
 | Name | Description
Public method | GetServiceReferenceT | 以泛型方式根据服务约束类型获取服务
Public method | GetServiceReference(String) | 根据服务约束获取服务(根据注册顺序获取第一个服务引用)
Top
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.GetServiceReference(T) Method

IBundleContextGetServiceReferenceT Method
以泛型方式根据服务约束类型获取服务

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IServiceReference GetServiceReference<T>()

Function GetServiceReference(Of T) As IServiceReference

Type Parameters

T
服务约束类型

Return Value

Type: IServiceReference
服务引用
See Also

Reference

IBundleContext Interface
GetServiceReference Overload
OSGi.NET.Core Namespace


IBundleContext.GetServiceReference Method (String)

IBundleContextGetServiceReference Method (String)
根据服务约束获取服务(根据注册顺序获取第一个服务引用)

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IServiceReference GetServiceReference(
    string contract
)
Function GetServiceReference (
    contract As String
) As IServiceReference

Parameters

contract
Type: SystemString
服务约束

Return Value

Type: IServiceReference
服务引用
See Also

Reference

IBundleContext Interface
GetServiceReference Overload
OSGi.NET.Core Namespace


IBundleContext.GetServiceReferences Method

IBundleContextGetServiceReferences Method
Overload List
 | Name | Description
Public method | GetServiceReferencesT | 以泛型方式根据服务约束类型获取服务引用列表
Public method | GetServiceReferencesT(IDictionaryString, Object) | 以泛型方式根据服务约束类型获取服务引用列表
Public method | GetServiceReferences(String) | 根据服务约束获取服务引用列表
Public method | GetServiceReferences(String, IDictionaryString, Object) | 根据服务约束及服务属性获取服务引用列表
Top
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.GetServiceReferences(T) Method

IBundleContextGetServiceReferencesT Method
以泛型方式根据服务约束类型获取服务引用列表

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IList<IServiceReference> GetServiceReferences<T>()

Function GetServiceReferences(Of T) As IList(Of IServiceReference)

Type Parameters

T
服务约束类型

Return Value

Type: IList IServiceReference
服务引用列表
See Also

Reference

IBundleContext Interface
GetServiceReferences Overload
OSGi.NET.Core Namespace


IBundleContext.GetServiceReferences(T) Method (IDictionary(String, Object))

IBundleContextGetServiceReferencesT Method (IDictionaryString, Object)
以泛型方式根据服务约束类型获取服务引用列表

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IList<IServiceReference> GetServiceReferences<T>(
    IDictionary<string, Object> properties
)

Function GetServiceReferences(Of T) (
    properties As IDictionary(Of String, Object)
) As IList(Of IServiceReference)

Parameters

properties
Type: System.Collections.GenericIDictionary String, Object
服务属性

Type Parameters

T
服务约束类型

Return Value

Type: IList IServiceReference
服务引用列表
See Also

Reference

IBundleContext Interface
GetServiceReferences Overload
OSGi.NET.Core Namespace


IBundleContext.GetServiceReferences Method (String)

IBundleContextGetServiceReferences Method (String)
根据服务约束获取服务引用列表

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IList<IServiceReference> GetServiceReferences(
    string contract
)
Function GetServiceReferences (
    contract As String
) As IList(Of IServiceReference)

Parameters

contract
Type: SystemString
服务约束

Return Value

Type: IList IServiceReference
服务引用列表
See Also

Reference

IBundleContext Interface
GetServiceReferences Overload
OSGi.NET.Core Namespace


IBundleContext.GetServiceReferences Method (String, IDictionary(String, Object))

IBundleContextGetServiceReferences Method (String, IDictionaryString, Object)
根据服务约束及服务属性获取服务引用列表

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IList<IServiceReference> GetServiceReferences(
    string contract,
    IDictionary<string, Object> properties
)
Function GetServiceReferences (
    contract As String,
    properties As IDictionary(Of String, Object)
) As IList(Of IServiceReference)

Parameters

contract
Type: SystemString
服务约束
properties
Type: System.Collections.GenericIDictionary String, Object
服务属性

Return Value

Type: IList IServiceReference
服务引用列表
See Also

Reference

IBundleContext Interface
GetServiceReferences Overload
OSGi.NET.Core Namespace


IBundleContext.GetUsingBundles Method

IBundleContextGetUsingBundles Method
获取正在使用指定服务的所有Bundle模块

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IList<IBundle> GetUsingBundles(
    IServiceReference reference
)
Function GetUsingBundles (
    reference As IServiceReference
) As IList(Of IBundle)

Parameters

reference
Type: OSGi.NET.ServiceIServiceReference
服务引用

Return Value

Type: IList IBundle
正在使用服务的Bundle列表
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.InstallBundle Method

IBundleContextInstallBundle Method
安装指定路径下的Bundle模块

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IBundle InstallBundle(
    string location
)
Function InstallBundle (
    location As String
) As IBundle

Parameters

location
Type: SystemString
Bundle文件全路径

Return Value

Type: IBundle
已安装的Bundle实例
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.RegisterService Method

IBundleContextRegisterService Method
Overload List
 | Name | Description
Public method | RegisterServiceT(Object, IDictionaryString, Object) | 以泛型的方式注册服务对象
Public method | RegisterService(String, Object, IDictionaryString, Object) | 实现了一个服务接口的服务对象注册
Public method | RegisterService(String, Object, IDictionaryString, Object) | 实现了多个服务接口的服务对象注册
Top
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.RegisterService(T) Method (Object, IDictionary(String, Object))

IBundleContextRegisterServiceT Method (Object, IDictionaryString, Object)
以泛型的方式注册服务对象

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IServiceRegistration RegisterService<T>(
    Object service,
    IDictionary<string, Object> properties = null
)

Function RegisterService(Of T) (
    service As Object,
    Optional properties As IDictionary(Of String, Object) = Nothing
) As IServiceRegistration

Parameters

service
Type: SystemObject
服务对象
properties (Optional)
Type: System.Collections.GenericIDictionary String, Object
服务属性

Type Parameters

T
服务约束类型

Return Value

Type: IServiceRegistration
服务注册信息
See Also

Reference

IBundleContext Interface
RegisterService Overload
OSGi.NET.Core Namespace


IBundleContext.RegisterService Method (String, Object, IDictionary(String, Object))

IBundleContextRegisterService Method (String, Object, IDictionaryString, Object)
实现了一个服务接口的服务对象注册

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IServiceRegistration RegisterService(
    string contract,
    Object service,
    IDictionary<string, Object> properties = null
)
Function RegisterService (
    contract As String,
    service As Object,
    Optional properties As IDictionary(Of String, Object) = Nothing
) As IServiceRegistration

Parameters

contract
Type: SystemString
服务约束
service
Type: SystemObject
服务对象
properties (Optional)
Type: System.Collections.GenericIDictionary String, Object
服务属性

Return Value

Type: IServiceRegistration
服务注册信息
See Also

Reference

IBundleContext Interface
RegisterService Overload
OSGi.NET.Core Namespace


IBundleContext.RegisterService Method (String[], Object, IDictionary(String, Object))

IBundleContextRegisterService Method (String, Object, IDictionaryString, Object)
实现了多个服务接口的服务对象注册

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IServiceRegistration RegisterService(
    string[] contracts,
    Object service,
    IDictionary<string, Object> properties = null
)
Function RegisterService (
    contracts As String(),
    service As Object,
    Optional properties As IDictionary(Of String, Object) = Nothing
) As IServiceRegistration

Parameters

contracts
Type: SystemString
服务约束数组
service
Type: SystemObject
服务对象
properties (Optional)
Type: System.Collections.GenericIDictionary String, Object
服务属性

Return Value

Type: IServiceRegistration
服务注册信息
See Also

Reference

IBundleContext Interface
RegisterService Overload
OSGi.NET.Core Namespace


IBundleContext.RemoveBundleListener Method

IBundleContextRemoveBundleListener Method
移除一个Bundle监听器实例

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void RemoveBundleListener(
    IBundleListener listener
)
Sub RemoveBundleListener (
    listener As IBundleListener
)

Parameters

listener
Type: OSGi.NET.ListenerIBundleListener
Bundle监听器实例
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.RemoveExtensionListener Method

IBundleContextRemoveExtensionListener Method
移除一个Extension监听器实例

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void RemoveExtensionListener(
    IExtensionListener listener
)
Sub RemoveExtensionListener (
    listener As IExtensionListener
)

Parameters

listener
Type: OSGi.NET.ListenerIExtensionListener
Extension监听器实例
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.RemoveServiceListener Method

IBundleContextRemoveServiceListener Method
移除一个服务监听器

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void RemoveServiceListener(
    IServiceListener listener
)
Sub RemoveServiceListener (
    listener As IServiceListener
)

Parameters

listener
Type: OSGi.NET.ListenerIServiceListener
服务监听器实例
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.UnGetService Method

IBundleContextUnGetService Method
取消调用指定服务引用的服务实例

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
bool UnGetService(
    IServiceReference reference
)
Function UnGetService (
    reference As IServiceReference
) As Boolean

Parameters

reference
Type: OSGi.NET.ServiceIServiceReference
服务引用

Return Value

Type: Boolean
是否成功
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.UnRegisterService Method

IBundleContextUnRegisterService Method
取消注册公开的服务对象

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void UnRegisterService(
    IServiceReference serviceReference
)
Sub UnRegisterService (
    serviceReference As IServiceReference
)

Parameters

serviceReference
Type: OSGi.NET.ServiceIServiceReference
服务引用
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext Events

IBundleContext Events

The IBundleContext type exposes the following members.

Events
 | Name | Description
Public event | ExtensionChanged | 扩展点变更事件
Public event | ServiceChanged | 服务变更事件
Top
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.ExtensionChanged Event

IBundleContextExtensionChanged Event
扩展点变更事件

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
event EventHandler<ExtensionEventArgs> ExtensionChanged
Event ExtensionChanged As EventHandler(Of ExtensionEventArgs)

Value

Type: SystemEventHandler ExtensionEventArgs
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


IBundleContext.ServiceChanged Event

IBundleContextServiceChanged Event
服务变更事件

Namespace: OSGi.NET.Core
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
event EventHandler<ServiceEventArgs> ServiceChanged
Event ServiceChanged As EventHandler(Of ServiceEventArgs)

Value

Type: SystemEventHandler ServiceEventArgs
See Also

Reference

IBundleContext Interface
OSGi.NET.Core Namespace


OSGi.NET.Core.Root Namespace

OSGi.NET.Core.Root Namespace
Classes
 | Class | Description
Public class | FrameworkFactory | 框架内核构造工厂
Interfaces
 | Interface | Description
Public interface | IFramework | 框架内核，内核也作为一个Bundle，用来启动其他Bundle组件
Public interface | IFrameworkFactory | 框架内核构造工厂


FrameworkFactory Class

FrameworkFactory Class
框架内核构造工厂
Inheritance Hierarchy
SystemObject
OSGi.NET.Core.RootFrameworkFactory

Namespace: OSGi.NET.Core.Root
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public class FrameworkFactory : IFrameworkFactory
Public Class FrameworkFactory
    Implements IFrameworkFactory

The FrameworkFactory type exposes the following members.

Constructors
 | Name | Description
Public method | FrameworkFactory | Initializes a new instance of the FrameworkFactory class
Top
Methods
 | Name | Description
Public method | CreateFramework | 创建一个框架内核实例
Public method | CreateFramework(IListExtensionData) | 创建一个框架内核实例，扩展数据支持
Public method | CreateFramework(IListExtensionPoint) | 创建一个框架内核实例，扩展点支持
Top
See Also

Reference

OSGi.NET.Core.Root Namespace


FrameworkFactory Constructor

FrameworkFactory Constructor
Initializes a new instance of the FrameworkFactory class

Namespace: OSGi.NET.Core.Root
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public FrameworkFactory()
Public Sub New
See Also

Reference

FrameworkFactory Class
OSGi.NET.Core.Root Namespace


FrameworkFactory Methods

FrameworkFactory Methods
Methods
 | Name | Description
Public method | CreateFramework | 创建一个框架内核实例
Public method | CreateFramework(IListExtensionData) | 创建一个框架内核实例，扩展数据支持
Public method | CreateFramework(IListExtensionPoint) | 创建一个框架内核实例，扩展点支持
Top
See Also

Reference

FrameworkFactory Class
OSGi.NET.Core.Root Namespace


FrameworkFactory.CreateFramework Method

FrameworkFactoryCreateFramework Method
Overload List
 | Name | Description
Public method | CreateFramework | 创建一个框架内核实例
Public method | CreateFramework(IListExtensionData) | 创建一个框架内核实例，扩展数据支持
Public method | CreateFramework(IListExtensionPoint) | 创建一个框架内核实例，扩展点支持
Top
See Also

Reference

FrameworkFactory Class
OSGi.NET.Core.Root Namespace


FrameworkFactory.CreateFramework Method

FrameworkFactoryCreateFramework Method
创建一个框架内核实例

Namespace: OSGi.NET.Core.Root
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public IFramework CreateFramework()
Public Function CreateFramework As IFramework

Return Value

Type: IFramework
框架内核实例

Implements

IFrameworkFactoryCreateFramework
See Also

Reference

FrameworkFactory Class
CreateFramework Overload
OSGi.NET.Core.Root Namespace


FrameworkFactory.CreateFramework Method (IList(ExtensionData))

FrameworkFactoryCreateFramework Method (IListExtensionData)
创建一个框架内核实例，扩展数据支持

Namespace: OSGi.NET.Core.Root
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public IFramework CreateFramework(
    IList<ExtensionData> extensionDatas
)
Public Function CreateFramework (
    extensionDatas As IList(Of ExtensionData)
) As IFramework

Parameters

extensionDatas
Type: System.Collections.GenericIList ExtensionData

[Missing <param name="extensionDatas"/> documentation for "M:OSGi.NET.Core.Root.FrameworkFactory.CreateFramework(System.Collections.Generic.IList{OSGi.NET.Extension.ExtensionData})"]

Return Value

Type: IFramework
框架内核实例

Implements

IFrameworkFactoryCreateFramework(IListExtensionData)
See Also

Reference

FrameworkFactory Class
CreateFramework Overload
OSGi.NET.Core.Root Namespace


FrameworkFactory.CreateFramework Method (IList(ExtensionPoint))

FrameworkFactoryCreateFramework Method (IListExtensionPoint)
创建一个框架内核实例，扩展点支持

Namespace: OSGi.NET.Core.Root
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public IFramework CreateFramework(
    IList<ExtensionPoint> extensionPoints
)
Public Function CreateFramework (
    extensionPoints As IList(Of ExtensionPoint)
) As IFramework

Parameters

extensionPoints
Type: System.Collections.GenericIList ExtensionPoint

[Missing <param name="extensionPoints"/> documentation for "M:OSGi.NET.Core.Root.FrameworkFactory.CreateFramework(System.Collections.Generic.IList{OSGi.NET.Extension.ExtensionPoint})"]

Return Value

Type: IFramework
框架内核实例

Implements

IFrameworkFactoryCreateFramework(IListExtensionPoint)
See Also

Reference

FrameworkFactory Class
CreateFramework Overload
OSGi.NET.Core.Root Namespace


IFramework Interface

IFramework Interface
框架内核，内核也作为一个Bundle，用来启动其他Bundle组件

Namespace: OSGi.NET.Core.Root
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public interface IFramework : IBundle
Public Interface IFramework
    Inherits IBundle

The IFramework type exposes the following members.

Methods
 | Name | Description
Public method | GetBundleAssemblyFileName | 获取当前Bundle程序集文件名称 (Inherited from IBundle.)
Public method | GetBundleAssemblyFullName | 获取当前Bundle程序集全名 (Inherited from IBundle.)
Public method | GetBundleContext | 获取当前Bundle上下文对象 (Inherited from IBundle.)
Public method | GetBundleDirectoryPath | 获取当前Bundle目录 (Inherited from IBundle.)
Public method | GetBundleManifestData | 获取模块清单数据 (Inherited from IBundle.)
Public method | GetBundles | 获取所有Bundle模块
Public method | GetBundleStartLevel | 获取当前Bundle启动级别 (Inherited from IBundle.)
Public method | GetExtensionDatas | 获取当前Bundle扩展的扩展数据 (Inherited from IBundle.)
Public method | GetExtensionPoints | 获取当前Bundle扩展点 (Inherited from IBundle.)
Public method | GetManifest | 获取当前Bundle程序集清单数据 (Inherited from IBundle.)
Public method | GetState | 获取当前Bundle状态 (Inherited from IBundle.)
Public method | GetSymbolicName | 获取当前Bundle符号名称 (Inherited from IBundle.)
Public method | GetVersion | 获取当前Bundle版本信息 (Inherited from IBundle.)
Public method | Init | 初始化
Public method | Start | 启动 (Inherited from IBundle.)
Public method | Stop | 停止 (Inherited from IBundle.)
Public method | UnInstall | 卸载当前Bundle (Inherited from IBundle.)
Public method | Update | 指定路径更新当前Bundle (Inherited from IBundle.)
Top
See Also

Reference

OSGi.NET.Core.Root Namespace


IFramework Methods

IFramework Methods

The IFramework type exposes the following members.

Methods
 | Name | Description
Public method | GetBundleAssemblyFileName | 获取当前Bundle程序集文件名称 (Inherited from IBundle.)
Public method | GetBundleAssemblyFullName | 获取当前Bundle程序集全名 (Inherited from IBundle.)
Public method | GetBundleContext | 获取当前Bundle上下文对象 (Inherited from IBundle.)
Public method | GetBundleDirectoryPath | 获取当前Bundle目录 (Inherited from IBundle.)
Public method | GetBundleManifestData | 获取模块清单数据 (Inherited from IBundle.)
Public method | GetBundles | 获取所有Bundle模块
Public method | GetBundleStartLevel | 获取当前Bundle启动级别 (Inherited from IBundle.)
Public method | GetExtensionDatas | 获取当前Bundle扩展的扩展数据 (Inherited from IBundle.)
Public method | GetExtensionPoints | 获取当前Bundle扩展点 (Inherited from IBundle.)
Public method | GetManifest | 获取当前Bundle程序集清单数据 (Inherited from IBundle.)
Public method | GetState | 获取当前Bundle状态 (Inherited from IBundle.)
Public method | GetSymbolicName | 获取当前Bundle符号名称 (Inherited from IBundle.)
Public method | GetVersion | 获取当前Bundle版本信息 (Inherited from IBundle.)
Public method | Init | 初始化
Public method | Start | 启动 (Inherited from IBundle.)
Public method | Stop | 停止 (Inherited from IBundle.)
Public method | UnInstall | 卸载当前Bundle (Inherited from IBundle.)
Public method | Update | 指定路径更新当前Bundle (Inherited from IBundle.)
Top
See Also

Reference

IFramework Interface
OSGi.NET.Core.Root Namespace


IFramework.GetBundles Method

IFrameworkGetBundles Method
获取所有Bundle模块

Namespace: OSGi.NET.Core.Root
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IList<IBundle> GetBundles()
Function GetBundles As IList(Of IBundle)

Return Value

Type: IList IBundle
所有已装载Bundle列表
See Also

Reference

IFramework Interface
OSGi.NET.Core.Root Namespace


IFramework.Init Method

IFrameworkInit Method
初始化

Namespace: OSGi.NET.Core.Root
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void Init()
Sub Init
See Also

Reference

IFramework Interface
OSGi.NET.Core.Root Namespace


IFrameworkFactory Interface

IFrameworkFactory Interface
框架内核构造工厂

Namespace: OSGi.NET.Core.Root
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public interface IFrameworkFactory
Public Interface IFrameworkFactory
Methods
 | Name | Description
Public method | CreateFramework | 创建一个框架内核实例
Public method | CreateFramework(IListExtensionData) | 创建一个框架内核实例,扩展点支持
Public method | CreateFramework(IListExtensionPoint) | 创建一个框架内核实例,扩展点支持
Top
See Also

Reference

OSGi.NET.Core.Root Namespace


IFrameworkFactory Methods

IFrameworkFactory Methods
Methods
 | Name | Description
Public method | CreateFramework | 创建一个框架内核实例
Public method | CreateFramework(IListExtensionData) | 创建一个框架内核实例,扩展点支持
Public method | CreateFramework(IListExtensionPoint) | 创建一个框架内核实例,扩展点支持
Top
See Also

Reference

IFrameworkFactory Interface
OSGi.NET.Core.Root Namespace


IFrameworkFactory.CreateFramework Method

IFrameworkFactoryCreateFramework Method
Overload List
 | Name | Description
Public method | CreateFramework | 创建一个框架内核实例
Public method | CreateFramework(IListExtensionData) | 创建一个框架内核实例,扩展点支持
Public method | CreateFramework(IListExtensionPoint) | 创建一个框架内核实例,扩展点支持
Top
See Also

Reference

IFrameworkFactory Interface
OSGi.NET.Core.Root Namespace


IFrameworkFactory.CreateFramework Method

IFrameworkFactoryCreateFramework Method
创建一个框架内核实例

Namespace: OSGi.NET.Core.Root
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IFramework CreateFramework()
Function CreateFramework As IFramework

Return Value

Type: IFramework
框架内核实例
See Also

Reference

IFrameworkFactory Interface
CreateFramework Overload
OSGi.NET.Core.Root Namespace


IFrameworkFactory.CreateFramework Method (IList(ExtensionData))

IFrameworkFactoryCreateFramework Method (IListExtensionData)
创建一个框架内核实例,扩展点支持

Namespace: OSGi.NET.Core.Root
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IFramework CreateFramework(
    IList<ExtensionData> extensionDatas
)
Function CreateFramework (
    extensionDatas As IList(Of ExtensionData)
) As IFramework

Parameters

extensionDatas
Type: System.Collections.GenericIList ExtensionData

[Missing <param name="extensionDatas"/> documentation for "M:OSGi.NET.Core.Root.IFrameworkFactory.CreateFramework(System.Collections.Generic.IList{OSGi.NET.Extension.ExtensionData})"]

Return Value

Type: IFramework
框架内核实例
See Also

Reference

IFrameworkFactory Interface
CreateFramework Overload
OSGi.NET.Core.Root Namespace


IFrameworkFactory.CreateFramework Method (IList(ExtensionPoint))

IFrameworkFactoryCreateFramework Method (IListExtensionPoint)
创建一个框架内核实例,扩展点支持

Namespace: OSGi.NET.Core.Root
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IFramework CreateFramework(
    IList<ExtensionPoint> extensionPoints
)
Function CreateFramework (
    extensionPoints As IList(Of ExtensionPoint)
) As IFramework

Parameters

extensionPoints
Type: System.Collections.GenericIList ExtensionPoint

[Missing <param name="extensionPoints"/> documentation for "M:OSGi.NET.Core.Root.IFrameworkFactory.CreateFramework(System.Collections.Generic.IList{OSGi.NET.Extension.ExtensionPoint})"]

Return Value

Type: IFramework
框架内核实例
See Also

Reference

IFrameworkFactory Interface
CreateFramework Overload
OSGi.NET.Core.Root Namespace


OSGi.NET.Event Namespace

OSGi.NET.Event Namespace
Classes
 | Class | Description
Public class | BundleEventArgs | Bundle事件参数
Public class | ExtensionEventArgs | 扩展事件参数
Public class | ServiceEventArgs | 服务事件参数


BundleEventArgs Class

BundleEventArgs Class
Bundle事件参数
Inheritance Hierarchy
SystemObject
SystemEventArgs
OSGi.NET.EventBundleEventArgs

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public class BundleEventArgs : EventArgs
Public Class BundleEventArgs
    Inherits EventArgs

The BundleEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | GetBundle | 获取Bundle对象
Public method | GetState | 获取Bundle状态
Top
Fields
Name | Description
INSTALLED | 已安装
RESOLVED | 已装载
STARTED | 已启动
STARTING | 启动中
STOPPED | 已停止
STOPPING | 暂停中
Top
See Also

Reference

OSGi.NET.Event Namespace


BundleEventArgs Fields

BundleEventArgs Fields

The BundleEventArgs type exposes the following members.

Fields
Name | Description
INSTALLED | 已安装
RESOLVED | 已装载
STARTED | 已启动
STARTING | 启动中
STOPPED | 已停止
STOPPING | 暂停中
Top
See Also

Reference

BundleEventArgs Class
OSGi.NET.Event Namespace


BundleEventArgs.INSTALLED Field

BundleEventArgsINSTALLED Field
已安装

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int INSTALLED
Public Const INSTALLED As Integer

Field Value

Type: Int32
See Also

Reference

BundleEventArgs Class
OSGi.NET.Event Namespace


BundleEventArgs.RESOLVED Field

BundleEventArgsRESOLVED Field
已装载

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int RESOLVED
Public Const RESOLVED As Integer

Field Value

Type: Int32
See Also

Reference

BundleEventArgs Class
OSGi.NET.Event Namespace


BundleEventArgs.STARTED Field

BundleEventArgsSTARTED Field
已启动

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int STARTED
Public Const STARTED As Integer

Field Value

Type: Int32
See Also

Reference

BundleEventArgs Class
OSGi.NET.Event Namespace


BundleEventArgs.STARTING Field

BundleEventArgsSTARTING Field
启动中

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int STARTING
Public Const STARTING As Integer

Field Value

Type: Int32
See Also

Reference

BundleEventArgs Class
OSGi.NET.Event Namespace


BundleEventArgs.STOPPED Field

BundleEventArgsSTOPPED Field
已停止

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int STOPPED
Public Const STOPPED As Integer

Field Value

Type: Int32
See Also

Reference

BundleEventArgs Class
OSGi.NET.Event Namespace


BundleEventArgs.STOPPING Field

BundleEventArgsSTOPPING Field
暂停中

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int STOPPING
Public Const STOPPING As Integer

Field Value

Type: Int32
See Also

Reference

BundleEventArgs Class
OSGi.NET.Event Namespace


BundleEventArgs Methods

BundleEventArgs Methods

The BundleEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | GetBundle | 获取Bundle对象
Public method | GetState | 获取Bundle状态
Top
See Also

Reference

BundleEventArgs Class
OSGi.NET.Event Namespace


BundleEventArgs.GetBundle Method

BundleEventArgsGetBundle Method
获取Bundle对象

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public IBundle GetBundle()
Public Function GetBundle As IBundle

Return Value

Type: IBundle

[Missing <returns> documentation for "M:OSGi.NET.Event.BundleEventArgs.GetBundle"]

See Also

Reference

BundleEventArgs Class
OSGi.NET.Event Namespace


BundleEventArgs.GetState Method

BundleEventArgsGetState Method
获取Bundle状态

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public int GetState()
Public Function GetState As Integer

Return Value

Type: Int32

[Missing <returns> documentation for "M:OSGi.NET.Event.BundleEventArgs.GetState"]

See Also

Reference

BundleEventArgs Class
OSGi.NET.Event Namespace


ExtensionEventArgs Class

ExtensionEventArgs Class
扩展事件参数
Inheritance Hierarchy
SystemObject
SystemEventArgs
OSGi.NET.EventExtensionEventArgs

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public class ExtensionEventArgs : EventArgs
Public Class ExtensionEventArgs
    Inherits EventArgs

The ExtensionEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | GetExtensionData | 获取扩展点数据
Public method | GetExtensionPoint | 获取扩展点
Public method | GetState | 扩展点数据加载状态
Top
Fields
Name | Description
LOAD | 加载扩展
UNLOAD | 卸载扩展
Top
See Also

Reference

OSGi.NET.Event Namespace


ExtensionEventArgs Fields

ExtensionEventArgs Fields

The ExtensionEventArgs type exposes the following members.

Fields
Name | Description
LOAD | 加载扩展
UNLOAD | 卸载扩展
Top
See Also

Reference

ExtensionEventArgs Class
OSGi.NET.Event Namespace


ExtensionEventArgs.LOAD Field

ExtensionEventArgsLOAD Field
加载扩展

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int LOAD
Public Const LOAD As Integer

Field Value

Type: Int32
See Also

Reference

ExtensionEventArgs Class
OSGi.NET.Event Namespace


ExtensionEventArgs.UNLOAD Field

ExtensionEventArgsUNLOAD Field
卸载扩展

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int UNLOAD
Public Const UNLOAD As Integer

Field Value

Type: Int32
See Also

Reference

ExtensionEventArgs Class
OSGi.NET.Event Namespace


ExtensionEventArgs Methods

ExtensionEventArgs Methods

The ExtensionEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | GetExtensionData | 获取扩展点数据
Public method | GetExtensionPoint | 获取扩展点
Public method | GetState | 扩展点数据加载状态
Top
See Also

Reference

ExtensionEventArgs Class
OSGi.NET.Event Namespace


ExtensionEventArgs.GetExtensionData Method

ExtensionEventArgsGetExtensionData Method
获取扩展点数据

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public ExtensionData GetExtensionData()
Public Function GetExtensionData As ExtensionData

Return Value

Type: ExtensionData

[Missing <returns> documentation for "M:OSGi.NET.Event.ExtensionEventArgs.GetExtensionData"]

See Also

Reference

ExtensionEventArgs Class
OSGi.NET.Event Namespace


ExtensionEventArgs.GetExtensionPoint Method

ExtensionEventArgsGetExtensionPoint Method
获取扩展点

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public ExtensionPoint GetExtensionPoint()
Public Function GetExtensionPoint As ExtensionPoint

Return Value

Type: ExtensionPoint

[Missing <returns> documentation for "M:OSGi.NET.Event.ExtensionEventArgs.GetExtensionPoint"]

See Also

Reference

ExtensionEventArgs Class
OSGi.NET.Event Namespace


ExtensionEventArgs.GetState Method

ExtensionEventArgsGetState Method
扩展点数据加载状态

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public int GetState()
Public Function GetState As Integer

Return Value

Type: Int32

[Missing <returns> documentation for "M:OSGi.NET.Event.ExtensionEventArgs.GetState"]

See Also

Reference

ExtensionEventArgs Class
OSGi.NET.Event Namespace


ServiceEventArgs Class

ServiceEventArgs Class
服务事件参数
Inheritance Hierarchy
SystemObject
SystemEventArgs
OSGi.NET.EventServiceEventArgs

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public class ServiceEventArgs : EventArgs
Public Class ServiceEventArgs
    Inherits EventArgs

The ServiceEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | GetSercieContracts | 获取服务约束数组
Public method | GetServiceReference | 获取服务引用
Public method | GetState | 获取服务变更状态
Top
Fields
Name | Description
REGISTERED | 注册服务
UNREGISTERING | 取消注册
Top
See Also

Reference

OSGi.NET.Event Namespace


ServiceEventArgs Fields

ServiceEventArgs Fields

The ServiceEventArgs type exposes the following members.

Fields
Name | Description
REGISTERED | 注册服务
UNREGISTERING | 取消注册
Top
See Also

Reference

ServiceEventArgs Class
OSGi.NET.Event Namespace


ServiceEventArgs.REGISTERED Field

ServiceEventArgsREGISTERED Field
注册服务

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int REGISTERED
Public Const REGISTERED As Integer

Field Value

Type: Int32
See Also

Reference

ServiceEventArgs Class
OSGi.NET.Event Namespace


ServiceEventArgs.UNREGISTERING Field

ServiceEventArgsUNREGISTERING Field
取消注册

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public const int UNREGISTERING
Public Const UNREGISTERING As Integer

Field Value

Type: Int32
See Also

Reference

ServiceEventArgs Class
OSGi.NET.Event Namespace


ServiceEventArgs Methods

ServiceEventArgs Methods

The ServiceEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | GetSercieContracts | 获取服务约束数组
Public method | GetServiceReference | 获取服务引用
Public method | GetState | 获取服务变更状态
Top
See Also

Reference

ServiceEventArgs Class
OSGi.NET.Event Namespace


ServiceEventArgs.GetSercieContracts Method

ServiceEventArgsGetSercieContracts Method
获取服务约束数组

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public string[] GetSercieContracts()
Public Function GetSercieContracts As String()

Return Value

Type: String

[Missing <returns> documentation for "M:OSGi.NET.Event.ServiceEventArgs.GetSercieContracts"]

See Also

Reference

ServiceEventArgs Class
OSGi.NET.Event Namespace


ServiceEventArgs.GetServiceReference Method

ServiceEventArgsGetServiceReference Method
获取服务引用

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public IServiceReference GetServiceReference()
Public Function GetServiceReference As IServiceReference

Return Value

Type: IServiceReference

[Missing <returns> documentation for "M:OSGi.NET.Event.ServiceEventArgs.GetServiceReference"]

See Also

Reference

ServiceEventArgs Class
OSGi.NET.Event Namespace


ServiceEventArgs.GetState Method

ServiceEventArgsGetState Method
获取服务变更状态

Namespace: OSGi.NET.Event
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public int GetState()
Public Function GetState As Integer

Return Value

Type: Int32

[Missing <returns> documentation for "M:OSGi.NET.Event.ServiceEventArgs.GetState"]

See Also

Reference

ServiceEventArgs Class
OSGi.NET.Event Namespace


OSGi.NET.Extension Namespace

OSGi.NET.Extension Namespace
Classes
 | Class | Description
Public class | ExtensionData | 扩展数据实体
Public class | ExtensionPoint | 扩展点实体


ExtensionData Class

ExtensionData Class
扩展数据实体
Inheritance Hierarchy
SystemObject
OSGi.NET.ExtensionExtensionData

Namespace: OSGi.NET.Extension
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public class ExtensionData
Public Class ExtensionData

The ExtensionData type exposes the following members.

Constructors
 | Name | Description
Public method | ExtensionData | Initializes a new instance of the ExtensionData class
Top
Properties
 | Name | Description
Public property | ExtensionList | 扩展数据节点集合
Public property | Name | 扩展点名称
Public property | Owner | 拥有Bundle
Top
See Also

Reference

OSGi.NET.Extension Namespace


ExtensionData Constructor

ExtensionData Constructor
Initializes a new instance of the ExtensionData class

Namespace: OSGi.NET.Extension
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public ExtensionData()
Public Sub New
See Also

Reference

ExtensionData Class
OSGi.NET.Extension Namespace


ExtensionData Properties

ExtensionData Properties

The ExtensionData type exposes the following members.

Properties
 | Name | Description
Public property | ExtensionList | 扩展数据节点集合
Public property | Name | 扩展点名称
Public property | Owner | 拥有Bundle
Top
See Also

Reference

ExtensionData Class
OSGi.NET.Extension Namespace


ExtensionData.ExtensionList Property

ExtensionDataExtensionList Property
扩展数据节点集合

Namespace: OSGi.NET.Extension
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public IList<XmlNode> ExtensionList { get; set; }
Public Property ExtensionList As IList(Of XmlNode)
    Get
    Set

Property Value

Type: IList XmlNode
See Also

Reference

ExtensionData Class
OSGi.NET.Extension Namespace


ExtensionData.Name Property

ExtensionDataName Property
扩展点名称

Namespace: OSGi.NET.Extension
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public string Name { get; set; }
Public Property Name As String
    Get
    Set

Property Value

Type: String
See Also

Reference

ExtensionData Class
OSGi.NET.Extension Namespace


ExtensionData.Owner Property

ExtensionDataOwner Property
拥有Bundle

Namespace: OSGi.NET.Extension
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public IBundle Owner { get; set; }
Public Property Owner As IBundle
    Get
    Set

Property Value

Type: IBundle
See Also

Reference

ExtensionData Class
OSGi.NET.Extension Namespace


ExtensionPoint Class

ExtensionPoint Class
扩展点实体
Inheritance Hierarchy
SystemObject
OSGi.NET.ExtensionExtensionPoint

Namespace: OSGi.NET.Extension
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public class ExtensionPoint
Public Class ExtensionPoint

The ExtensionPoint type exposes the following members.

Constructors
 | Name | Description
Public method | ExtensionPoint | Initializes a new instance of the ExtensionPoint class
Top
Properties
 | Name | Description
Public property | Name | 扩展点名称
Public property | Owner | 拥有Bundle
Top
See Also

Reference

OSGi.NET.Extension Namespace


ExtensionPoint Constructor

ExtensionPoint Constructor
Initializes a new instance of the ExtensionPoint class

Namespace: OSGi.NET.Extension
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public ExtensionPoint()
Public Sub New
See Also

Reference

ExtensionPoint Class
OSGi.NET.Extension Namespace


ExtensionPoint Properties

ExtensionPoint Properties

The ExtensionPoint type exposes the following members.

Properties
 | Name | Description
Public property | Name | 扩展点名称
Public property | Owner | 拥有Bundle
Top
See Also

Reference

ExtensionPoint Class
OSGi.NET.Extension Namespace


ExtensionPoint.Name Property

ExtensionPointName Property
扩展点名称

Namespace: OSGi.NET.Extension
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public string Name { get; set; }
Public Property Name As String
    Get
    Set

Property Value

Type: String
See Also

Reference

ExtensionPoint Class
OSGi.NET.Extension Namespace


ExtensionPoint.Owner Property

ExtensionPointOwner Property
拥有Bundle

Namespace: OSGi.NET.Extension
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public IBundle Owner { get; set; }
Public Property Owner As IBundle
    Get
    Set

Property Value

Type: IBundle
See Also

Reference

ExtensionPoint Class
OSGi.NET.Extension Namespace


OSGi.NET.Listener Namespace

OSGi.NET.Listener Namespace
Interfaces
 | Interface | Description
Public interface | IBundleListener | Bundle状态监听器
Public interface | IExtensionListener | Bundle扩展点监听器
Public interface | IServiceListener | 服务状态监听器


IBundleListener Interface

IBundleListener Interface
Bundle状态监听器

Namespace: OSGi.NET.Listener
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public interface IBundleListener
Public Interface IBundleListener

The IBundleListener type exposes the following members.

Methods
 | Name | Description
Public method | BundleChanged | Bundle状态变更
Top
See Also

Reference

OSGi.NET.Listener Namespace


IBundleListener Methods

IBundleListener Methods

The IBundleListener type exposes the following members.

Methods
 | Name | Description
Public method | BundleChanged | Bundle状态变更
Top
See Also

Reference

IBundleListener Interface
OSGi.NET.Listener Namespace


IBundleListener.BundleChanged Method

IBundleListenerBundleChanged Method
Bundle状态变更

Namespace: OSGi.NET.Listener
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void BundleChanged(
    BundleEventArgs e
)
Sub BundleChanged (
    e As BundleEventArgs
)

Parameters

e
Type: OSGi.NET.EventBundleEventArgs
Bundle事件参数
See Also

Reference

IBundleListener Interface
OSGi.NET.Listener Namespace


IExtensionListener Interface

IExtensionListener Interface
Bundle扩展点监听器

Namespace: OSGi.NET.Listener
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public interface IExtensionListener
Public Interface IExtensionListener

The IExtensionListener type exposes the following members.

Methods
 | Name | Description
Public method | ExtensionChanged | Bundle扩展点变更
Top
See Also

Reference

OSGi.NET.Listener Namespace


IExtensionListener Methods

IExtensionListener Methods

The IExtensionListener type exposes the following members.

Methods
 | Name | Description
Public method | ExtensionChanged | Bundle扩展点变更
Top
See Also

Reference

IExtensionListener Interface
OSGi.NET.Listener Namespace


IExtensionListener.ExtensionChanged Method

IExtensionListenerExtensionChanged Method
Bundle扩展点变更

Namespace: OSGi.NET.Listener
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void ExtensionChanged(
    ExtensionEventArgs e
)
Sub ExtensionChanged (
    e As ExtensionEventArgs
)

Parameters

e
Type: OSGi.NET.EventExtensionEventArgs
扩展点事件参数
See Also

Reference

IExtensionListener Interface
OSGi.NET.Listener Namespace


IServiceListener Interface

IServiceListener Interface
服务状态监听器

Namespace: OSGi.NET.Listener
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public interface IServiceListener
Public Interface IServiceListener

The IServiceListener type exposes the following members.

Methods
 | Name | Description
Public method | ServiceChanged | 服务状态变更
Top
See Also

Reference

OSGi.NET.Listener Namespace


IServiceListener Methods

IServiceListener Methods

The IServiceListener type exposes the following members.

Methods
 | Name | Description
Public method | ServiceChanged | 服务状态变更
Top
See Also

Reference

IServiceListener Interface
OSGi.NET.Listener Namespace


IServiceListener.ServiceChanged Method

IServiceListenerServiceChanged Method
服务状态变更

Namespace: OSGi.NET.Listener
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void ServiceChanged(
    ServiceEventArgs serviceEvent
)
Sub ServiceChanged (
    serviceEvent As ServiceEventArgs
)

Parameters

serviceEvent
Type: OSGi.NET.EventServiceEventArgs
服务事件参数
See Also

Reference

IServiceListener Interface
OSGi.NET.Listener Namespace


OSGi.NET.Provider Namespace

OSGi.NET.Provider Namespace
Classes
 | Class | Description
Public class | BundleAssemblyProvider | Bundle关联程序集提供程序


BundleAssemblyProvider Class

BundleAssemblyProvider Class
Bundle关联程序集提供程序
Inheritance Hierarchy
SystemObject
OSGi.NET.ProviderBundleAssemblyProvider

Namespace: OSGi.NET.Provider
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public static class BundleAssemblyProvider
Public NotInheritable Class BundleAssemblyProvider

The BundleAssemblyProvider type exposes the following members.

Methods
Name | Description
GetManagedAssemblies | 获取所有已管理的程序集
Top
See Also

Reference

OSGi.NET.Provider Namespace


BundleAssemblyProvider Methods

BundleAssemblyProvider Methods

The BundleAssemblyProvider type exposes the following members.

Methods
Name | Description
GetManagedAssemblies | 获取所有已管理的程序集
Top
See Also

Reference

BundleAssemblyProvider Class
OSGi.NET.Provider Namespace


BundleAssemblyProvider.GetManagedAssemblies Method

BundleAssemblyProviderGetManagedAssemblies Method
获取所有已管理的程序集

Namespace: OSGi.NET.Provider
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public static IList<Assembly> GetManagedAssemblies()
Public Shared Function GetManagedAssemblies As IList(Of Assembly)

Return Value

Type: IList Assembly
管理的程序集
See Also

Reference

BundleAssemblyProvider Class
OSGi.NET.Provider Namespace


OSGi.NET.Service Namespace

OSGi.NET.Service Namespace
Interfaces
 | Interface | Description
Public interface | IServiceReference | 服务引用，指向服务的引用，它们并不是真正的服务对象
Public interface | IServiceRegistration | 服务注册信息，用于更新服务属性，反注册服务


IServiceReference Interface

IServiceReference Interface
服务引用，指向服务的引用，它们并不是真正的服务对象

Namespace: OSGi.NET.Service
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public interface IServiceReference : IComparable
Public Interface IServiceReference
    Inherits IComparable

The IServiceReference type exposes the following members.

Methods
 | Name | Description
Public method | GetBundle | 返回公布服务的模块
Public method | GetProperty | 获取服务属性值
Public method | GetPropertyKeys | 获取服务属性Key数组
Public method | GetSercieContracts | 获取服务约束数组
Public method | GetService | 获取服务实例
Public method | GetUsingBundles | 获取正在使用指定服务的所有Bundle模块
Public method | SetProperties | 设置服务属性
Top
See Also

Reference

OSGi.NET.Service Namespace


IServiceReference Methods

IServiceReference Methods

The IServiceReference type exposes the following members.

Methods
 | Name | Description
Public method | GetBundle | 返回公布服务的模块
Public method | GetProperty | 获取服务属性值
Public method | GetPropertyKeys | 获取服务属性Key数组
Public method | GetSercieContracts | 获取服务约束数组
Public method | GetService | 获取服务实例
Public method | GetUsingBundles | 获取正在使用指定服务的所有Bundle模块
Public method | SetProperties | 设置服务属性
Top
See Also

Reference

IServiceReference Interface
OSGi.NET.Service Namespace


IServiceReference.GetBundle Method

IServiceReferenceGetBundle Method
返回公布服务的模块

Namespace: OSGi.NET.Service
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IBundle GetBundle()
Function GetBundle As IBundle

Return Value

Type: IBundle
Bundle模块
See Also

Reference

IServiceReference Interface
OSGi.NET.Service Namespace


IServiceReference.GetProperty Method

IServiceReferenceGetProperty Method
获取服务属性值

Namespace: OSGi.NET.Service
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
Object GetProperty(
    string key
)
Function GetProperty (
    key As String
) As Object

Parameters

key
Type: SystemString
属性Key

Return Value

Type: Object
属性值
See Also

Reference

IServiceReference Interface
OSGi.NET.Service Namespace


IServiceReference.GetPropertyKeys Method

IServiceReferenceGetPropertyKeys Method
获取服务属性Key数组

Namespace: OSGi.NET.Service
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
string[] GetPropertyKeys()
Function GetPropertyKeys As String()

Return Value

Type: String
Key数组
See Also

Reference

IServiceReference Interface
OSGi.NET.Service Namespace


IServiceReference.GetSercieContracts Method

IServiceReferenceGetSercieContracts Method
获取服务约束数组

Namespace: OSGi.NET.Service
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
string[] GetSercieContracts()
Function GetSercieContracts As String()

Return Value

Type: String
约束数组
See Also

Reference

IServiceReference Interface
OSGi.NET.Service Namespace


IServiceReference.GetService Method

IServiceReferenceGetService Method
获取服务实例

Namespace: OSGi.NET.Service
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
Object GetService()
Function GetService As Object

Return Value

Type: Object
服务实例
See Also

Reference

IServiceReference Interface
OSGi.NET.Service Namespace


IServiceReference.GetUsingBundles Method

IServiceReferenceGetUsingBundles Method
获取正在使用指定服务的所有Bundle模块

Namespace: OSGi.NET.Service
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IList<IBundle> GetUsingBundles()
Function GetUsingBundles As IList(Of IBundle)

Return Value

Type: IList IBundle
Bundle模块列表
See Also

Reference

IServiceReference Interface
OSGi.NET.Service Namespace


IServiceReference.SetProperties Method

IServiceReferenceSetProperties Method
设置服务属性

Namespace: OSGi.NET.Service
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void SetProperties(
    IDictionary<string, Object> propertyDictionary
)
Sub SetProperties (
    propertyDictionary As IDictionary(Of String, Object)
)

Parameters

propertyDictionary
Type: System.Collections.GenericIDictionary String, Object
服务属性字典
See Also

Reference

IServiceReference Interface
OSGi.NET.Service Namespace


IServiceRegistration Interface

IServiceRegistration Interface
服务注册信息，用于更新服务属性，反注册服务

Namespace: OSGi.NET.Service
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
public interface IServiceRegistration
Public Interface IServiceRegistration

The IServiceRegistration type exposes the following members.

Methods
 | Name | Description
Public method | GetReference | 获取服务引用
Public method | SetProperties | 设置服务属性
Public method | Unregister | 取消注册公开的服务对象
Top
See Also

Reference

OSGi.NET.Service Namespace


IServiceRegistration Methods

IServiceRegistration Methods

The IServiceRegistration type exposes the following members.

Methods
 | Name | Description
Public method | GetReference | 获取服务引用
Public method | SetProperties | 设置服务属性
Public method | Unregister | 取消注册公开的服务对象
Top
See Also

Reference

IServiceRegistration Interface
OSGi.NET.Service Namespace


IServiceRegistration.GetReference Method

IServiceRegistrationGetReference Method
获取服务引用

Namespace: OSGi.NET.Service
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
IServiceReference GetReference()
Function GetReference As IServiceReference

Return Value

Type: IServiceReference
服务引用
See Also

Reference

IServiceRegistration Interface
OSGi.NET.Service Namespace


IServiceRegistration.SetProperties Method

IServiceRegistrationSetProperties Method
设置服务属性

Namespace: OSGi.NET.Service
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void SetProperties(
    IDictionary<string, Object> properties
)
Sub SetProperties (
    properties As IDictionary(Of String, Object)
)

Parameters

properties
Type: System.Collections.GenericIDictionary String, Object
服务属性字典
See Also

Reference

IServiceRegistration Interface
OSGi.NET.Service Namespace


IServiceRegistration.Unregister Method

IServiceRegistrationUnregister Method
取消注册公开的服务对象

Namespace: OSGi.NET.Service
Assembly: OSGi.NET (in OSGi.NET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
Copy
void Unregister()
Sub Unregister
See Also

Reference

IServiceRegistration Interface
OSGi.NET.Service Namespace