Class Application

java.lang.Object
com.yahoo.application.Application
All Implemented Interfaces:
AutoCloseable

public final class Application extends Object implements AutoCloseable
Contains one or more containers built from services.xml. Other services present in the services.xml file might be mocked in future versions. Currently, only a single top level JDisc Container is allowed. Other clusters are ignored.
Author:
Tony Vaagenes
  • Field Details

    • vespaLocalProperty

      public static final String vespaLocalProperty
      This system property is set to "true" upon creation of an Application. This is useful for components which are created by dependency injection which needs to modify their behavior to function without reliance on any processes outside the JVM.
      See Also:
  • Method Details

    • fromBuilder

      public static Application fromBuilder(Application.Builder builder) throws Exception
      Throws:
      Exception
    • fromServicesXml

      public static Application fromServicesXml(String xml, Networking networking)
      Factory method to create an Application from an XML String. Note that any components that are referenced in the XML must be present on the classpath. To deploy OSGi bundles in memory, use fromApplicationPackage(Path, Networking).
      Parameters:
      xml - the XML configuration to use
      Returns:
      a new JDisc instance
    • fromApplicationPackage

      public static Application fromApplicationPackage(Path path, Networking networking)
      Factory method to create an Application from an application package. This method allows deploying OSGi bundles(contained in the components subdirectory). All the OSGi bundles will share the same class loader.
      Parameters:
      path - the reference to the application package to use
      Returns:
      a new JDisc instance
    • fromApplicationPackage

      public static Application fromApplicationPackage(File file, Networking networking)
      Factory method to create an Application from an application package. This method allows deploying OSGi bundles(contained in the components subdirectory). All the OSGi bundles will share the same class loader.
      Parameters:
      file - the reference to the application package to use
      Returns:
      a new JDisc instance
    • getJDisc

      public JDisc getJDisc(String id)
      Parameters:
      id - from the jdisc element in services xml. Default id in services.xml is "jdisc"
    • getCompiledQueryProfileRegistry

      public com.yahoo.search.query.profile.compiled.CompiledQueryProfileRegistry getCompiledQueryProfileRegistry()
    • close

      public void close()
      Shuts down all services.
      Specified by:
      close in interface AutoCloseable