public class MongoDBComponent extends DefaultComponent implements MongoDBConnectionService
MongoClient
directly, because it's this
component which is responsible for creating and closing it.Modifier and Type | Field and Description |
---|---|
static String |
NAME |
lastModified
Constructor and Description |
---|
MongoDBComponent() |
Modifier and Type | Method and Description |
---|---|
void |
applicationStarted(ComponentContext context)
Notify the component that Nuxeo Framework finished starting all Nuxeo bundles.
|
void |
deactivate(ComponentContext context)
Deactivates the component.
|
int |
getApplicationStartedOrder()
The component notification order for
Component.applicationStarted(org.nuxeo.runtime.model.ComponentContext) . |
com.mongodb.client.MongoDatabase |
getDatabase(String id) |
Iterable<com.mongodb.client.MongoDatabase> |
getDatabases() |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
activate, getAdapter, getLastModified, registerExtension, setLastModified, setModifiedNow, start, stop, unregisterExtension
public static final String NAME
public MongoDBComponent()
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public void applicationStarted(ComponentContext context)
Component
Component.start(ComponentContext)
and
Component.stop(ComponentContext)
methodsapplicationStarted
in interface Component
public void deactivate(ComponentContext context)
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextpublic int getApplicationStartedOrder()
Component
Component.applicationStarted(org.nuxeo.runtime.model.ComponentContext)
.
Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.
getApplicationStartedOrder
in interface Component
public com.mongodb.client.MongoDatabase getDatabase(String id)
getDatabase
in interface MongoDBConnectionService
id
- the connection id to retrieve.MongoDBConnectionConfig
for the input id, or the default one if it
doesn't existpublic Iterable<com.mongodb.client.MongoDatabase> getDatabases()
getDatabases
in interface MongoDBConnectionService
Copyright © 2017 Nuxeo. All rights reserved.