Controller controller = kernel.getController();
Set notInstalled = new HashSet(controller.getNotInstalled());
if (notInstalled.isEmpty()) return true;
for (Iterator i = notInstalled.iterator(); i.hasNext();)
{
KernelControllerContext context = (KernelControllerContext) i.next();
if (context.getState().equals(context.getRequiredState()))
i.remove();
}
if (notInstalled.isEmpty()) return true;
HashSet errors = new HashSet();
HashSet incomplete = new HashSet();
for (Iterator i = notInstalled.iterator(); i.hasNext();)
{
KernelControllerContext ctx = (KernelControllerContext) i.next();
if (ctx.getState().equals(ControllerState.ERROR))
errors.add(ctx);
else
incomplete.add(ctx);
}
if (errors.size() != 0)
{
log.error("*** DEPLOYMENTS IN ERROR:\n");
for (Iterator i = errors.iterator(); i.hasNext();)
{
KernelControllerContext ctx = (KernelControllerContext) i.next();
log.error("Failed deployment: " + ctx.getName(), ctx.getError());
}
}
if (incomplete.size() != 0)
{
JBossStringBuilder buffer = new JBossStringBuilder();
buffer.append("\n*** DEPLOYMENTS MISSING DEPENDENCIES:\n");
for (Iterator i = incomplete.iterator(); i.hasNext();)
{
KernelControllerContext ctx = (KernelControllerContext) i.next();
buffer.append(ctx.getName()).append(" depends on: \n");
DependencyInfo dependsInfo = ctx.getDependencyInfo();
Set depends = dependsInfo.getIDependOn(null);
for (Iterator j = depends.iterator(); j.hasNext();)
{
DependencyItem item = (DependencyItem) j.next();
buffer.append(" ").append(item.getIDependOn()).append("'{").append(item.getWhenRequired().getStateString());
buffer.append(':");
ControllerContext other = controller.getContext(item.getIDependOn(), null);
if (other == null)
buffer.append("NOT FOUND");
else
buffer.append(other.getState().getStateString());
buffer.append('}");
if (j.hasNext())
buffer.append("\n");
}
buffer.append('\n");
}
log.error(buffer.toString());
}
if (errors.size() > 0 || incomplete.size() > 0)
{
return false;
}
return true;