registerMBean(mBeanServer, processorMBeanName, processorDetail);
// check if the processor holds Mailets and Matchers
if (processor instanceof MailetContainer) {
MailetContainer container = (MailetContainer) processor;
List<Mailet> mailets = container.getMailets();
for (int i = 0; i < mailets.size(); i++) {
MailetManagement mailetManagement;
Mailet mailet = mailets.get(i);
// check if the mailet is an instance of MailetManagement. If not create a wrapper around it. This will give us not all
// statistics but at least a few of them
if (mailet instanceof MailetManagement) {
mailetManagement = (MailetManagement) mailet;
} else {
mailetManagement = new MailetManagement(mailet);
}
String mailetMBeanName = processorMBeanName + ",subtype=mailet,index=" + (i+1) + ",mailetname=" + mailetManagement.getMailetName();
registerMBean(mBeanServer, mailetMBeanName, mailetManagement);
}
List<Matcher> matchers = container.getMatchers();
for (int i = 0; i < matchers.size(); i++) {
MatcherManagement matcherManagement;
Matcher matcher = matchers.get(i);
// check if the matcher is an instance of MatcherManagement. If not create a wrapper around it. This will give us not all