use of org.wso2.carbon.humantask.core.integration.jmx.DeployedTasks in project carbon-business-process by wso2.
the class HumanTaskServiceComponent method registerMBeans.
/**
* to register all the MBeans.
*
* @throws Exception
* @throws MBeanRegistrationException
* @throws InstanceAlreadyExistsException
* @throws NotCompliantMBeanException
*/
public void registerMBeans() throws Exception, MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException {
log.info("Registering HT related MBeans");
HTTaskStatusMonitor taskStatusMonitor = new HTTaskStatusMonitor();
DeployedTasks deployedTasks = new DeployedTasks();
MBeanRegistrar.registerMBean(taskStatusMonitor, "org.wso2.carbon.humantask.core.integration.jmx:type=HTTaskStatusMonitorMXBean");
MBeanRegistrar.registerMBean(deployedTasks, "org.wso2.carbon.humantask.core.integration.jmx:type=DeployedTasksMXBean");
log.info("MXBean for Human tasks registered successfully");
}
use of org.wso2.carbon.humantask.core.integration.jmx.DeployedTasks in project carbon-business-process by wso2.
the class DeployedTasks method getAlldeployedTasks.
public String[] getAlldeployedTasks(int tenantID) {
String[] noTask = { "No deployed task for the specified tenant" };
String[] noStore = { "No Human Tasks Store found for the given tenantID" };
HumanTaskServer humanTaskServer = HumanTaskServiceComponent.getHumanTaskServer();
HumanTaskStore humanTaskStore = humanTaskServer.getTaskStoreManager().getHumanTaskStore(tenantID);
if (humanTaskStore == null) {
return noStore;
}
List<HumanTaskBaseConfiguration> humanTaskConfigurations = humanTaskStore.getTaskConfigurations();
deployedTasks = new String[humanTaskConfigurations.size()];
for (int i = 0; i < humanTaskConfigurations.size(); i++) {
deployedTasks[i] = humanTaskConfigurations.get(i).getName() + "\t" + humanTaskConfigurations.get(i).getDefinitionName() + "\t" + humanTaskConfigurations.get(i).getOperation();
}
if (deployedTasks.length == 0) {
return noTask;
}
return deployedTasks;
}
Aggregations