coreRuntime/src/sc/sync/SyncManager.java
public static void addSyncInst(Object inst, boolean onDemand, boolean initDefault, boolean resetState, String scopeName, SyncProperties props, Object ...args) {
      // TODO: should we use a linked-map for the sync so we can replace a previous entry for the same instance.
      // If a base class is synchronized on a different scope than the sub-class and a sync queue is enabled, this prevents
      // us from temporarily initializing the instance in the wrong scope which is not a safe thing to do
      LinkedHashSet<AddSyncInfo> syncQueue = (LinkedHashSet<AddSyncInfo>) PTypeUtil.getThreadLocal("syncAddQueue");
      if (syncQueue != null) {
         syncQueue.add(new AddSyncInfo(inst, onDemand, initDefault, resetState, scopeName, props, args));
         return;
      }

      // The compile time representation may have a defined scope but if not, we need to search up the object hierarchy for the
      // scope annotation.  If we inherit an inner object from a base class and apply a scope, we need that scope to take effect.
      if (scopeName == null)
         scopeName = DynUtil.getScopeName(inst);
      ScopeDefinition def = getScopeDefinitionByName(scopeName);
      addSyncInstInternal(inst, onDemand, initDefault, resetState, def.scopeId, props, args);
   }
/**
    * Registers a new instance for synchronization.  You should have previously registered the type of
    * object using addSyncType - to specify the properties to synchronize on this object.
    * <p>
    * This method is used often in code-generation or you can
    * call it to manually implement synchronization without code-generation.
    * <p>
    * If a scopeName is supplied as null, we look for the scopeName annotation
    * on the instance or any outer objects to find the scope where this object should be registered.
    * <p>
    * If onDemand is true, this object is not immediately serialized to the other side - instead it's only serialized
    * the first time it is fetched or referenced by another object which is serialized.
    * <p>
    * If initDefault is true, the remote side is initialized with properties from this side even with no property change
    * <p>
    * If resetState is false, this instance is not treated as resetState even if it has 'resetState' properties. Persistent
    * instances set resetState=false, transient set it to true (the default) so that resetState flags are used.
    * <p>
    * If props is null, the SyncProperties registered using addSyncType for this instances type are used to determine which properties are synchronized
    * along with any property specific options.
    * <p>
    * Any constructor args needed to rebuild the instance should be provided here and those objects must also
    * be manageable by the sync system (e.g. primitives or that have a SyncProperties registered via addSyncType).
    */
Registers a new instance for synchronization.  You should have previously registered the type of
object using addSyncType - to specify the properties to synchronize on this object.

This method is used often in code-generation or you can
call it to manually implement synchronization without code-generation.

If a scopeName is supplied as null, we look for the scopeName annotation
on the instance or any outer objects to find the scope where this object should be registered.

If onDemand is true, this object is not immediately serialized to the other side - instead it's only serialized
the first time it is fetched or referenced by another object which is serialized.

If initDefault is true, the remote side is initialized with properties from this side even with no property change

If resetState is false, this instance is not treated as resetState even if it has 'resetState' properties. Persistent
instances set resetState=false, transient set it to true (the default) so that resetState flags are used.

If props is null, the SyncProperties registered using addSyncType for this instances type are used to determine which properties are synchronized
along with any property specific options.

Any constructor args needed to rebuild the instance should be provided here and those objects must also
be manageable by the sync system .
Registers a new instance for synchronization . You should have previously registered the type of object using addSyncType - to specify the properties to synchronize on this object . This method is used often in code - generation or you can call it to manually implement synchronization without code - generation . If a scopeName is supplied as null we look for the scopeName annotation on the instance or any outer objects to find the scope where this object should be registered . If onDemand is true this object is not immediately serialized to the other side - instead it ' s only serialized the first time it is fetched or referenced by another object which is serialized . If initDefault is true the remote side is initialized with properties from this side even with no property change If resetState is false this instance is not treated as resetState even if it has ' resetState ' properties . Persistent instances set resetState = false transient set it to true ( the default ) so that resetState flags are used . If props is null the SyncProperties registered using addSyncType for this instances type are used to determine which properties are synchronized along with any property specific options . Any constructor args needed to rebuild the instance should be provided here and those objects must also be manageable by the sync system .
public static void addSyncInst(Object inst, boolean onDemand, boolean initDefault, boolean resetState, String scopeName, SyncProperties props, Object ...args) {
      LinkedHashSet<AddSyncInfo> syncQueue = (LinkedHashSet<AddSyncInfo>) PTypeUtil.getThreadLocal("syncAddQueue");
      if (syncQueue != null) {
         syncQueue.add(new AddSyncInfo(inst, onDemand, initDefault, resetState, scopeName, props, args));
         return;
      }
      if (scopeName == null)
         scopeName = DynUtil.getScopeName(inst);
      ScopeDefinition def = getScopeDefinitionByName(scopeName);
      addSyncInstInternal(inst, onDemand, initDefault, resetState, def.scopeId, props, args);
   }
public static void addSyncInst ( Object inst , boolean onDemand , boolean initDefault , boolean resetState , String scopeName , SyncProperties props , Object ... args ) { LinkedHashSet < AddSyncInfo > syncQueue = ( LinkedHashSet < AddSyncInfo > ) PTypeUtil . getThreadLocal ( "syncAddQueue" ) ; if ( syncQueue != null ) { syncQueue . add ( new AddSyncInfo ( inst , onDemand , initDefault , resetState , scopeName , props , args ) ) ; return ; } if ( scopeName == null ) scopeName = DynUtil . getScopeName ( inst ) ; ScopeDefinition def = getScopeDefinitionByName ( scopeName ) ; addSyncInstInternal ( inst , onDemand , initDefault , resetState , def . scopeId , props , args ) ; }
Registers a new instance for synchronization.
Registers a new instance for synchronization .
// TODO: should we use a linked-map for the sync so we can replace a previous entry for the same instance. // If a base class is synchronized on a different scope than the sub-class and a sync queue is enabled, this prevents // us from temporarily initializing the instance in the wrong scope which is not a safe thing to do // The compile time representation may have a defined scope but if not, we need to search up the object hierarchy for the // scope annotation.  If we inherit an inner object from a base class and apply a scope, we need that scope to take effect.