Results 1 to 4 of 4

Thread: Life cycle diagram for Application

  1. #1

    Default Life cycle diagram for Application

    Hi,

    Application life cycle isn't documented.
    For example, when an instance is created, destroyed...


    Thanks

  2. #2
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    An application instance is created when a client connects to it (encoder or playback clients) or when a Wowza process, typically a ServerListener or StartUpStreams, starts a stream on an application/instance. The application instance is unload 60 seconds after the last client disconnect and there is no server-side process keeping it loaded. I'm not sure if/where that is exactly documented.

    Richard

  3. #3

    Default

    Ok.

    1. What will happen to all published stream if application is unloaded?
    Do we need to republish all the streams?
    (Assume streams are published by API method)

    2. What do you mean by server process?

    Assume there are no clients' connections.
    This example will keep it loaded?
    Or an application will be unloaded after 60 seconds.

    An example from your previous answer.
    http://www.wowza.com/forums/showthre...server-startup

    package com.wowza.wms.example.serverlistener;
    
    import com.wowza.wms.application.IApplication;
    import com.wowza.wms.logging.*;
    import com.wowza.wms.server.*;
    import com.wowza.wms.vhost.IVHost;
    import com.wowza.wms.vhost.VHost;
    import com.wowza.wms.vhost.VHostSingleton;
    
    public class ServerListenerStartupApp implements IServerNotify2 {
    
    	public void onServerConfigLoaded(IServer server) {
    		WMSLoggerFactory.getLogger(null).info("onServerConfigLoaded");
    	}
    
    	public void onServerCreate(IServer server) {
    		WMSLoggerFactory.getLogger(null).info("onServerCreate");
    	}
    
    	public void onServerInit(IServer server) {
    		WMSLoggerFactory.getLogger(null).info("onServerInit");
    		IVHost vhost = VHostSingleton.getInstance(VHost.VHOST_DEFAULT);
    		IApplication app = vhost.getApplication("live");
    		app.getAppInstance("_definst_");
    		
    	}
    
    	public void onServerShutdownStart(IServer server) {
    		WMSLoggerFactory.getLogger(null).info("onServerShutdownStart");
    	}
    
    	public void onServerShutdownComplete(IServer server) {
    		WMSLoggerFactory.getLogger(null).info("onServerShutdownComplete");
    	}
    
    }
    Last edited by sam.shm; 05-23-2014 at 09:38 AM.

  4. #4

    Default

    Hi,

    In this example, the application instance will load when the server starts and will unload after the last players have disconnected for at least 60 secs and there are no other streams running.

    By other streams, I am meaning streams started with the Publishing or Streams apis or remote streams started with the mediaCaster apis or withe the stream manager or Startup Streams.

    There is one thing to note and for the application instance to be able to shut down after the timeout, there has to have been at least one client connection (any protocol) to trigger the beginning or the timeout process. Otherwise, you will have to manually shutdown the application instance.

    Roger.

Similar Threads

  1. Wowza Media Life Cycle
    By keomamoek in forum Server-side Modules and Code Samples Discussion
    Replies: 1
    Last Post: 02-25-2013, 04:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •