|
20 | 20 |
|
21 | 21 | import jdk.jfr.*; |
22 | 22 |
|
| 23 | +/** |
| 24 | + * JFR event base class for jPOS channel operations. |
| 25 | + */ |
23 | 26 | @Category("jPOS") |
24 | 27 | @Name("jpos.Channel") |
25 | 28 | @StackTrace |
26 | 29 | public class ChannelEvent extends Event { |
27 | 30 | @Name("detail") |
| 31 | + /** Channel event detail string. */ |
28 | 32 | protected String detail; |
29 | 33 |
|
| 34 | + /** Creates a ChannelEvent with no detail. */ |
30 | 35 | public ChannelEvent() {} |
| 36 | + /** Creates a ChannelEvent with the given detail. |
| 37 | + * @param detail event detail string |
| 38 | + */ |
31 | 39 | public ChannelEvent(String detail) { |
32 | 40 | this.detail = detail; |
33 | 41 | } |
34 | 42 |
|
| 43 | + /** @param detail new detail string */ |
35 | 44 | public void setDetail(String detail) { |
36 | 45 | this.detail = detail; |
37 | 46 | } |
38 | 47 |
|
| 48 | + /** @return the event detail string */ |
39 | 49 | public String getDetail() { |
40 | 50 | return detail; |
41 | 51 | } |
42 | 52 |
|
| 53 | + /** Appends additional detail to this event. |
| 54 | + * @param additionalDetail text to append |
| 55 | + * @return this event |
| 56 | + */ |
43 | 57 | public ChannelEvent append (String additionalDetail) { |
44 | 58 | detail = detail != null ? |
45 | 59 | "%s, %s".formatted (detail, additionalDetail) : additionalDetail; |
46 | 60 | return this; |
47 | 61 | } |
48 | 62 |
|
| 63 | + /** JFR event for a channel send operation. */ |
49 | 64 | @Name("jpos.Channel.Send") |
50 | | - public static class Send extends ChannelEvent { } |
| 65 | + public static class Send extends ChannelEvent { |
| 66 | + /** Default constructor. */ |
| 67 | + public Send() { } |
| 68 | + } |
51 | 69 |
|
| 70 | + /** JFR event for a channel receive operation. */ |
52 | 71 | @Name("jpos.Channel.Receive") |
53 | | - public static class Receive extends ChannelEvent { } |
| 72 | + public static class Receive extends ChannelEvent { |
| 73 | + /** Default constructor. */ |
| 74 | + public Receive() { } |
| 75 | + } |
54 | 76 |
|
| 77 | + /** JFR event for a channel connect operation. */ |
55 | 78 | @Name("jpos.Channel.Connect") |
56 | | - public static class Connect extends ChannelEvent { } |
| 79 | + public static class Connect extends ChannelEvent { |
| 80 | + /** Default constructor. */ |
| 81 | + public Connect() { } |
| 82 | + } |
57 | 83 |
|
| 84 | + /** JFR event for a channel accept (inbound connection) operation. */ |
58 | 85 | @Name("jpos.Channel.Accept") |
59 | | - public static class Accept extends ChannelEvent { } |
| 86 | + public static class Accept extends ChannelEvent { |
| 87 | + /** Default constructor. */ |
| 88 | + public Accept() { } |
| 89 | + } |
60 | 90 |
|
| 91 | + /** JFR event for a channel disconnect operation. */ |
61 | 92 | @Name("jpos.Channel.Disconnect") |
62 | | - public static class Disconnect extends ChannelEvent { } |
| 93 | + public static class Disconnect extends ChannelEvent { |
| 94 | + /** Default constructor. */ |
| 95 | + public Disconnect() { } |
| 96 | + } |
63 | 97 |
|
| 98 | + /** JFR event for a channel connection exception. */ |
64 | 99 | @Name("jpos.Channel.ConnectionException") |
65 | 100 | public static class ConnectionException extends ChannelEvent { |
| 101 | + /** @param detail exception detail string */ |
66 | 102 | public ConnectionException(String detail) { |
67 | 103 | super(detail); |
68 | 104 | } |
69 | 105 | } |
70 | 106 |
|
| 107 | + /** JFR event for a channel accept exception. */ |
71 | 108 | @Name("jpos.Channel.AcceptException") |
72 | 109 | public static class AcceptException extends ChannelEvent { |
| 110 | + /** @param detail exception detail string */ |
73 | 111 | public AcceptException(String detail) { |
74 | 112 | super(detail); |
75 | 113 | } |
76 | 114 | } |
77 | 115 |
|
| 116 | + /** JFR event for a channel send exception. */ |
78 | 117 | @Name("jpos.Channel.SendException") |
79 | 118 | public static class SendException extends ChannelEvent { |
| 119 | + /** @param detail exception detail string */ |
80 | 120 | public SendException(String detail) { |
81 | 121 | super(detail); |
82 | 122 | } |
|
0 commit comments