Class InstrumentedTransport
java.lang.Object
jakarta.mail.Service
jakarta.mail.Transport
io.micrometer.jakarta9.instrument.mail.InstrumentedTransport
- All Implemented Interfaces:
AutoCloseable
public class InstrumentedTransport
extends jakarta.mail.Transport
Wraps a
Transport so that it is instrumented with an Observation.- Since:
- 1.16.0
-
Field Summary
Fields inherited from class jakarta.mail.Service
debug, session, url -
Constructor Summary
ConstructorsConstructorDescriptionInstrumentedTransport(jakarta.mail.Session session, jakarta.mail.Transport delegate, io.micrometer.observation.ObservationRegistry observationRegistry) Create an instrumented transport using thedefaultObservationConvention.InstrumentedTransport(jakarta.mail.Session session, jakarta.mail.Transport delegate, io.micrometer.observation.ObservationRegistry observationRegistry, @Nullable io.micrometer.observation.ObservationConvention<MailSendObservationContext> customConvention) Create an instrumented transport with a customconvention. -
Method Summary
Methods inherited from class jakarta.mail.Transport
addTransportListener, notifyTransportListeners, removeTransportListener, send, send, send, sendMethods inherited from class jakarta.mail.Service
addConnectionListener, connect, connect, connect, finalize, getURLName, isConnected, notifyConnectionListeners, protocolConnect, queueEvent, removeConnectionListener, setConnected, setURLName, toString
-
Constructor Details
-
InstrumentedTransport
public InstrumentedTransport(jakarta.mail.Session session, jakarta.mail.Transport delegate, io.micrometer.observation.ObservationRegistry observationRegistry) Create an instrumented transport using thedefaultObservationConvention.- Parameters:
session- session for the delegate transportdelegate- transport to instrumentobservationRegistry- registry for the observations
-
InstrumentedTransport
public InstrumentedTransport(jakarta.mail.Session session, jakarta.mail.Transport delegate, io.micrometer.observation.ObservationRegistry observationRegistry, @Nullable io.micrometer.observation.ObservationConvention<MailSendObservationContext> customConvention) Create an instrumented transport with a customconvention.- Parameters:
session- session for the delegate transportdelegate- transport to instrumentobservationRegistry- registry for the observationscustomConvention- override the convention to apply to the instrumentation
-
-
Method Details
-
connect
public void connect(String host, int port, String user, String password) throws jakarta.mail.MessagingException - Overrides:
connectin classjakarta.mail.Service- Throws:
jakarta.mail.MessagingException
-
sendMessage
public void sendMessage(jakarta.mail.Message msg, jakarta.mail.Address[] addresses) throws jakarta.mail.MessagingException - Specified by:
sendMessagein classjakarta.mail.Transport- Throws:
jakarta.mail.MessagingException
-
close
public void close() throws jakarta.mail.MessagingException- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classjakarta.mail.Service- Throws:
jakarta.mail.MessagingException
-