Package com.yahoo.application.container
Class JDisc
java.lang.Object
com.yahoo.application.container.JDisc
- All Implemented Interfaces:
AutoCloseable
A JDisc Container configured from XML.
- Author:
- Tony Vaagenes, Einar M R Rosenvinge, gjoranv
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the current JDisc.com.yahoo.component.provider.ComponentRegistry<com.yahoo.component.AbstractComponent>Returns a registry of all components available in thisReturns aDocumentProcessing, used to process objects of typeDocument,DocumentRemoveandDocumentUpdate.static JDiscfromPath(Path path, Networking networking) Factory method to create a JDisc from an application package.static JDiscfromPath(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 JDiscfromServicesXml(String xml, Networking networking) Factory method to create a JDisc from an XML String.handleRequest(Request request) Handles the givenRequestby passing it to theRequestHandlerthat is bound to the request's URI.com.yahoo.component.provider.ComponentRegistry<com.yahoo.jdisc.handler.RequestHandler>handlers()Returns aProcessing, used to do generic asynchronous operations in a request/response API.search()Returns aSearch, used to perform search query operations on this container.
-
Method Details
-
fromServicesXml
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
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
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
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
Returns aDocumentProcessing, used to process objects of typeDocument,DocumentRemoveandDocumentUpdate.- 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 -
handlers
public com.yahoo.component.provider.ComponentRegistry<com.yahoo.jdisc.handler.RequestHandler> handlers()- Returns:
- registry of all request handlers configured
-
handleRequest
Handles the givenRequestby passing it to theRequestHandlerthat 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:
closein interfaceAutoCloseable
-