@ManagedResource public class BatchMBeanExporter extends MBeanExporter implements SmartLifecycle
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_DOMAIN |
AUTODETECT_ALL, AUTODETECT_ASSEMBLER, AUTODETECT_MBEAN, AUTODETECT_NONE
REGISTRATION_FAIL_ON_EXISTING, REGISTRATION_IGNORE_EXISTING, REGISTRATION_REPLACE_EXISTING, server
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, unregisterManagedResource
doRegister, doUnregister, getRegisteredObjectNames, getServer, onRegister, setRegistrationBehavior, setRegistrationBehaviorName, setRegistrationPolicy, setServer, unregisterBeans
public 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 InitializingBean
afterPropertiesSet
in class MBeanExporter
protected void registerBeans()
registerBeans
in class MBeanExporter
protected 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 SmartLifecycle
public final void stop(Runnable callback)
stop
in interface SmartLifecycle
protected void doStop()
protected void doStart()
Copyright © 2015. All rights reserved.