Package javax.servlet.sip.ar.spi

Examples of javax.servlet.sip.ar.spi.SipApplicationRouterProvider


public class ApplicationRouterLoader
{
  @SuppressWarnings("unchecked")
  public static SipApplicationRouter loadApplicationRouter()
  {
    SipApplicationRouterProvider provider = null;
   
    String providerClass = System.getProperty(SipApplicationRouterProvider.class.getName());
    try
    {
      if (providerClass != null)
      {
        Class clazz = Loader.loadClass(Server.class, providerClass);
        provider = (SipApplicationRouterProvider) clazz.newInstance();
      }
    }
    catch (Exception e)
    {
      throw new IllegalStateException("Could not load SipApplicationRouterProvider class: " + providerClass, e);
    }
   
    if (provider == null)
    {
       Iterator it = Service.providers(SipApplicationRouterProvider.class);
       if (it.hasNext())
         provider = (SipApplicationRouterProvider) it.next();
    }
   
    if (provider != null)
      return provider.getSipApplicationRouter();
    else
      throw new IllegalStateException("Could not find any application router provider");
  }
View Full Code Here

TOP

Related Classes of javax.servlet.sip.ar.spi.SipApplicationRouterProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.