Package fish.payara.opentracing
Class OpenTracingService
- java.lang.Object
-
- fish.payara.opentracing.OpenTracingService
-
- All Implemented Interfaces:
EventListener
@Service(name="opentracing-service") public class OpenTracingService extends Object implements EventListener
Service class for the OpenTracing integration.- Author:
- Andrew Pielage
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.api.event.EventListener
EventListener.Event<T>
-
-
Field Summary
Fields Modifier and Type Field Description static String
PAYARA_CORBA_RMI_TRACER_NAME
-
Constructor Summary
Constructors Constructor Description OpenTracingService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
event(EventListener.Event<?> event)
Process a Glassfish/Payara eventString
getApplicationName(InvocationManager invocationManager)
Gets the application name from the invocation manager.String
getApplicationName(InvocationManager invocationManager, jakarta.interceptor.InvocationContext invocationContext)
Gets the application name from the invocation manager.io.opentracing.Tracer
getTracer(String applicationName)
Gets the tracer instance for the given application, or creates one if there isn't one.boolean
isEnabled()
Pass-through method that checks if Request Tracing is enabled.
-
-
-
Field Detail
-
PAYARA_CORBA_RMI_TRACER_NAME
public static final String PAYARA_CORBA_RMI_TRACER_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
event
public void event(EventListener.Event<?> event)
Description copied from interface:EventListener
Process a Glassfish/Payara event- Specified by:
event
in interfaceEventListener
-
getTracer
public io.opentracing.Tracer getTracer(String applicationName)
Gets the tracer instance for the given application, or creates one if there isn't one.- Parameters:
applicationName
- The name of the application to get or create the Tracer for- Returns:
- The Tracer instance for the given application
-
isEnabled
public boolean isEnabled()
Pass-through method that checks if Request Tracing is enabled.- Returns:
- True if the Request Tracing Service is enabled
-
getApplicationName
public String getApplicationName(InvocationManager invocationManager)
Gets the application name from the invocation manager. Failing that, it will use the module name or component name.- Parameters:
invocationManager
- The invocation manager to get the application name from- Returns:
- The application name
-
getApplicationName
public String getApplicationName(InvocationManager invocationManager, jakarta.interceptor.InvocationContext invocationContext)
Gets the application name from the invocation manager. Failing that, it will use the module name, component name, or method signature (in that order).- Parameters:
invocationManager
- The invocation manager to get the application name frominvocationContext
- The context of the current invocation- Returns:
- The application name
-
-