本文整理汇总了Java中javax.rmi.CORBA.Stub._get_delegate方法的典型用法代码示例。如果您正苦于以下问题:Java Stub._get_delegate方法的具体用法?Java Stub._get_delegate怎么用?Java Stub._get_delegate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.rmi.CORBA.Stub
的用法示例。
在下文中一共展示了Stub._get_delegate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equals
import javax.rmi.CORBA.Stub; //导入方法依赖的package包/类
/**
* Compare two stubs for equality.
*/
public boolean equals(Stub self, java.lang.Object obj)
{
if (obj instanceof ObjectImpl)
{
ObjectImpl other = (ObjectImpl) obj;
Delegate d1 = other._get_delegate();
Delegate d2 = self._get_delegate();
if (d1 == null || d2 == null)
return d1 == d2;
else
return d1.equals(d2);
}
else return false;
}
示例2: connect
import javax.rmi.CORBA.Stub; //导入方法依赖的package包/类
/**
* Connect when the POA is specified.
*/
public static void connect(Stub self, ORB orb, POA poa)
throws RemoteException
{
ORB oorb = null;
try
{
Delegate d = self._get_delegate();
if (d != null)
oorb = d.orb(self);
}
catch (Exception e)
{
// Failed to get Delegate or ORB.
// (possible ony for user-written Stubs).
}
if (oorb != null)
{
if (!oorb.equals(orb))
throw new RemoteException("Stub " + self
+ " is connected to another ORB, " + orb);
else
return;
}
Tie t = null;
if (self instanceof Remote)
t = Util.getTie((Remote) self);
// Find by name pattern.
if (t == null)
t = getTieFromStub(self);
Delegate delegate;
if (t instanceof Servant)
{
try
{
if (poa == null)
{
poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
// Activate if not active.
if (poa.the_POAManager().get_state().value() == State._HOLDING)
poa.the_POAManager().activate();
}
ObjectImpl obj = (ObjectImpl) poa.servant_to_reference((Servant) t);
delegate = obj._get_delegate();
}
catch (Exception ex)
{
throw new Unexpected(ex);
}
}
else if (t instanceof ObjectImpl)
{
ObjectImpl o = (ObjectImpl) t;
orb.connect(o);
delegate = o._get_delegate();
}
else
throw new BAD_PARAM("The Tie must be either Servant or ObjectImpl");
self._set_delegate(delegate);
}
示例3: hashCode
import javax.rmi.CORBA.Stub; //导入方法依赖的package包/类
/**
* Get the hash code (from IOR reference).
*/
public int hashCode(Stub self)
{
Delegate d = self._get_delegate();
return d==null?0:d.hashCode();
}