1 / 2
文档名称:

分布式对话服务器的管理(4)(2).txt

格式:txt   页数:2
下载后只包含 1 个 TXT 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

分布式对话服务器的管理(4)(2).txt

上传人:管理资源吧 2011/9/15 文件大小:0 KB

下载得到文件列表

分布式对话服务器的管理(4)(2).txt

文档介绍

文档介绍:作者:运气
email: webmaster@
日期:7/4/2001 1:42:32 PM
首先,对话服务器将获得Mnemosyne对象的一个实例,该实例被绑定到对话服务器的本地IP上。
protected void bindMnemosyne()
{
file://得到Mnemosyne
Mnemosyne Mnemosyne = null;
try
{
Mnemosyne = ();
}
catch(RemoteException remoteException)
{
("Internal error:");
("Can't create a Mnemosyne");
(1);
}
// 把Mnemosyne绑定到MnemosyneImpl
try
{
String rmiURL = "//" + _localIP + "/MnemosyneImpl";
(rmiURL, Mnemosyne);
}
catch(ArrayIndexOutOfBoundsException ArrayIndexOutOfBoundsException)
{
throw new IllegalArgumentException("LocalIP is invalid");
}
catch(MalformedURLException malformedURLException)
{
throw new IllegalArgumentException("LocalIP is invalid");
}
catch(RemoteException remoteException)
{
("Internal error:");
("Can't rebind a Mnemosyne to MnemosyneImpl");
(1);
}
}
通过把本地Mnemosyne上一系列代表RMI名字符号的URL赋予远程对话服务器,就能引发同步操作,这些URL存贮在一个被称作rmiURL的字符串数组中。在SessionServer的符号中,URL是作为参数从命令行命令中获得的,但它可以来自其他渠道:
protected void synchronizeMnemosyne()
{
file://获得本地Mnemosyne
Mnemosyne localMnemosyne = null;
try
{
localMnemosyne = (Mnemosyne) (_localIP);
}
catch(Exception exception)
{
("Internal error:");
("Can'