本文整理汇总了Java中javax.rmi.CORBA.Stub类的典型用法代码示例。如果您正苦于以下问题:Java Stub类的具体用法?Java Stub怎么用?Java Stub使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Stub类属于javax.rmi.CORBA包,在下文中一共展示了Stub类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOrb
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
@Override
public Object getOrb(Object stub) {
try {
return ((Stub)stub)._orb();
} catch (org.omg.CORBA.BAD_OPERATION x) {
throw new UnsupportedOperationException(x);
}
}
示例2: exportObject
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
/**
* Find or create a tie for this target and mark it as being used by the given
* object.
*/
public void exportObject(Remote obj)
throws RemoteException
{
if (obj instanceof Stub)
Util.registerTarget(StubDelegateImpl.getTieFromStub((Stub) obj), obj);
else if (obj instanceof Tie)
{
Tie t = (Tie) obj;
Util.registerTarget(t, null);
}
}
示例3: 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;
}
示例4: toString
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
/**
* Returns the IOR reference of the connected ORB.
*
* @see ORB#object_to_string(org.omg.CORBA.Object);
*/
public String toString(Stub self)
{
try
{
return self._orb().object_to_string(self);
}
catch (Exception ex)
{
return null;
}
}
示例5: readObject
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
/**
* Read as CORBA object when the ORB is known. The ORB must be set under the
* previous call of Stub.connect. The Stub is automatically registered with
* this ORB.
*/
public void readObject(Stub self, ObjectInputStream input, ORB orb)
throws IOException, ClassNotFoundException
{
byte[] b = (byte[]) input.readObject();
BufferredCdrInput in = new BufferredCdrInput(b);
if (orb != null)
in.setOrb(orb);
ObjectImpl r = (ObjectImpl) in.read_Object();
self._set_delegate(r._get_delegate());
}
示例6: writeObject
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
/**
* Write as CORBA object. The ORB must be either set under the previous call
* of Stub.connect or it is taken from the org.omg.CORBA.portable.Delegate.
* The Stub is automatically registered with this ORB (if not already done).
*/
public void writeObject(Stub self, ObjectOutputStream output, ORB orb)
throws IOException
{
BufferedCdrOutput out = new BufferedCdrOutput();
out.setOrb(orb == null ? self._orb() : orb);
out.write_Object(self);
output.writeObject(out.buffer.toByteArray());
}
示例7: isLocal
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
/**
* Checks if the given stub is local.
*
* @param stub a stub to check.
* @return true if the stub is local, false otherwise.
*/
public boolean isLocal(Stub stub)
throws RemoteException
{
try
{
return stub._is_local();
}
catch (SystemException e)
{
RemoteException rex = new RemoteException();
rex.initCause(e);
throw rex;
}
}
示例8: toString
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
/**
* Returns the IOR reference of the connected ORB.
*
* @see ORB#object_to_string(org.omg.CORBA.Object);
*/
public String toString(Stub self)
{
try
{
return self._orb().object_to_string(self);
}
catch (Exception ex)
{
return null;
}
}
示例9: isLocal
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
/**
* Checks if the given stub is local.
*
* @param stub a stub to check.
* @return true if the stub is local, false otherwise.
*/
public boolean isLocal(Stub stub)
throws RemoteException
{
try
{
return stub._is_local();
}
catch (SystemException e)
{
RemoteException rex = new RemoteException();
rex.initCause(e);
throw rex;
}
}
示例10: connect
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
public static Object connect(final Object obj) throws IOException {
if (obj instanceof Stub) {
final Stub stub = (Stub) obj;
final ORB orb = getORB();
stub.connect(orb);
}
return obj;
}
示例11: isStub
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
@Override
public boolean isStub(Object obj) {
return (obj instanceof Stub);
}
示例12: getDelegate
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
@Override
public Object getDelegate(Object stub) {
return ((Stub)stub)._get_delegate();
}
示例13: setDelegate
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
@Override
public void setDelegate(Object stub, Object delegate) {
((Stub)stub)._set_delegate((Delegate)delegate);
}
示例14: connect
import javax.rmi.CORBA.Stub; //导入依赖的package包/类
@Override
public void connect(Object stub, Object orb)
throws RemoteException
{
((Stub)stub).connect((ORB)orb);
}