简体   繁体   English

如何调用IDL接口上未指定的方法? [Corba,JAVA]

[英]How can I invoke methods which are not specified on the IDL interface ? [Corba, JAVA]

My IDL looks like : 我的IDL看起来像:

interface TransactionResource {
    void prepare() raises (NotPreparedException);
    void commit() raises(TransactionException);
    void rollback() raises(TransactionException);
};

When i implement the TransactionResourceImpl, I implement an other Java interface "ManageDemand" like this: 当我实现TransactionResourceImpl时,我实现了另一个Java接口“ManageDemand”,如下所示:

public class TransactionResourceImpl extends TransactionResourcePOA implements ManageDemand {
    // In this class, I redefine TransactionResource methods, and ManageDemand methods.
}

When I send this object TransactionResourceImpl to client, he can just use the TransactionResource methods and not ManageDemand methods. 当我将此对象TransactionResourceImpl发送到客户端时,他只能使用TransactionResource方法而不是ManageDemand方法。

I tried to use the reflexion to invoke ManageDemand methods, but it's not possible. 我试图使用反射来调用ManageDemand方法,但这是不可能的。

How can the client invoke ManageDemand methods, on the TransactionResourceImpl distributed reference? 客户端如何在TransactionResourceImpl分布式引用上调用ManageDemand方法?

It is not possible. 这不可能。 You'll have to add those methods to the IDL and implement them as you would any other CORBA object. 您必须将这些方法添加到IDL并像实现任何其他CORBA对象一样实现它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM