Package org.jolokia.server.core.detector
Interface ServerDetector
- All Superinterfaces:
Comparable<ServerDetector>,JolokiaService<ServerDetector>
A detector identifies a specific server. This is typically done by inspecting
the runtime environment e.g. for the existence of certain classes. If a detector
successfully detect 'its' server, it return a
ServerHandle containing type, version
and some optional information. For the early detection of a server by the JVM agent,
jvmAgentStartup(Instrumentation) can be used. Using these methods is useful in case
the server is using its own class loaders to load components used by Jolokia (e.g jmx, Java logging
which is indirectly required by the sun.net.httpserver).- Since:
- 05.11.10
- Author:
- roland
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jolokia.server.core.service.api.JolokiaService
JolokiaService.Init -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondetect(MBeanServerAccess pMBeanServerAccess) Detect the server.Add MBeanServers dedicated specifically on the identified platform.getName()Name of the detector which should reflect the server to be detectedintgetOrder()Order of the service.getRequestInterceptor(MBeanServerAccess pMBeanServerAccess) Get an request interceptor to add for dealing with server specific workarounds or behaviourdefault Class<ServerDetector>getType()The service type which is used to distinguish the various services.voidInitialize with detector specific configuration.voidjvmAgentStartup(Instrumentation instrumentation) Notify detector that the JVM is about to start.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.jolokia.server.core.service.api.JolokiaService
destroy, init
-
Field Details
-
FALLBACK
-
-
Method Details
-
getType
Description copied from interface:JolokiaServiceThe service type which is used to distinguish the various services. The service type is an extension of this base interface and add service specific methods to it- Specified by:
getTypein interfaceJolokiaService<ServerDetector>- Returns:
- service type
-
getName
String getName()Name of the detector which should reflect the server to be detected- Returns:
- server name
-
init
Initialize with detector specific configuration.- Parameters:
pConfig- configuration which is key based map. Can be null if there is no configuration at all.
-
detect
Detect the server. AServerHandledescriptor is returned in case of a successful detection,nullotherwise.- Parameters:
pMBeanServerAccess- a set of MBeanServers which can be used for detecting server informations- Returns:
- the server descriptor or
nullit this implementation cant detect 'its' server.
-
getMBeanServers
Set<MBeanServerConnection> getMBeanServers()Add MBeanServers dedicated specifically on the identified platform. This method must be overridden by any platform wanting to add MBeanServers. By default this method does nothing.- Returns:
- mbean servers which are specific for this server or null if none apply
-
getRequestInterceptor
Get an request interceptor to add for dealing with server specific workarounds or behaviour- Parameters:
pMBeanServerAccess- for accessing the JMX subsystem- Returns:
- a request interceptor to apply for this server or
nullif none is necessary.
-
getOrder
int getOrder()Order of the service. The higher the number, the later in the list of services this service appears. Default order is 100.- Specified by:
getOrderin interfaceJolokiaService<ServerDetector>- Returns:
- the order of this service
-
jvmAgentStartup
Notify detector that the JVM is about to start. A detector can, if needed, block and wait for some condition but should ultimatevely return at some point or throw an exception. This notification is executed in a very early stage (premain of the Jolokia JVM agent) before the main class of the Server is executed.- Parameters:
instrumentation- the Instrumentation implementation
-