5 #ifndef LOG_WALKER_INVOCATION_H
6 #define LOG_WALKER_INVOCATION_H
8 #include "ace/SString.h"
9 #include "ace/CDR_Stream.h"
10 #include "ace/Unbounded_Queue.h"
17 typedef ACE_Unbounded_Queue
<ACE_CString
> NotifyIncidents
;
19 // Invocation holds the buffer contents for a request/response pair.
20 // This could be originating in this process, or in the peer process.
22 // The trigger for finding a new outgoing invocation is "Muxed_TMS[%d]"
23 // following that the process/thread will perform a dump_msg.
25 // The trigger for finding a new incoming invocation is
26 // "Transport[%d]::process_parsed_messages, entering (missing data == 0)"
27 // which could indicate a new request or reply, depending on the context
28 // in which the peer connection is made.
30 // It is possible that two or more threads may call dump_msg
31 // concurrently and thus have the preamble and body printed out of
32 // order. The HEXDUMP always reports a buffer size including the 12
33 // byte GIOP header. Also, the first line of the text contains header
34 // data which can be compared to the expected request ID.
45 // initialize a new instance, with the initial request text line and offeset
46 Invocation (PeerProcess
*peer
, Thread
*thr
, size_t req_id
= 0);
47 bool init ( const char * text
, size_t offset
, Thread
*thr
);
50 // return true if the invocation was a oneway
51 bool is_oneway() const;
53 // return true if the request is a oneway and has all its octets, or
54 // if it also has all its reply octets. The side-effect of this call
55 // is to obtain the target reference from the request buffer and associate
56 // it with the peer process.
57 bool message_complete ();
59 size_t request_id () const;
61 // returns true if this request was sent by the host process.
62 bool sent_request () const;
64 // returns the size parsed from either the request or reply preamble
65 // which can be used to match a HEXDUMP b
66 size_t expected_size () const;
68 size_t request_bytes () const;
70 void set_target (const char *oid
, size_t oid_len
);
72 void set_octets (bool request
, GIOP_Buffer
*octets
);
73 GIOP_Buffer
*octets (bool request
);
74 GIOP_Buffer
*give_octets (bool request
);
76 bool contains (size_t line
);
80 void add_notify_incident (const ACE_CString
&text
, size_t offset
);
81 Thread
*waiter () const;
84 void new_line (ostream
&strm
, size_t indent
, int offset
, bool add_nl
, bool show_indent
);
85 void dump_detail (ostream
&strm
, size_t indent
, Dump_Mode mode
, bool show_handle
);
86 void dump_rel_time (ostream
&strm
, const ACE_Time_Value
& tv
, const ACE_Time_Value
& start
);
87 void dump_start_line (ostream
&strm
, size_t indent
, const ACE_Time_Value
& start
);
88 void dump_finish_line (ostream
&strm
, size_t indent
, const ACE_Time_Value
& start
);
89 void dump_special_details (ostream
&strm
, size_t indent
, const char *opname
);
92 GIOP_Buffer
*req_octets_
;
93 GIOP_Buffer
*repl_octets_
;
96 NotifyIncidents notify_incidents_
;
101 bool finish_reported_
;
106 #endif // LOG_WALKER_INVOCATION_H