Package io.hekate.core.jmx
Class JmxServiceFactory
- java.lang.Object
-
- io.hekate.core.jmx.JmxServiceFactory
-
- All Implemented Interfaces:
ServiceFactory<JmxService>
public class JmxServiceFactory extends Object implements ServiceFactory<JmxService>
Factory forJmxService
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_DOMAIN
Default value ("io.hekate") forsetDomain(String)
.
-
Constructor Summary
Constructors Constructor Description JmxServiceFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JmxService
createService()
Constructs a new service instance based on the configuration options of this factory.String
getDomain()
Returns the JMX domain (seesetDomain(String)
).MBeanServer
getServer()
Returns the MBean server (seeMBeanServer
).void
setDomain(String domain)
Sets the JMX domain.void
setServer(MBeanServer server)
Sets the MBean server that should be used by theJmxService
to register JMX beans.String
toString()
JmxServiceFactory
withDomain(String domain)
Fluent-style version ofsetDomain(String)
.JmxServiceFactory
withServer(MBeanServer server)
Fluent-style version ofsetServer(MBeanServer)
.
-
-
-
Field Detail
-
DEFAULT_DOMAIN
public static final String DEFAULT_DOMAIN
Default value ("io.hekate") forsetDomain(String)
.- See Also:
- Constant Field Values
-
-
Method Detail
-
createService
public JmxService createService()
Description copied from interface:ServiceFactory
Constructs a new service instance based on the configuration options of this factory.- Specified by:
createService
in interfaceServiceFactory<JmxService>
- Returns:
- New service instance.
-
getDomain
public String getDomain()
Returns the JMX domain (seesetDomain(String)
).- Returns:
- JMX domain.
-
setDomain
public void setDomain(String domain)
Sets the JMX domain.Value of this parameter is used as a JMX domain name when constructing
ObjectName
s for JMX components.Default value of this parameter is "io.hekate".
- Parameters:
domain
- JMX domain.
-
withDomain
public JmxServiceFactory withDomain(String domain)
Fluent-style version ofsetDomain(String)
.- Parameters:
domain
- JMX domain.- Returns:
- This instance. T
-
getServer
public MBeanServer getServer()
Returns the MBean server (seeMBeanServer
).- Returns:
- MBean server.
-
setServer
public void setServer(MBeanServer server)
Sets the MBean server that should be used by theJmxService
to register JMX beans.This parameter is optional and if not specified then the
ManagementFactory.getPlatformMBeanServer()
will be used by default.- Parameters:
server
- MBean server.
-
withServer
public JmxServiceFactory withServer(MBeanServer server)
Fluent-style version ofsetServer(MBeanServer)
.- Parameters:
server
- MBean server.- Returns:
- This instance.
-
-