. Simple service access for multi-module distributed systems in NET: OSGi prototype

Source: Internet
Author: User
Tags visual studio

Describe the scenario described in this article (3 servers, modules distributed across servers, distributed modules interdependent, interactive scenarios):

Multiple Osig engine interactions, using the. NET Remoting implementation principle:

When an interface is requested (that is, to obtain a service instance), OSGI is connected to the URL that provides the service via remoting, such as: Tcp://localhost:8888/osgi

After the connection succeeds, source OSGi sends the OpenService command to allow target OSGi to register the TCP Channel

Performs a resolution interface in a AppDomain based on the interface type, DLL path, AppDomain name, and then connects to the target OSGi new service (Appdomain.docallback)

On the configuration, in addition to the module configuration information in the previous article, the Distributed service configuration is also included in the Manifests.xml file as follows:

Manifests.xml

<?xml version= "1.0" encoding= "Utf-8"?>
<Manifests>
  <serviceport>1000</serviceport >
  <RemoteServiceMap>
    <service targetip= "127.0.0.1" 

targetport= "a" > OrderModule.PublicInterfaces.IOrderProce

ssor</service>
  </RemoteServiceMap>
</ manifests>//This representative: the current host does not have module hosting, but it can be communicated with other hosts to

achieve the purpose of forwarding

A configuration file that has both a local module and a remote service dependency

<?xml version= "1.0" encoding= "Utf-8"?>
<Manifests>
  <serviceport>2000</serviceport >
  <manifest>d:\documents\visual Studio

\projects\osgidemo\ordermodule\bin\debug\ Manifest.xml</manifest>  

//local module definition
  <RemoteServiceMap>
    <service targetip= "127.0.0.1" 

targetport= "3000" >loggingmodule.publicinterfaces.ilog</

Service>  //The real service to ilog this interface is a remote

dependency
  </RemoteServiceMap> </on remote server
Manifests>
<?xml version= "1.0" encoding= "Utf-8"?>
<Module>
  <name>order
  module</name> <Version>1</Version>
  <Assembly>OrderModule</Assembly>
  <Activator> Ordermodule.activator</activator>
  

<requiredservice>loggingmodule.publicinterfaces.ilog</ Required

service>      //Here's configuration is nothing special
  

<ProvidedService> ordermodule.publicinterfaces.iorderprocessor<

/providedservice>
</Module>

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.