You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Jiri Daněk (JIRA)" <ji...@apache.org> on 2017/10/13 14:41:02 UTC

[jira] [Created] (PROTON-1627) [cpp] on_*_open handlers require a super call

Jiri Daněk created PROTON-1627:
----------------------------------

             Summary: [cpp] on_*_open handlers require a super call
                 Key: PROTON-1627
                 URL: https://issues.apache.org/jira/browse/PROTON-1627
             Project: Qpid Proton
          Issue Type: Bug
          Components: cpp-binding
    Affects Versions: proton-j-0.18.0
            Reporter: Jiri Daněk
            Assignee: Cliff Jansen


User needs to implement the on_*_ handlers like this
{code}
void on_connection_open(proton::connection &c) override {
        proton::messaging_handler::on_connection_open(c);
[...]
{code}

The super implementation does

{code}
    if (c.uninitialized()) {
        pn_connection_open(unwrap(c));
    }
{code}

There are issues with that.  The rule for handlers seems to be. 1) do not call super method in on_*_error, 2) call it everywhere else. This is complicated.

Next, handlers are generally expected not to require a super call. https://martinfowler.com/bliki/CallSuper.html

Finally, this is not documented on the {{on_connection_open}} method. I only went looking there when I figured what the problem was.




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org