Package com.yahoo.application.container
Class JDisc
- java.lang.Object
-
- com.yahoo.application.container.JDisc
-
- All Implemented Interfaces:
AutoCloseable
public final class JDisc extends Object implements AutoCloseable
A JDisc Container configured from XML.- Author:
- Tony Vaagenes, Einar M R Rosenvinge, gjoranv
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the current JDisc.com.yahoo.component.provider.ComponentRegistry<com.yahoo.component.AbstractComponent>
components()
Returns a registry of all components available in thisDocumentProcessing
documentProcessing()
Returns aDocumentProcessing
, used to process objects of typeDocument
,DocumentRemove
andDocumentUpdate
.static JDisc
fromPath(Path path, Networking networking)
Factory method to create a JDisc from an application package.static JDisc
fromPath(Path path, Networking networking, com.yahoo.config.model.ConfigModelRepo configModelRepo)
Create a jDisc instance which is given a config model repo (in which (mock) content clusters can be looked up).static JDisc
fromServicesXml(String xml, Networking networking)
Factory method to create a JDisc from an XML String.Response
handleRequest(Request request)
Handles the givenRequest
by passing it to theRequestHandler
that is bound to the request's URI.Processing
processing()
Returns aProcessing
, used to do generic asynchronous operations in a request/response API.Search
search()
Returns aSearch
, used to perform search query operations on this container.
-
-
-
Method Detail
-
fromServicesXml
public static JDisc fromServicesXml(String xml, Networking networking)
Factory method to create a JDisc 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, usefromPath(java.nio.file.Path, com.yahoo.application.Networking)
.- Parameters:
xml
- the XML configuration to use- Returns:
- a new JDisc instance
-
fromPath
public static JDisc fromPath(Path path, Networking networking)
Factory method to create a JDisc 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 usenetworking
- enabled or disabled- Returns:
- a new JDisc instance
-
fromPath
public static JDisc fromPath(Path path, Networking networking, com.yahoo.config.model.ConfigModelRepo configModelRepo)
Create a jDisc instance which is given a config model repo (in which (mock) content clusters can be looked up).
-
search
public Search search()
Returns aSearch
, used to perform search query operations on this container.- Returns:
- a Search instance
- Throws:
UnsupportedOperationException
- if this JDisc does not have search configured
-
processing
public Processing processing()
Returns aProcessing
, used to do generic asynchronous operations in a request/response API.- Returns:
- a Processing instance
- Throws:
UnsupportedOperationException
- if this JDisc does not have processing configured
-
documentProcessing
public DocumentProcessing documentProcessing()
Returns aDocumentProcessing
, used to process objects of typeDocument
,DocumentRemove
andDocumentUpdate
.- Returns:
- a DocumentProcessing instance
- Throws:
UnsupportedOperationException
- if this JDisc does not have document processing configured
-
components
public com.yahoo.component.provider.ComponentRegistry<com.yahoo.component.AbstractComponent> components()
Returns a registry of all components available in this
-
handleRequest
public Response handleRequest(Request request)
Handles the givenRequest
by passing it to theRequestHandler
that is bound to the request's URI.- Parameters:
request
- the request to process- Returns:
- a response for the given request
-
close
public void close()
Closes the current JDisc.- Specified by:
close
in interfaceAutoCloseable
-
-