public override void Shutdown(ProvisioningFlags provisioningOptions) { if (fConn != null && fConn.State != ConnectionState.Closed) { fConn.Close(); } base.Shutdown(provisioningOptions); }
/// <summary> /// Shutdown the Agent. /// </summary> /// <param name="provisioningOptions">Flag to indicate what provisioning message is sent to Zones on shut-down.</param> public override void Shutdown(ProvisioningFlags provisioningOptions) { if (this.Initialized && !this.IsShutdown) { // Always shutdown the Agent on exit. // NOTE: There is no reference to an exception in the documentation. try { base.Shutdown(ProvisioningFlags.Unprovide); if (log.IsDebugEnabled) { log.Debug("Successfully shutdown Agent " + this.Id + "."); } } catch (AdkException e) { if (log.IsErrorEnabled) { log.Error("Agent " + this.Id + " failed trying to shutdown.", e); } } } }
/// <summary> /// Shutdown the Agent. /// </summary> /// <param name="provisioningOptions">Flag to indicate what provisioning message is sent to Zones on shut-down.</param> public override void Shutdown(ProvisioningFlags provisioningOptions) { if (this.Initialized && !this.IsShutdown) { // Always shutdown the Agent on exit. // NOTE: There is no reference to an exception in the documentation. try { base.Shutdown(ProvisioningFlags.Unprovide); if (log.IsDebugEnabled) log.Debug("Successfully shutdown Agent " + this.Id + "."); } catch (AdkException e) { if (log.IsErrorEnabled) log.Error("Agent " + this.Id + " failed trying to shutdown.", e); } } }
public void Connect(ProvisioningFlags provOptions) { // TODO: Add TestZone.Connect implementation }
public void Disconnect(ProvisioningFlags flags) { // TODO: Add TestZone.Disconnect implementation }
public override void Shutdown( ProvisioningFlags provisioningOptions ) { if ( fConn != null && fConn.State != ConnectionState.Closed ) { fConn.Close(); } base.Shutdown( provisioningOptions ); }
public virtual void Shutdown(ProvisioningFlags provisioningOptions) { if (!fInit) { return; } fShutdownInProgress = true; if ((Adk.Debug & AdkDebugFlags.Lifecycle) != 0) { Log.Info("Shutting down agent..."); } // Close the SIFProfilerClient if supported #if PROFILED { // TODO: Implement Support for Profiling com.OpenADK.sifprofiler.SIFProfilerClient prof = com.OpenADK.sifprofiler.SIFProfilerClient.getInstance(ProfilerUtils.getProfilerName()); if (prof != null) { try { prof.close(); } catch (Exception ex) { } } } #endif try { // JAVA_TODO: Unsubscribe, Unprovide topics // Disconnect and shutdown each zone... IZoneFactory zf = IZoneFactory; IZone[] zones = zf.GetAllZones(); for (int i = 0; i < zones.Length; i++) { zones[i].Disconnect(provisioningOptions); ((ZoneImpl)zones[i]).Shutdown(); } if (fTransportManager != null) { // Shutdown transports if ((Adk.Debug & AdkDebugFlags.Lifecycle) != 0) { Log.Info("Shutting down Transports..."); } fTransportManager.Shutdown(); } // Close RequestCache try { RequestCache rc = RequestCache.GetInstance(this); if (rc != null) { rc.Close(); } } catch { // Do nothing } if ((Adk.Debug & AdkDebugFlags.Lifecycle) != 0) { Log.Debug("Agent shutdown complete"); } } finally { fInit = false; fShutdown = true; } }
public virtual void Shutdown( ProvisioningFlags provisioningOptions ) { if ( !fInit ) { return; } fShutdownInProgress = true; if ( (Adk.Debug & AdkDebugFlags.Lifecycle) != 0 ) { Log.Info( "Shutting down agent..." ); } // Close the SIFProfilerClient if supported #if PROFILED { // TODO: Implement Support for Profiling com.OpenADK.sifprofiler.SIFProfilerClient prof = com.OpenADK.sifprofiler.SIFProfilerClient.getInstance( ProfilerUtils.getProfilerName() ); if( prof != null ) { try { prof.close(); } catch( Exception ex ) { } } } #endif try { // JAVA_TODO: Unsubscribe, Unprovide topics // Disconnect and shutdown each zone... IZoneFactory zf = IZoneFactory; IZone[] zones = zf.GetAllZones(); for ( int i = 0; i < zones.Length; i++ ) { zones[i].Disconnect( provisioningOptions ); ((ZoneImpl) zones[i]).Shutdown(); } if ( fTransportManager != null ) { // Shutdown transports if ( (Adk.Debug & AdkDebugFlags.Lifecycle) != 0 ) { Log.Info( "Shutting down Transports..." ); } fTransportManager.Shutdown(); } // Close RequestCache try { RequestCache rc = RequestCache.GetInstance( this ); if ( rc != null ) { rc.Close(); } } catch { // Do nothing } if ( (Adk.Debug & AdkDebugFlags.Lifecycle) != 0 ) { Log.Debug( "Agent shutdown complete" ); } } finally { fInit = false; fShutdown = true; } }