Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Znav
nextDynamic Invocation and Dispatch
prevIntercepting Object Insertion and Extraction in C-Sharp

As in the case of Ice objects, a Dynamic Ice application may represent user exceptions in a native format that is not directly compatible with the Ice API. If the application needs to raise such a user exception to the Ice run time, the exception must be wrapped in a subclass of Ice.UserException. The Dynamic Ice API provides a class to simplify this process:

Wiki Markup
{zcode:cs}
namespace Ice
{
    public abstract class UserExceptionWriter : UserException
    {
        public UserExceptionWriter(Communicator communicator);

        public abstract void write(OutputStream os);
        public abstract bool usesClasses();

        // ...
    }
}
{zcode}

A subclass of UserExceptionWriter is responsible for supplying a communicator to the constructor, and for implementing the following methods:

  • void write(OutputStream os)
    This method is invoked when the Ice run time is ready to marshal the exception. The subclass must marshal the exception using the encoding rules for exceptions.
  • bool usesClasses()
    Return true if the exception, or any base exception, contains a data member that is an object by value.
    Ztop
See Also
Zret
Znav
nextDynamic Invocation and Dispatch
prevIntercepting Object Insertion and Extraction in C-Sharp