本文整理汇总了Java中org.omg.PortableServer.portable.Delegate类的典型用法代码示例。如果您正苦于以下问题:Java Delegate类的具体用法?Java Delegate怎么用?Java Delegate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Delegate类属于org.omg.PortableServer.portable包,在下文中一共展示了Delegate类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _get_delegate
import org.omg.PortableServer.portable.Delegate; //导入依赖的package包/类
/**
* Gets the ORB vendor-specific implementation of
* <code>PortableServer::Servant</code>.
* @return <code>_delegate</code> the ORB vendor-specific
* implementation of <code>PortableServer::Servant</code>.
*/
final public Delegate _get_delegate() {
if (_delegate == null) {
throw
new
org.omg.CORBA.BAD_INV_ORDER
("The Servant has not been associated with an ORB instance");
}
return _delegate;
}
示例2: _get_delegate
import org.omg.PortableServer.portable.Delegate; //导入依赖的package包/类
/**
* Get the delegate, where calls to some Servant methods are forwarded.
*/
public final Delegate _get_delegate()
{
if (delegate == null) {
throw new BAD_INV_ORDER
("The Servant has not been associated with an ORBinstance");
}
return delegate;
}
示例3: _get_delegate
import org.omg.PortableServer.portable.Delegate; //导入依赖的package包/类
/**
* Get the delegate, where calls to some Servant methods are forwarded.
*/
public final Delegate _get_delegate()
{
if (delegate == null) {
throw new BAD_INV_ORDER
("The Servant has not been associated with an ORBinstance");
}
return delegate;
}
示例4: _get_interface_def
import org.omg.PortableServer.portable.Delegate; //导入依赖的package包/类
/**
* Returns an <code>InterfaceDef</code> object as a
* <code>CORBA::Object</code> that defines the runtime type of the
* <code>CORBA::Object</code> implemented by the <code>Servant</code>.
* The invoker of <code>_get_interface_def</code>
* must narrow the result to an <code>InterfaceDef</code> in order
* to use it.
* <P>This default implementation of <code>_get_interface_def()</code>
* can be overridden
* by derived servants if the default behavior is not adequate.
* As defined in the CORBA 2.3.1 specification, section 11.3.1, the
* default behavior of <code>_get_interface_def()</code> is to use
* the most derived
* interface of a static servant or the most derived interface retrieved
* from a dynamic servant to obtain the <code>InterfaceDef</code>.
* This behavior must
* be supported by the <code>Delegate</code> that implements the
* <code>Servant</code>.
* @return <code>get_interface_def</code> an <code>InterfaceDef</code>
* object as a
* <code>CORBA::Object</code> that defines the runtime type of the
* <code>CORBA::Object</code> implemented by the <code>Servant</code>.
*/
public org.omg.CORBA.Object _get_interface_def()
{
// First try to call the delegate implementation class's
// "Object get_interface_def(..)" method (will work for ORBs
// whose delegates implement this method).
// Else call the delegate implementation class's
// "InterfaceDef get_interface(..)" method using reflection
// (will work for ORBs that were built using an older version
// of the Delegate interface with a get_interface method
// but not a get_interface_def method).
org.omg.PortableServer.portable.Delegate delegate = _get_delegate();
try {
// If the ORB's delegate class does not implement
// "Object get_interface_def(..)", this will throw
// an AbstractMethodError.
return delegate.get_interface_def(this);
} catch( AbstractMethodError aex ) {
// Call "InterfaceDef get_interface(..)" method using reflection.
try {
Class[] argc = { org.omg.PortableServer.Servant.class };
java.lang.reflect.Method meth =
delegate.getClass().getMethod("get_interface", argc);
Object[] argx = { this };
return (org.omg.CORBA.Object)meth.invoke(delegate, argx);
} catch( java.lang.reflect.InvocationTargetException exs ) {
Throwable t = exs.getTargetException();
if (t instanceof Error) {
throw (Error) t;
} else if (t instanceof RuntimeException) {
throw (RuntimeException) t;
} else {
throw new org.omg.CORBA.NO_IMPLEMENT();
}
} catch( RuntimeException rex ) {
throw rex;
} catch( Exception exr ) {
throw new org.omg.CORBA.NO_IMPLEMENT();
}
}
}
示例5: _set_delegate
import org.omg.PortableServer.portable.Delegate; //导入依赖的package包/类
/**
* Set the delegate for this servant.
*/
public final void _set_delegate(Delegate a_delegate)
{
delegate = a_delegate;
}
示例6: _set_delegate
import org.omg.PortableServer.portable.Delegate; //导入依赖的package包/类
/**
* Supports the Java ORB portability
* interfaces by providing a method for classes that support
* ORB portability through delegation to set their delegate.
* @param delegate ORB vendor-specific implementation of
* the <code>PortableServer::Servant</code>.
*/
final public void _set_delegate(Delegate delegate) {
_delegate = delegate;
}