Esempio n. 1
0
  public ClassObjectTypeConf(
      final EntryPointId entryPoint, final Class<?> clazz, final InternalKnowledgeBase kBase) {
    this.cls =
        (Activation.class.isAssignableFrom(clazz))
            ? ClassObjectType.Match_ObjectType.getClassType()
            : clazz;
    this.kBase = kBase;
    this.entryPoint = entryPoint;

    this.typeDecl = kBase.getTypeDeclaration(clazz);
    isEvent = typeDecl != null && typeDecl.getRole() == Role.Type.EVENT;
    if (isEvent) {
      expirationOffset = typeDecl.getExpirationOffset();
    }

    isTrait = determineTraitStatus();

    this.objectType =
        kBase
            .getClassFieldAccessorCache()
            .getClassObjectType(new ClassObjectType(clazz, isEvent), false);

    this.concreteObjectTypeNode = kBase.getRete().getObjectTypeNodes(entryPoint).get(objectType);

    this.supportsPropertyListeners = checkPropertyListenerSupport(clazz);

    Traitable ttbl = cls.getAnnotation(Traitable.class);
    this.traitTmsEnabled = ttbl != null && ttbl.logical();
  }