Class Application

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    @Beta
    public final class Application
    extends java.lang.Object
    implements java.lang.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 Detail

      • vespaLocalProperty

        public static final java.lang.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:
        Constant Field Values
    • Method Detail

      • fromServicesXml

        public static Application fromServicesXml​(java.lang.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​(java.nio.file.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​(java.io.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​(java.lang.String id)
        Parameters:
        id - from the jdisc element in services xml. Default id in services.xml is "jdisc"
      • close

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