Package com.yahoo.application
Class Application
- java.lang.Object
-
- com.yahoo.application.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Application.Builder
A wrapper around ApplicationBuilder that generates a services.xml
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
vespaLocalProperty
This system property is set to "true" upon creation of an Application.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Shuts down all services.static Application
fromApplicationPackage(java.io.File file, Networking networking)
Factory method to create an Application from an application package.static Application
fromApplicationPackage(java.nio.file.Path path, Networking networking)
Factory method to create an Application from an application package.static Application
fromBuilder(Application.Builder builder)
static Application
fromServicesXml(java.lang.String xml, Networking networking)
Factory method to create an Application from an XML String.JDisc
getJDisc(java.lang.String id)
-
-
-
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
-
fromBuilder
@Beta public static Application fromBuilder(Application.Builder builder) throws java.lang.Exception
- Throws:
java.lang.Exception
-
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, usefromApplicationPackage(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 interfacejava.lang.AutoCloseable
-
-