public class DataSourceComponent extends DefaultComponent
For now only the internal Nuxeo JNDI server is supported.
Modifier and Type | Field and Description |
---|---|
protected Map<String,DataSourceDescriptor> |
datasources |
static String |
DATASOURCES_XP |
static String |
ENV_CTX_NAME |
protected Map<String,DataSourceLinkDescriptor> |
links |
protected Context |
namingContext |
protected PooledDataSourceRegistry |
poolRegistry |
protected DatasourceExceptionSorter.Registry |
sorterRegistry |
lastModified
Constructor and Description |
---|
DataSourceComponent() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
protected void |
addDataSource(DataSourceDescriptor contrib) |
protected void |
addDataSourceLink(DataSourceLinkDescriptor contrib) |
protected void |
bindDataSource(DataSourceDescriptor descr) |
protected void |
bindDataSourceLink(DataSourceLinkDescriptor descr) |
void |
deactivate(ComponentContext context)
Deactivates the component.
|
<T> T |
getAdapter(Class<T> adapter)
Returns an object which is an instance of the given class associated with this object.
|
int |
getApplicationStartedOrder()
The component notification order for
Component.applicationStarted(org.nuxeo.runtime.model.ComponentContext) . |
boolean |
isStarted() |
void |
registerContribution(Object contrib,
String extensionPoint,
ComponentInstance component) |
protected void |
removeDataSource(DataSourceDescriptor contrib) |
protected void |
removeDataSourceLink(DataSourceLinkDescriptor contrib) |
void |
start(ComponentContext context)
Start the component.
|
void |
stop(ComponentContext context)
Stop the component.
|
protected void |
unbindDataSource(DataSourceDescriptor descr) |
protected void |
unbindDataSourceLink(DataSourceLinkDescriptor descr) |
void |
unregisterContribution(Object contrib,
String extensionPoint,
ComponentInstance component) |
getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted
public static final String DATASOURCES_XP
public static final String ENV_CTX_NAME
protected Map<String,DataSourceDescriptor> datasources
protected Map<String,DataSourceLinkDescriptor> links
protected final DatasourceExceptionSorter.Registry sorterRegistry
protected final PooledDataSourceRegistry poolRegistry
protected Context namingContext
public DataSourceComponent()
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic 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 void registerContribution(Object contrib, String extensionPoint, ComponentInstance component)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contrib, String extensionPoint, ComponentInstance component)
unregisterContribution
in class DefaultComponent
public 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.
public boolean isStarted()
public void start(ComponentContext context)
Component
start
in interface Component
start
in class DefaultComponent
public void stop(ComponentContext context)
Component
stop
in interface Component
stop
in class DefaultComponent
protected void addDataSource(DataSourceDescriptor contrib)
protected void removeDataSource(DataSourceDescriptor contrib)
protected void bindDataSource(DataSourceDescriptor descr)
protected void unbindDataSource(DataSourceDescriptor descr)
protected void addDataSourceLink(DataSourceLinkDescriptor contrib)
protected void removeDataSourceLink(DataSourceLinkDescriptor contrib)
protected void bindDataSourceLink(DataSourceLinkDescriptor descr)
protected void unbindDataSourceLink(DataSourceLinkDescriptor descr)
public <T> T getAdapter(Class<T> adapter)
Adaptable
null
if no such object can be found.getAdapter
in interface Adaptable
getAdapter
in class DefaultComponent
adapter
- the adapter class to look upnull
if this object does not have an adapter for
the given classCopyright © 2018 Nuxeo. All rights reserved.