closeDialoge();
if(null==entity.getShortRunning() || entity.getShortRunning().isEmpty())
{
// provide a default short running thread pool config (mandatory)
WorkmanagerPool pool = factory.WorkmanagerPool().as();
pool.setShortRunning(true);
//pool.setName("short-running-pool_" + entity.getName());
pool.setName(entity.getName());
pool.setMaxThreads(10);
pool.setQueueLength(10);
List<WorkmanagerPool> managers = new ArrayList<WorkmanagerPool>(1);
managers.add(pool);
entity.setShortRunning(managers);
}
ModelNode operation = new ModelNode();
operation.get(ADDRESS).setEmptyList();
operation.get(OP).set(COMPOSITE);
ModelNode workmanagerOp = managerAdapter.fromEntity(entity);
workmanagerOp.get(ADDRESS).set(Baseadress.get());
workmanagerOp.get(ADDRESS).add("subsystem", "jca");
workmanagerOp.get(ADDRESS).add("workmanager", entity.getName());
workmanagerOp.get(OP).set(ADD);
WorkmanagerPool pool = entity.getShortRunning().get(0);
ModelNode poolOp = poolAdapter.fromEntity(pool);
poolOp.get(ADDRESS).set(Baseadress.get());
poolOp.get(ADDRESS).add("subsystem", "jca");
poolOp.get(ADDRESS).add("workmanager", entity.getName());
poolOp.get(OP).set(ADD);
if(pool.isShortRunning())
poolOp.get(ADDRESS).add("short-running-threads", pool.getName());
else
poolOp.get(ADDRESS).add("long-running-threads", pool.getName());
List<ModelNode> steps = new ArrayList<ModelNode>(2);
steps.add(workmanagerOp);
steps.add(poolOp);