internal static NativeTypes.FABRIC_CONTAINER_EVENT_TYPE ToNativeContainerEventType( ContainerEventType eventType) { switch (eventType) { case ContainerEventType.None: return(NativeTypes.FABRIC_CONTAINER_EVENT_TYPE.FABRIC_CONTAINER_EVENT_TYPE_NONE); case ContainerEventType.Stop: return(NativeTypes.FABRIC_CONTAINER_EVENT_TYPE.FABRIC_CONTAINER_EVENT_TYPE_STOP); case ContainerEventType.Die: return(NativeTypes.FABRIC_CONTAINER_EVENT_TYPE.FABRIC_CONTAINER_EVENT_TYPE_DIE); case ContainerEventType.Health: return(NativeTypes.FABRIC_CONTAINER_EVENT_TYPE.FABRIC_CONTAINER_EVENT_TYPE_HEALTH); default: var errorMessage = string.Format( CultureInfo.CurrentCulture, StringResources.Error_EnumInvalid_Formatted, eventType, "ContainerEventType"); AppTrace.TraceSource.WriteError( TraceComponent, "InteropHelpers.ToNativeContainerEventType(): " + errorMessage, eventType); throw new ArgumentException(errorMessage); } }
public ContainerExitEvent(ContainerId cID, ContainerEventType eventType, int exitCode , string diagnosticInfo) : base(cID, eventType) { this.exitCode = exitCode; this.diagnosticInfo = diagnosticInfo; }
public void OnContainerEventRaised(ContainerEventType eType, Effect cEffect) { if (null != ContainerEventRaised) { (new Logger()).WriteDebug4("shared:container:event:" + eType.ToString() + ":before [effect hc:" + cEffect.GetHashCode() + "][container hc:" + GetHashCode() + "]"); try { ContainerEventRaised(eType, cEffect); } catch (System.Net.Sockets.SocketException) { (new Logger()).WriteDebug4("shared:container:client:lost:dispose:before [effect hc:" + cEffect.GetHashCode() + "][container hc:" + GetHashCode() + "]"); Stop(); Dispose(); (new Logger()).WriteDebug4("shared:container:client:lost:dispose:after [effect hc:" + cEffect.GetHashCode() + "][container hc:" + GetHashCode() + "]"); } catch (Exception ex) { (new Logger()).WriteError(ex); } (new Logger()).WriteDebug4("shared:container:event:" + eType.ToString() + ":after [effect hc:" + cEffect.GetHashCode() + "][container hc:" + GetHashCode() + "]"); } else { (new Logger()).WriteDebug4("shared:container:event:" + eType.ToString() + ":empty [effect hc:" + cEffect.GetHashCode() + "][container hc:" + GetHashCode() + "]"); } }
private void InvokeContainerEvents(ContainerEventType containerEventType) { SharedList <ContainerEventListener> list = ((NaiveLockingList <ContainerEventListener>)DotNetNukeContext.Current.ContainerEventListeners).SharedList; using (list.GetReadLock()) { foreach (var listener in list.Where(x => x.EventType == containerEventType)) { listener.ContainerEvent.Invoke(this, new ContainerEventArgs(this)); } } }
public ContainerEventListener(ContainerEventType type, ContainerEventHandler e) { _Type = type; _ContainerEvent = e; }
private void InvokeContainerEvents(ContainerEventType containerEventType) { SharedList<ContainerEventListener> list = ((NaiveLockingList<ContainerEventListener>)DotNetNukeContext.Current.ContainerEventListeners).SharedList; using (list.GetReadLock()) { foreach (var listener in list.Where(x => x.EventType == containerEventType)) { listener.ContainerEvent.Invoke(this, new ContainerEventArgs(this)); } } }
public void OnContainerEventRaised(ContainerEventType eType, Effect cEffect) { if (null != ContainerEventRaised) { (new Logger()).WriteDebug4("shared:container:event:" + eType.ToString() + ":before [effect hc:" + cEffect.GetHashCode() + "][container hc:" + GetHashCode() + "]"); try { ContainerEventRaised(eType, cEffect); } catch (System.Net.Sockets.SocketException) { (new Logger()).WriteDebug4("shared:container:client:lost:dispose:before [effect hc:" + cEffect.GetHashCode() + "][container hc:" + GetHashCode() + "]"); Stop(); Dispose(); (new Logger()).WriteDebug4("shared:container:client:lost:dispose:after [effect hc:" + cEffect.GetHashCode() + "][container hc:" + GetHashCode() + "]"); } catch (Exception ex) { (new Logger()).WriteError(ex); } (new Logger()).WriteDebug4("shared:container:event:" + eType.ToString() + ":after [effect hc:" + cEffect.GetHashCode() + "][container hc:" + GetHashCode() + "]"); } else (new Logger()).WriteDebug4("shared:container:event:" + eType.ToString() + ":empty [effect hc:" + cEffect.GetHashCode() + "][container hc:" + GetHashCode() + "]"); }
protected abstract void ContainerCallbackTransport(ContainerEventType eType, shared.Effect cEffect);
public void ContainerCallback(ContainerEventType eType, shared.Effect cEffect) { ContainerCallbackTransport(eType, cEffect); }
public ContainerEventMatcher(ContainerId idRef, ContainerEventType type) { this.idRef = idRef; this.type = type; }
public ContainerResourceEvent(ContainerId container, ContainerEventType type, LocalResourceRequest rsrc) : base(container, type) { this.rsrc = rsrc; }