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 " + getPrimaryNodeTypeName());
return false;
}
// second, build new effective node type for nts including the new mixin