private void SendDisassociate(AssociationHandle wrappedHandle, DisassociateInfo info) { try { wrappedHandle.Write(_codec.ConstructDisassociate(info)); } catch (Exception ex) { throw new AkkaProtocolException("Error writing DISASSOCIATE to transport", ex); } }
/// <summary> /// TBD /// </summary> /// <param name="reason">TBD</param> /// <returns>TBD</returns> public override ByteString ConstructDisassociate(DisassociateInfo reason) { switch (reason) { case DisassociateInfo.Quarantined: return DISASSOCIATE_QUARANTINED; case DisassociateInfo.Shutdown: return DISASSOCIATE_SHUTTING_DOWN; case DisassociateInfo.Unknown: default: return DISASSOCIATE; } }
private Exception DisassociateException(DisassociateInfo info) { switch (info) { case DisassociateInfo.Shutdown: return(new AkkaProtocolException("The remote system refused the association because it is shutting down.")); case DisassociateInfo.Quarantined: return(new AkkaProtocolException("The remote system has quarantined this system. No further associations to the remote systems are possible until this system is restarted.")); case DisassociateInfo.Unknown: default: return(new AkkaProtocolException("The remote system explicitly disassociated (reason unknown).")); } }
public Disassociate(DisassociateInfo reason) { Reason = reason; }
public abstract ByteString ConstructDisassociate(DisassociateInfo reason);
public Disassociated(DisassociateInfo info) { Info = info; }
private IHandleEvent testDisassociate(DisassociateInfo info) { return(new InboundPayload(codec.ConstructDisassociate(info))); }
public InvalidAssociation(Address localAddress, Address remoteAddress, Exception cause = null, DisassociateInfo? disassociateInfo = null) : base(string.Format("Invalid address: {0}", remoteAddress), cause) { RemoteAddress = remoteAddress; LocalAddress = localAddress; DisassociationInfo = disassociateInfo; }
/// <summary> /// TBD /// </summary> /// <param name="failReason">TBD</param> public FailWith(DisassociateInfo failReason) { FailReason = failReason; }
private void HandleDisassociated(DisassociateInfo info) { switch (info) { case DisassociateInfo.Quarantined: throw new InvalidAssociation(LocalAddress, RemoteAddress, new InvalidAssociationException("The remote system has quarantined this system. No further associations " + "to the remote system are possible until this system is restarted.")); case DisassociateInfo.Shutdown: throw new ShutDownAssociation(LocalAddress, RemoteAddress, new InvalidAssociationException("The remote system terminated the association because it is shutting down.")); case DisassociateInfo.Unknown: default: Context.Stop(Self); break; } }
private IHandleEvent testDisassociate(DisassociateInfo info) { return new InboundPayload(codec.ConstructDisassociate(info)); }
public void Disassociate(DisassociateInfo info) { StateActor.Tell(new DisassociateUnderlying(info)); }
/// <summary> /// TBD /// </summary> /// <param name="info">TBD</param> public DisassociateUnderlying(DisassociateInfo info = DisassociateInfo.Unknown) { Info = info; }
protected override void Unhandled(object message) { if (message is Terminated) { var t = message as Terminated; if (_reader == null || t.ActorRef.Equals(_reader)) { PublishAndThrow(new EndpointDisassociatedException("Disassociated"), LogLevel.DebugLevel); } } else if (message is StopReading) { var stop = message as StopReading; if (_reader != null) { _reader.Tell(stop, stop.ReplyTo); } else { // initializing, buffer and take care of it later when buffer is sent EnqueueInBuffer(message); } } else if (message is TakeOver) { var takeover = message as TakeOver; // Shutdown old reader _handle.Disassociate(); _handle = takeover.ProtocolHandle; takeover.ReplyTo.Tell(new TookOver(Self, _handle)); Context.Become(Handoff); } else if (message is FlushAndStop) { _stopReason = DisassociateInfo.Shutdown; Context.Stop(Self); } else if (message is OutboundAck) { var ack = message as OutboundAck; _lastAck = ack.Ack; if (_ackDeadline.IsOverdue) TrySendPureAck(); } else if (message is AckIdleCheckTimer || message is FlushAndStopTimeout || message is BackoffTimer) { //ignore } else { base.Unhandled(message); } }
private void DoFlushAndStop() { //Try to send last Ack message TrySendPureAck(); _stopReason = DisassociateInfo.Shutdown; Context.Stop(Self); }
public override ByteString ConstructDisassociate(DisassociateInfo reason) { switch (reason) { case DisassociateInfo.Quarantined: return DISASSOCIATE_QUARANTINED; case DisassociateInfo.Shutdown: return DISASSOCIATE_SHUTTING_DOWN; case DisassociateInfo.Unknown: default: return DISASSOCIATE; } }
/// <summary> /// TBD /// </summary> /// <param name="reason">TBD</param> public void DisassociateWithFailure(DisassociateInfo reason) { ThrottlerActor.Tell(new ThrottledAssociation.FailWith(reason)); }
/// <summary> /// TBD /// </summary> /// <param name="address">TBD</param> /// <param name="reason">TBD</param> public ForceDisassociateExplicitly(Address address, DisassociateInfo reason) { Reason = reason; Address = address; }
/// <summary> /// TBD /// </summary> /// <param name="info">TBD</param> public Disassociated(DisassociateInfo info) { Info = info; }