@Observer(ResourceManager.RESOURCE_CREATED_EVENT)
public void updateNavWithNewResource(ResourceType typeOfNewResource, Resource parentResource)
{
log.trace("Resource of type [" + typeOfNewResource + "] added beneath Resource [" + parentResource
+ "] - updating nav tree...");
JONTreeNode parentResourceNode = findNode(getResourcePath(parentResource));
JONTreeNode resourceTypeNode = findNodeByResourceTypeAndParent(typeOfNewResource, parentResourceNode);
if (resourceTypeNode == null)
{
// the resource type node doesn't exist yet, so lets refresh its parent to give it a chance
// to be generated. This would be the case for non-singleton resource types which started off
// with no children and can't have resource added directly to them, e.g. Embedded EJB deployments.
parentResourceNode.reInitializeChildrenMap();
}
else
{
resourceTypeNode.reInitializeChildrenMap();
}
}