@ManagedResource
public class BatchMBeanExporter
extends org.springframework.jmx.export.MBeanExporter
implements org.springframework.context.SmartLifecycle
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_DOMAIN |
| Constructor and Description |
|---|
BatchMBeanExporter() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected void |
doStart() |
protected void |
doStop() |
protected String |
getBeanKeyForJobExecution(String jobName)
Encode the job name into an ObjectName in the form
[domain]:type=JobExecution,name=[jobName]. |
protected String |
getBeanKeyForStepExecution(String jobName,
String stepName)
Encode the job and step name into an ObjectName in the form
[domain]:type=JobExecution,name=[jobName],step=[stepName]. |
protected String |
getDefaultDomain()
Help method for extensions which need access to the default domain.
|
int |
getJobCount() |
int |
getJobExecutionCount() |
int |
getJobExecutionFailureCount() |
String[] |
getJobNames() |
int |
getPhase() |
int |
getStepCount() |
String[] |
getStepNames() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
protected void |
registerBeans() |
void |
setDefaultDomain(String domain)
The JMX domain to use for MBeans registered.
|
void |
setJobExecutionMetricsFactory(JobExecutionMetricsFactory jobExecutionMetricsFactory)
Factory for
StepExecutionMetrics. |
void |
setJobService(JobService jobService) |
void |
setObjectNameStaticProperties(Map<String,String> objectNameStaticProperties)
Static properties that will be added to all object names.
|
void |
setRegisterSteps(boolean registerSteps)
Flag to determine if any metrics at all should be exposed for step
executions (default true).
|
void |
setStepExecutionMetricsFactory(StepExecutionMetricsFactory stepExecutionMetricsFactory)
Factory for
JobExecutionMetrics. |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
adaptMBeanIfPossible, afterSingletonsInstantiated, createAndConfigureMBean, createModelMBean, destroy, getObjectName, isBeanDefinitionLazyInit, isMBean, onRegister, onUnregister, registerBeanNameOrInstance, registerManagedResource, registerManagedResource, setAllowEagerInit, setAssembler, setAutodetect, setAutodetectMode, setAutodetectModeName, setBeanClassLoader, setBeanFactory, setBeans, setEnsureUniqueRuntimeObjectNames, setExcludedBeans, setExposeManagedResourceClassLoader, setListeners, setNamingStrategy, setNotificationListenerMappings, setNotificationListeners, unregisterManagedResourcepublic static final String DEFAULT_DOMAIN
public void setRegisterSteps(boolean registerSteps)
registerSteps - the flag to setpublic void setDefaultDomain(String domain)
org.springframework.batch (which is useful in SpringSource
HQ).domain - the domain name to setprotected String getDefaultDomain()
public void setJobService(JobService jobService)
public void setObjectNameStaticProperties(Map<String,String> objectNameStaticProperties)
objectNameStaticProperties - the objectNameStaticProperties to setpublic void setStepExecutionMetricsFactory(StepExecutionMetricsFactory stepExecutionMetricsFactory)
JobExecutionMetrics. Can be used to customize and
extend the metrics exposed.stepExecutionMetricsFactory - the StepExecutionMetricsFactory to setpublic void setJobExecutionMetricsFactory(JobExecutionMetricsFactory jobExecutionMetricsFactory)
StepExecutionMetrics. Can be used to customize and
extend the metrics exposed.jobExecutionMetricsFactory - the JobExecutionMetricsFactory to setpublic void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanafterPropertiesSet in class org.springframework.jmx.export.MBeanExporterprotected void registerBeans()
registerBeans in class org.springframework.jmx.export.MBeanExporterprotected String getBeanKeyForJobExecution(String jobName)
[domain]:type=JobExecution,name=[jobName].jobName - the name of the jobprotected String getBeanKeyForStepExecution(String jobName, String stepName)
[domain]:type=JobExecution,name=[jobName],step=[stepName].jobName - the name of the jobstepName - the name of the step@ManagedMetric(metricType=COUNTER,
displayName="Step Count")
public int getStepCount()
@ManagedMetric(metricType=COUNTER,
displayName="Job Count")
public int getJobCount()
@ManagedAttribute public String[] getJobNames()
@ManagedAttribute public String[] getStepNames()
@ManagedMetric(metricType=COUNTER,
displayName="Job Execution Failure Count")
public int getJobExecutionFailureCount()
@ManagedMetric(metricType=COUNTER,
displayName="Job Execution Count")
public int getJobExecutionCount()
public final boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic final int getPhase()
getPhase in interface org.springframework.context.Phasedpublic final boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic final void start()
start in interface org.springframework.context.Lifecyclepublic final void stop()
stop in interface org.springframework.context.Lifecyclepublic final void stop(Runnable callback)
stop in interface org.springframework.context.SmartLifecycleprotected void doStop()
protected void doStart()
Copyright © 2015. All rights reserved.