Qpid Proton C++  0.12.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
handler.hpp
1 #ifndef PROTON_CPP_MESSAGING_HANDLER_H
2 #define PROTON_CPP_MESSAGING_HANDLER_H
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include "proton/export.hpp"
26 
27 #include "proton/pn_unique_ptr.hpp"
28 
29 namespace proton {
30 
31 class condition;
32 class event;
33 class messaging_adapter;
34 
40 class handler
41 {
42  public:
45 
59  PN_CPP_EXTERN handler(int prefetch=10, bool auto_accept=true,
60  bool auto_settle=true,
61  bool peer_close_is_error=false);
62 
64 
65  PN_CPP_EXTERN virtual ~handler();
66 
72 
74  PN_CPP_EXTERN virtual void on_start(event &e);
76  PN_CPP_EXTERN virtual void on_message(event &e);
78  PN_CPP_EXTERN virtual void on_sendable(event &e);
79 
81  PN_CPP_EXTERN virtual void on_transport_close(event &e);
84  PN_CPP_EXTERN virtual void on_transport_error(event &e);
85 
87  PN_CPP_EXTERN virtual void on_connection_open(event &e);
89  PN_CPP_EXTERN virtual void on_connection_close(event &e);
91  PN_CPP_EXTERN virtual void on_connection_error(event &e);
92 
94  PN_CPP_EXTERN virtual void on_session_open(event &e);
96  PN_CPP_EXTERN virtual void on_session_close(event &e);
98  PN_CPP_EXTERN virtual void on_session_error(event &e);
99 
101  PN_CPP_EXTERN virtual void on_link_open(event &e);
103  PN_CPP_EXTERN virtual void on_link_close(event &e);
105  PN_CPP_EXTERN virtual void on_link_error(event &e);
106 
108  PN_CPP_EXTERN virtual void on_delivery_accept(event &e);
110  PN_CPP_EXTERN virtual void on_delivery_reject(event &e);
112  PN_CPP_EXTERN virtual void on_delivery_release(event &e);
114  PN_CPP_EXTERN virtual void on_delivery_settle(event &e);
115 
117  PN_CPP_EXTERN virtual void on_transaction_declare(event &e);
119  PN_CPP_EXTERN virtual void on_transaction_commit(event &e);
121  PN_CPP_EXTERN virtual void on_transaction_abort(event &e);
122 
126  PN_CPP_EXTERN virtual void on_timer(event &e);
128 
130  PN_CPP_EXTERN virtual void on_unhandled(event &e);
132  PN_CPP_EXTERN virtual void on_unhandled_error(event &e, const condition &c);
133 
135 
136  private:
137  pn_unique_ptr<messaging_adapter> messaging_adapter_;
138 
140  friend class container;
141  friend class connection_engine;
142  friend class connection_options;
143  friend class link_options;
145 };
146 
147 }
148 
149 #endif // PROTON_CPP_MESSAGING_HANDLER_H
virtual void on_link_open(event &e)
The remote peer opened the link.
A top-level container of connections, sessions, and links.
Definition: container.hpp:57
virtual void on_unhandled(event &e)
Fallback event handling.
virtual void on_delivery_reject(event &e)
The remote peer rejected an outgoing message.
A context for a proton event.
Definition: event.hpp:41
virtual void on_sendable(event &e)
A message can be sent.
virtual void on_transport_error(event &e)
The underlying network transport has closed with an error condition.
An interface for connection-oriented IO integration.
Definition: connection_engine.hpp:64
virtual void on_link_error(event &e)
The remote peer closed the link with an error condition.
virtual void on_transaction_declare(event &e)
The remote peer declared a transaction.
virtual void on_delivery_settle(event &e)
The remote peer settled an outgoing message.
virtual void on_link_close(event &e)
The remote peer closed the link.
virtual void on_session_error(event &e)
The remote peer closed the session with an error condition.
Options for creating a connection.
Definition: connection_options.hpp:60
Describes an endpoint error state.
Definition: condition.hpp:35
virtual void on_transaction_commit(event &e)
The remote peer committed a transaction.
virtual void on_message(event &e)
A message is received.
Callback functions for handling proton events.
Definition: handler.hpp:40
virtual void on_delivery_release(event &e)
The remote peer released an outgoing message.
virtual void on_delivery_accept(event &e)
The remote peer accepted an outgoing message.
virtual void on_transport_close(event &e)
The underlying network transport has closed.
virtual void on_connection_error(event &e)
The remote peer closed the connection with an error condition.
virtual void on_start(event &e)
The event loop is starting.
virtual void on_session_open(event &e)
The remote peer opened the session.
virtual void on_unhandled_error(event &e, const condition &c)
Fallback error handling.
virtual void on_session_close(event &e)
The remote peer closed the session.
virtual void on_connection_close(event &e)
The remote peer closed the connection.
virtual void on_transaction_abort(event &e)
The remote peer aborted a transaction.
virtual void on_connection_open(event &e)
The remote peer opened the connection.