if ( ! h.isTraitOrTraitable() ) { throw new IllegalStateException( "A traited working memory element is being used with a default fact handle. " + "Please verify that its class was declared as @Traitable : " + core.getClass().getName() );
public static DisconnectedFactHandle newFrom( FactHandle handle ) { if( handle instanceof DisconnectedFactHandle ) { return (DisconnectedFactHandle) handle; } else { InternalFactHandle ifh = (InternalFactHandle) handle; return new DisconnectedFactHandle(ifh.getId(), ifh.getIdentityHashCode(), ifh.getObjectHashCode(), ifh.getRecency(), ifh.getEntryPoint() != null ? ifh.getEntryPoint().getEntryPointId() : null, null, ifh.isValid(), ifh.isTraitOrTraitable() ); } }
public void assertObject(final InternalFactHandle handle, final PropagationContext context, final ObjectTypeConf objectTypeConf, final InternalWorkingMemory workingMemory) { // checks if shadow is enabled if ( objectTypeConf.isShadowEnabled() ) { // the user has implemented the ShadowProxy interface, let their implementation // know it is safe to update the information the engine can see. ((ShadowProxy) handle.getObject()).updateProxy(); } if ( objectTypeConf.isTraitTMSEnabled() ) { if ( handle.isTraitOrTraitable() && handle.isTraitable() ) { TraitFieldTMS tms = ( (TraitableBean) handle.getObject() )._getFieldTMS(); if ( tms.needsInit() ) { tms.init( workingMemory ); } } } ObjectTypeNode[] cachedNodes = objectTypeConf.getObjectTypeNodes(); for ( int i = 0, length = cachedNodes.length; i < length; i++ ) { cachedNodes[i].assertObject( handle, context, workingMemory ); } }
if ( handle.isTraitOrTraitable() && handle.getObject() instanceof TraitProxy ) { ((TraitableBean) ( (TraitProxy) handle.getObject() ).getObject()).removeTrait( ( (TraitProxy) handle.getObject() ).getTypeCode() );
modifiedClass, this.activation ); if ( h.isTraitOrTraitable() ) { if ( h.isTraitable() ) {
if ( handle.isTraitOrTraitable() && handle.isTraitable() ) { TraitFieldTMS tms = ( (TraitableBean) handle.getObject() )._getFieldTMS(); if ( tms.needsInit() ) {