}
// get list of existing nodetypes
Name[] existingNts = getNodeState().getNodeTypeNames();
// build effective node type representing primary type including existing mixin's
EffectiveNodeType entExisting = session.getEffectiveNodeTypeProvider().getEffectiveNodeType(existingNts);
// check if the base type supports adding this mixin
if (!entExisting.supportsMixin(mixinName)) {
log.debug(mixin.getName() + ": not supported on node type " + primaryTypeName);
return false;
}
// check if adding new mixin conflicts with existing nodetypes
if (entExisting.includesNodeType(mixinName)) {
log.debug(mixin.getName() + ": already contained in mixin types");
return false;
}
// second, build new effective node type for nts including the new mixin