本文整理汇总了Java中org.omg.CORBA.portable.Delegate.orb方法的典型用法代码示例。如果您正苦于以下问题:Java Delegate.orb方法的具体用法?Java Delegate.orb怎么用?Java Delegate.orb使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.omg.CORBA.portable.Delegate
的用法示例。
在下文中一共展示了Delegate.orb方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connect
import org.omg.CORBA.portable.Delegate; //导入方法依赖的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);
}
示例2: write_Object
import org.omg.CORBA.portable.Delegate; //导入方法依赖的package包/类
/**
* Read the CORBA object. The object is written form of the plain (not a
* string-encoded) IOR profile without the heading endian indicator. The
* responsible method for reading such data is {@link IOR.write_no_endian}.
*
* The null value is written as defined in OMG specification (zero length
* string, followed by an empty set of profiles).
*/
public void write_Object(org.omg.CORBA.Object x)
{
ORB w_orb = orb;
if (x instanceof IorProvider)
{
((IorProvider) x).getIor()._write_no_endian(this);
return;
}
else if (x == null)
{
IOR.write_null(this);
return;
}
else if (x instanceof ObjectImpl)
{
Delegate d = ((ObjectImpl) x)._get_delegate();
if (d instanceof IorProvider)
{
((IorProvider) d).getIor()._write_no_endian(this);
return;
}
else
{
ORB d_orb = d.orb(x);
if (d_orb != null)
w_orb = d_orb;
}
}
// Either this is not an ObjectImpl or it has the
// unexpected delegate. Try to convert via ORBs
// object_to_string().
if (w_orb != null)
{
IOR ior = IOR.parse(w_orb.object_to_string(x));
ior._write_no_endian(this);
return;
}
else
throw new BAD_OPERATION(
"Please set the ORB for this stream, cannot write "
+ x.getClass().getName());
}
示例3: write_Object
import org.omg.CORBA.portable.Delegate; //导入方法依赖的package包/类
/**
* Read the CORBA object. The object is written form of the plain (not a
* string-encoded) IOR profile without the heading endian indicator. The
* responsible method for reading such data is {@link IOR.write_no_endian}.
*
* The null value is written as defined in OMG specification (zero length
* string, followed by an empty set of profiles).
*/
public void write_Object(org.omg.CORBA.Object x)
{
ORB w_orb = orb;
if (x instanceof IorProvider)
{
((IorProvider) x).getIor()._write_no_endian(this);
return;
}
else if (x == null)
{
IOR.write_null(this);
return;
}
else if (x instanceof ObjectImpl)
{
Delegate d = ((ObjectImpl) x)._get_delegate();
if (d instanceof IorProvider)
{
((IorProvider) d).getIor()._write_no_endian(this);
return;
}
else
{
ORB d_orb = d.orb(x);
if (d_orb != null)
w_orb = d_orb;
}
}
// Either this is not an ObjectImpl or it has the
// unexpected delegate. Try to convert via ORBs
// object_to_string().
if (w_orb != null)
{
IOR ior = IOR.parse(w_orb.object_to_string(x));
ior._write_no_endian(this);
return;
}
else
throw new BAD_OPERATION(
"Please set the ORB for this stream, cannot write "
+ x.getClass().getName());
}