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/