本文整理汇总了Java中com.sun.corba.se.impl.protocol.JIDLLocalCRDImpl.setServant方法的典型用法代码示例。如果您正苦于以下问题:Java JIDLLocalCRDImpl.setServant方法的具体用法?Java JIDLLocalCRDImpl.setServant怎么用?Java JIDLLocalCRDImpl.setServant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.corba.se.impl.protocol.JIDLLocalCRDImpl
的用法示例。
在下文中一共展示了JIDLLocalCRDImpl.setServant方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connect
import com.sun.corba.se.impl.protocol.JIDLLocalCRDImpl; //导入方法依赖的package包/类
public void connect( org.omg.CORBA.Object objref)
{
// Store the objref and get a userkey allocated by the transient
// object manager.
byte[] key = servants.storeServant(objref, null);
// Find out the repository ID for this objref.
String id = StubAdapter.getTypeIds( objref )[0] ;
// Create the new objref
ObjectReferenceFactory orf = getCurrentFactory() ;
org.omg.CORBA.Object obj = orf.make_object( id, key ) ;
// Copy the delegate from the new objref to the argument
// XXX handle the case of an attempt to connect a local object.
org.omg.CORBA.portable.Delegate delegate = StubAdapter.getDelegate(
obj ) ;
CorbaContactInfoList ccil = (CorbaContactInfoList)
((ClientDelegate)delegate).getContactInfoList() ;
LocalClientRequestDispatcher lcs =
ccil.getLocalClientRequestDispatcher() ;
if (lcs instanceof JIDLLocalCRDImpl) {
JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
jlcs.setServant( objref ) ;
} else {
throw new RuntimeException(
"TOAImpl.connect can not be called on " + lcs ) ;
}
StubAdapter.setDelegate( objref, delegate ) ;
}