My IDL looks like:
interface TransactionResource {
void prepare() raises (NotPreparedException);
void commit() raises(TransactionException);
void rollback() raises(TransactionException);
};
interface ManageDemand : TransactionResource {
string createDemand(in string demand);
};
interface ManageAccount : TransactionResource {
string createDemand(in string demand);
};
I create the ManageDemand distributed object on Server , I make it persistent, and it's reachable through the CORBALOC address.
On my client I have:
Object obj = orb.string_to_object(url.toString());
TransactionResource transactionResource = null;
if (obj._is_a("IDL:transaction/ManageDemand:1.0")){
transactionResource = ManageDemandHelper.narrow(obj);
} else {
transactionResource = ManageAccountHelper.narrow(obj);
}
When I try to test if the transactionResource object (distributed reference) is an instance of ManageDemand, the result is true.
But if I invoke Transaction object, defined like this:
interface Transaction {
ProxyStream addResource(in TransactionResource resource);
}
And I pass in parameter the transactionResource distributed reference, in this method when I test if this resource is an instance of ManageDemand, the result is false.
What I have to do, to recognize that this transactionResource is instance of ManageDemand on the addResource method?