use of org.apache.openejb.api.jmx.ManagedAttribute in project tomee by apache.
the class JMXDeployer method getDeployedApplications.
@ManagedAttribute
@Description("List available applications")
public String[] getDeployedApplications() {
try {
final Collection<AppInfo> apps = deployer().getDeployedApps();
final String[] appsNames = new String[apps.size()];
int i = 0;
for (final AppInfo info : apps) {
appsNames[i++] = info.path;
}
return appsNames;
} catch (final Exception e) {
return new String[] { "ERR:" + e.getMessage() };
}
}
use of org.apache.openejb.api.jmx.ManagedAttribute in project tomee by apache.
the class JMXContainer method getManagedBeans.
@ManagedAttribute
@Description("Container managed beans.")
public String[] getManagedBeans() {
final BeanContext[] beans = container.getBeanContexts();
final String[] beanNames = new String[beans.length];
int i = 0;
for (final BeanContext bc : beans) {
beanNames[i++] = new StringBuilder("bean-class: ").append(bc.getBeanClass().getName()).append(", ").append("ejb-name: ").append(bc.getEjbName()).append(", ").append("deployment-id: ").append(bc.getDeploymentID()).append(", ").toString();
}
return beanNames;
}
Aggregations