/// <exception cref="System.Exception"></exception> public virtual void SetUp() { _peerA = new TransientReplicationProvider(new byte[] { 0 }, "A"); _peerB = new TransientReplicationProvider(new byte[] { 1 }, "B"); ReplicationReflector reflector = new ReplicationReflector(_peerA, _peerB, null); _peerA.ReplicationReflector(reflector); _peerB.ReplicationReflector(reflector); }
/// <exception cref="System.Exception"></exception> private void OpenBoth() { A().Open(); B().Open(); _reflector = new Db4objects.Drs.Inside.ReplicationReflector(A().Provider(), B().Provider (), _fixtures.reflector); A().Provider().ReplicationReflector(_reflector); B().Provider().ReplicationReflector(_reflector); }
public GenericReplicationSession(IReplicationProvider providerA, IReplicationProvider providerB, IReplicationEventListener listener, IReflector reflector) { //null means bidirectional replication. _reflector = new ReplicationReflector(providerA, providerB, reflector); _collectionHandler = new CollectionHandlerImpl(_reflector); _traverser = new GenericTraverser(_reflector, _collectionHandler); _providerA = (IReplicationProviderInside)providerA; _providerB = (IReplicationProviderInside)providerB; _listener = listener; RunIsolated(new _IBlock4_73(this)); }
public GenericReplicationSession(IReplicationProvider providerA, IReplicationProvider providerB, IReplicationEventListener listener, IReflector reflector) { //null means bidirectional replication. _reflector = new ReplicationReflector(providerA, providerB, reflector); _collectionHandler = new CollectionHandlerImpl(_reflector); _traverser = new GenericTraverser(_reflector, _collectionHandler); _providerA = (IReplicationProviderInside)providerA; _providerB = (IReplicationProviderInside)providerB; _listener = listener; RunIsolated(new _IBlock4_73(this)); }
/// <summary> /// Begins a replication session between two ReplicationProviders using a /// ReplicationEventListener and with a Reflector provided. /// </summary> /// <remarks> /// Begins a replication session between two ReplicationProviders using a /// ReplicationEventListener and with a Reflector provided. /// </remarks> /// <exception cref="ReplicationConflictException">when conflicts occur</exception> /// <seealso cref="IReplicationEventListener">IReplicationEventListener</seealso> public static IReplicationSession Begin(IReplicationProvider providerFrom, IReplicationProvider providerTo, IReplicationEventListener listener, IReflector reflector) { if (listener == null) { listener = new DefaultReplicationEventListener(); } ReplicationReflector rr = new ReplicationReflector(providerFrom, providerTo, reflector ); providerFrom.ReplicationReflector(rr); providerTo.ReplicationReflector(rr); return new GenericReplicationSession(providerFrom, providerTo, listener, reflector ); }
public GenericReplicationSession(IReplicationProvider providerA, IReplicationProvider providerB, IReplicationEventListener listener, IReflector reflector) { //null means bidirectional replication. _reflector = new ReplicationReflector(providerA, providerB, reflector); _collectionHandler = new CollectionHandlerImpl(_reflector); _traverser = new GenericTraverser(_reflector, _collectionHandler); _providerA = (IReplicationProviderInside)providerA; _providerB = (IReplicationProviderInside)providerB; _listener = listener; _providerA.StartReplicationTransaction(_providerB.GetSignature()); _providerB.StartReplicationTransaction(_providerA.GetSignature()); long syncedTimeStamp = Math.Max(_providerA.TimeStamps().Commit(), _providerB.TimeStamps ().Commit()); _providerA.SyncCommitTimestamp(syncedTimeStamp); _providerB.SyncCommitTimestamp(syncedTimeStamp); }
public GenericReplicationSession(IReplicationProvider providerA, IReplicationProvider providerB, IReplicationEventListener listener, IReflector reflector) { //null means bidirectional replication. _reflector = new ReplicationReflector(providerA, providerB, reflector); _collectionHandler = new CollectionHandlerImpl(_reflector); _traverser = new GenericTraverser(_reflector, _collectionHandler); _providerA = (IReplicationProviderInside)providerA; _providerB = (IReplicationProviderInside)providerB; _listener = listener; _providerA.StartReplicationTransaction(_providerB.GetSignature()); _providerB.StartReplicationTransaction(_providerA.GetSignature()); long syncedTimeStamp = Math.Max(_providerA.TimeStamps().Commit(), _providerB.TimeStamps ().Commit()); _providerA.SyncCommitTimestamp(syncedTimeStamp); _providerB.SyncCommitTimestamp(syncedTimeStamp); }
internal InstanceReplicationPreparer(IReplicationProviderInside providerA, IReplicationProviderInside providerB, IReplicationProvider directionTo, IReplicationEventListener listener , bool isReplicatingOnlyDeletions, HashSet4 uuidsProcessedInSession, ITraverser traverser, ReplicationReflector reflector, Db4objects.Drs.Inside.ICollectionHandler collectionHandler) { _event = new ReplicationEventImpl(); _stateInA = _event._stateInProviderA; _stateInB = _event._stateInProviderB; _providerA = providerA; _providerB = providerB; _directionTo = directionTo; _listener = listener; _isReplicatingOnlyDeletions = isReplicatingOnlyDeletions; _uuidsProcessedInSession = uuidsProcessedInSession; _traverser = traverser; _reflector = reflector; _collectionHandler = collectionHandler; }
internal InstanceReplicationPreparer(IReplicationProviderInside providerA, IReplicationProviderInside providerB, IReplicationProvider directionTo, IReplicationEventListener listener , bool isReplicatingOnlyDeletions, long lastReplicationVersion, HashSet4 uuidsProcessedInSession , ITraverser traverser, ReplicationReflector reflector, Db4objects.Drs.Inside.ICollectionHandler collectionHandler) { _event = new ReplicationEventImpl(); _stateInA = _event._stateInProviderA; _stateInB = _event._stateInProviderB; _providerA = providerA; _providerB = providerB; _directionTo = directionTo; _listener = listener; _isReplicatingOnlyDeletions = isReplicatingOnlyDeletions; _lastReplicationVersion = lastReplicationVersion; _uuidsProcessedInSession = uuidsProcessedInSession; _traverser = traverser; _reflector = reflector; _collectionHandler = collectionHandler; }
internal static bool IsBuiltinCollectionClass(ReplicationReflector reflector, IReflectClass claxx) { Type type = NetReflector.ToNative(claxx); if (Contains(_nonGeneric, type)) { return(true); } if (!type.IsGenericType) { return(false); } if (Contains(_generic, type.GetGenericTypeDefinition())) { return(true); } return(false); }
public CollectionHandlerImpl(ReplicationReflector reflector) { _mapHandler = new MapHandler(reflector); _reflector = reflector; }
public MapHandler(ReplicationReflector reflector) { _reflector = reflector; _reflectMapClass = reflector.ForClass(typeof(IDictionary)); }
public MapHandler(ReplicationReflector reflector) { _reflector = reflector; _reflectMapClass = reflector.ForClass(typeof(IDictionary)); }
public virtual void ReplicationReflector(Db4objects.Drs.Inside.ReplicationReflector replicationReflector) { }
public MyTraverser(TransientReplicationProvider _enclosing, ReplicationReflector reflector, Db4objects.Drs.Inside.ICollectionHandler collectionHandler) { this._enclosing = _enclosing; this._delegate = new GenericTraverser(reflector, collectionHandler); }
/// <exception cref="System.Exception"></exception> private void OpenBoth() { A().Open(); B().Open(); _reflector = new Db4objects.Drs.Inside.ReplicationReflector(A().Provider(), B().Provider (), _fixtures.reflector); A().Provider().ReplicationReflector(_reflector); B().Provider().ReplicationReflector(_reflector); }
public virtual void ReplicationReflector(ReplicationReflector replicationReflector ) { Db4objects.Drs.Inside.ICollectionHandler _collectionHandler = new CollectionHandlerImpl (replicationReflector); _traverser = new TransientReplicationProvider.MyTraverser(this, replicationReflector , _collectionHandler); }
public CollectionHandlerImpl(ReplicationReflector reflector) { _mapHandler = new MapHandler(reflector); _reflector = reflector; }
public GenericTraverser(ReplicationReflector reflector, ICollectionTraverser collectionHandler ) { _reflector = reflector; _collectionHandler = collectionHandler; }