共享对象函数
共享对象函数用于得到、注册共享对象,它们通常在分布式应用程序中使用。
1、SharedObjectDirectory()
功 能:得到用于共享的一组已注册对象的名称。
语 法:SharedObjectDirectory ( instancenames {,classnames} )
参 数:instancenames:String类型动态数组,用于存储已注册共享对象的名称;
classnames:String类型动态数组,用于存储已注册共享对象的类名。
返回值:ErrorReturn枚举类型。函数执行成功时返回Success!,发生错误时返回FeatureNotSupportedError!
用 法:共享对象只能在服务器的主会话或在服务器上为每个客户连接创建的客户会话中访问。客户应用程序不能够直接使用共享对象,因此,要得到已注册共享对象的名称,必须在服务器的执行上下文中调用该函数,或者在服务器上的某个客户会话中调用该函数。
示 例:In this example, the application retrieves the list of shared objects and their class names:
integer status
string InstanceNames[]
string ClassNames[]
status = SharedObjectDirectory(InstanceNames,ClassNames)
2、SharedObjectGet()
功 能:得