public class ReloadComponent extends DefaultComponent implements ReloadService
| Modifier and Type | Field and Description |
|---|---|
protected static org.osgi.framework.Bundle |
bundle |
protected Long |
lastFlushed |
lastModifiedAFTER_RELOAD_EVENT_ID, BEFORE_RELOAD_EVENT_ID, FLUSH_EVENT_ID, FLUSH_SEAM_EVENT_ID, RELOAD_EVENT_ID, RELOAD_REPOSITORIES_ID, RELOAD_SEAM_EVENT_ID, RELOAD_TOPIC| Constructor and Description |
|---|
ReloadComponent() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(ComponentContext context) |
void |
deactivate(ComponentContext context) |
String |
deployBundle(File file)
Deploys bundle to the runtime, without reloading resources
|
String |
deployBundle(File file,
boolean reloadResourceClasspath)
Deploys bundle to the runtime, gives possibility to control resources
reloading.
|
void |
flush()
Sends a runtime event with id
ReloadService.FLUSH_EVENT_ID so that listeners
can be notified that a flush is needed (after a reload for instance). |
void |
flushJaasCache()
Sends an event that can trigger reset of JaasCache
|
void |
flushSeamComponents()
Sends a runtime event with id
ReloadService.FLUSH_SEAM_EVENT_ID |
protected static File |
getAppDir() |
static org.osgi.framework.Bundle |
getBundle() |
static org.osgi.framework.BundleContext |
getBundleContext() |
String |
getOSGIBundleName(File file)
Returns the OSGI bundle name if given file can be identified as an OSGI
bundle, or null.
|
protected String |
getRuntimeStatus() |
protected static File |
getWarDir() |
void |
installWebResources(File file)
Deprecated.
since 5.6, use
runDeploymentPreprocessor() instead |
Long |
lastFlushed()
Returns the last time one of the flush commands where called on this
service instance (
ReloadService.flush() or ReloadService.flushJaasCache() or
ReloadService.flushSeamComponents(), or null if never called |
void |
reload()
Sends a runtime event with id
ReloadService.RELOAD_EVENT_ID so that listeners
can be notified that a reload has been done. |
void |
reloadProperties()
Reloads runtime framework properties
|
void |
reloadRepository()
Reloads the Nuxeo repository configuration
|
protected static void |
reloadResourceClassPath(Collection<String> files)
Rebuild the framework resource class loader and add to it the given file
paths.
|
void |
reloadSeamComponents()
Sends a runtime event with id
ReloadService.RELOAD_SEAM_EVENT_ID |
void |
runDeploymentPreprocessor()
Runs the deployment preprocessor
|
protected void |
setFlushedNow()
Sets the last date date to current date timestamp
|
protected void |
triggerReloadWithNewTransaction(String id) |
protected void |
triggerReloadWithPassivate(String id) |
void |
undeployBundle(File file,
boolean reloadResources)
Undeploys bundle from the runtime, given the bundle resource, gives
possibility to control resources reloading
|
void |
undeployBundle(String bundleName)
Undeploys bundle from the runtime, given the bundle filename
|
applicationStarted, getAdapter, getApplicationStartedOrder, getLastModified, registerContribution, registerExtension, setLastModified, setModifiedNow, unregisterContribution, unregisterExtensionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLastModified, setLastModifiedprotected static org.osgi.framework.Bundle bundle
protected Long lastFlushed
public static org.osgi.framework.BundleContext getBundleContext()
public static org.osgi.framework.Bundle getBundle()
public void activate(ComponentContext context) throws Exception
activate in interface Componentactivate in class DefaultComponentExceptionpublic void deactivate(ComponentContext context) throws Exception
deactivate in interface Componentdeactivate in class DefaultComponentExceptionpublic void reload()
throws Exception
ReloadServiceReloadService.RELOAD_EVENT_ID so that listeners
can be notified that a reload has been done.
Also calls ReloadService.reloadProperties() by default, but not other reload
methods as they could alter the running application behaviour.
reload in interface ReloadServiceExceptionReloadService.reloadProperties()public void reloadProperties()
throws Exception
ReloadServicereloadProperties in interface ReloadServiceExceptionpublic void reloadRepository()
throws Exception
ReloadServicereloadRepository in interface ReloadServiceExceptionpublic void reloadSeamComponents()
throws Exception
ReloadServiceReloadService.RELOAD_SEAM_EVENT_IDreloadSeamComponents in interface ReloadServiceExceptionpublic void flush()
throws Exception
ReloadServiceReloadService.FLUSH_EVENT_ID so that listeners
can be notified that a flush is needed (after a reload for instance).
Also calls ReloadService.flushJaasCache() by default, but not other flush
methods as they could alter the running application behaviour.
flush in interface ReloadServiceException#flushJaasCache()}public void flushJaasCache()
throws Exception
ReloadServiceflushJaasCache in interface ReloadServiceExceptionpublic void flushSeamComponents()
throws Exception
ReloadServiceReloadService.FLUSH_SEAM_EVENT_IDflushSeamComponents in interface ReloadServiceExceptionpublic String deployBundle(File file) throws Exception
ReloadServicedeployBundle in interface ReloadServiceExceptionReloadService.deployBundle(File, boolean)public String deployBundle(File file, boolean reloadResourceClasspath) throws MalformedURLException, org.osgi.framework.BundleException
ReloadServicedeployBundle in interface ReloadServiceMalformedURLExceptionorg.osgi.framework.BundleExceptionpublic void undeployBundle(File file, boolean reloadResources) throws Exception
ReloadServiceundeployBundle in interface ReloadServiceExceptionpublic void undeployBundle(String bundleName) throws Exception
ReloadServiceundeployBundle in interface ReloadServiceExceptionpublic Long lastFlushed()
ReloadServiceReloadService.flush() or ReloadService.flushJaasCache() or
ReloadService.flushSeamComponents(), or null if never calledlastFlushed in interface ReloadServiceprotected void setFlushedNow()
@Deprecated public void installWebResources(File file) throws Exception
runDeploymentPreprocessor() insteadReloadServiceinstallWebResources in interface ReloadServiceExceptionprotected static void reloadResourceClassPath(Collection<String> files) throws Exception
The already added paths are removed from the class loader. FIXME: is this an issue for hot-reloading of multiple jars?
Exceptionpublic void runDeploymentPreprocessor()
throws Exception
ReloadServicerunDeploymentPreprocessor in interface ReloadServiceExceptionprotected static File getAppDir()
protected static File getWarDir()
public String getOSGIBundleName(File file)
ReloadServicegetOSGIBundleName in interface ReloadServiceprotected String getRuntimeStatus()
protected void triggerReloadWithNewTransaction(String id)
protected void triggerReloadWithPassivate(String id)
Copyright © 2019 Nuxeo SA. All rights reserved.