public class ReloadComponent extends DefaultComponent implements ReloadService
| Modifier and Type | Field and Description |
|---|---|
protected static org.osgi.framework.Bundle |
bundle |
protected Long |
lastFlushed |
static String |
RELOAD_STRATEGY_PARAMETER
The reload strategy to adopt for hot reload.
|
static String |
RELOAD_STRATEGY_VALUE_DEFAULT |
static String |
RELOAD_STRATEGY_VALUE_RESTART |
static String |
RELOAD_STRATEGY_VALUE_STANDBY |
static String |
RELOAD_STRATEGY_VALUE_UNSTASH |
lastModified, nameAFTER_RELOAD_EVENT_ID, BEFORE_RELOAD_EVENT_ID, FLUSH_EVENT_ID, FLUSH_SEAM_EVENT_ID, RELOAD_EVENT_ID, RELOAD_SEAM_EVENT_ID, RELOAD_TOPIC, USE_COMPAT_HOT_RELOAD| Constructor and Description |
|---|
ReloadComponent() |
| Modifier and Type | Method and Description |
|---|---|
protected ReloadResult |
_deployBundles(List<File> bundlesToDeploy) |
protected ReloadResult |
_undeployBundles(List<String> bundleNames) |
void |
activate(ComponentContext context)
Activates the component.
|
protected void |
clearJarFileFactoryCache(ReloadResult result)
|
protected List<File> |
copyBundlesToDeploy(ReloadContext context) |
void |
deactivate(ComponentContext context)
Deactivates the component.
|
void |
deployBundles(List<File> files,
boolean reloadResources)
Deprecated.
since 9.3 use
reloadBundles(ReloadContext) instead. |
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 static File |
getWarDir() |
void |
installWebResources(File file)
Deprecated.
since 5.6, use
runDeploymentPreprocessor() instead. Keep it as compatibility code until
NXP-9642 is done. |
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. |
protected void |
logComponentManagerStatus()
Logs the
ComponentManager status. |
protected void |
refreshComponents()
Deprecated.
since 9.3, this method is only used in deployBundles and undeployBundles which are deprecated. Keep
it for backward compatibility.
|
void |
reload()
Sends a runtime event with id
ReloadService.RELOAD_EVENT_ID so that listeners can be notified that a reload has been
done. |
ReloadResult |
reloadBundles(ReloadContext context)
Called by ReloadServiceInvoker#hotReloadBundles.
|
void |
reloadProperties()
Reloads runtime framework properties
|
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 URL |
toURL(org.osgi.framework.Bundle bundle)
This method needs to be called before bundle uninstallation, otherwise
Bundle.getLocation() throw a NPE. |
protected URL |
toURL(File file) |
protected void |
triggerReload(String eventId)
Deprecated.
since 9.3 should not be needed anymore
|
protected void |
triggerReloadWithNewTransaction(String eventId)
Deprecated.
since 9.3 should not be needed anymore
|
void |
undeployBundles(List<String> bundleNames,
boolean reloadResources)
Deprecated.
since 9.3 use
reloadBundles(ReloadContext) instead. |
getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution, unregisterExtensionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeployBundle, deployBundle, deployBundles, undeployBundle, undeployBundle, undeployBundlesgetLastModified, setLastModifiedapplicationStarted, getApplicationStartedOrderpublic static final String RELOAD_STRATEGY_PARAMETER
RELOAD_STRATEGY_VALUE_DEFAULT.public static final String RELOAD_STRATEGY_VALUE_UNSTASH
public static final String RELOAD_STRATEGY_VALUE_STANDBY
public static final String RELOAD_STRATEGY_VALUE_RESTART
public static final String RELOAD_STRATEGY_VALUE_DEFAULT
protected static org.osgi.framework.Bundle bundle
protected Long lastFlushed
public ReloadComponent()
public static org.osgi.framework.BundleContext getBundleContext()
public static org.osgi.framework.Bundle getBundle()
public void activate(ComponentContext context)
ComponentThis method is called by the runtime when a component is activated.
activate in interface Componentactivate in class DefaultComponentcontext - the runtime contextpublic void deactivate(ComponentContext context)
ComponentThis method is called by the runtime when a component is deactivated.
deactivate in interface Componentdeactivate in class DefaultComponentcontext - the runtime context@Deprecated protected void refreshComponents()
public void reload() throws InterruptedException
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 ReloadServiceInterruptedExceptionReloadService.reloadProperties()public void reloadProperties() throws IOException
ReloadServicereloadProperties in interface ReloadServiceIOExceptionpublic void reloadSeamComponents()
ReloadServiceReloadService.RELOAD_SEAM_EVENT_IDreloadSeamComponents in interface ReloadServicepublic void flush()
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 ReloadService#flushJaasCache()}public void flushJaasCache()
ReloadServiceflushJaasCache in interface ReloadServicepublic void flushSeamComponents()
ReloadServiceReloadService.FLUSH_SEAM_EVENT_ID.flushSeamComponents in interface ReloadService@Deprecated public void deployBundles(List<File> files, boolean reloadResources) throws org.osgi.framework.BundleException
reloadBundles(ReloadContext) instead.ReloadServicedeployBundles in interface ReloadServiceorg.osgi.framework.BundleException@Deprecated public void undeployBundles(List<String> bundleNames, boolean reloadResources) throws org.osgi.framework.BundleException
reloadBundles(ReloadContext) instead.ReloadServiceundeployBundles in interface ReloadServiceorg.osgi.framework.BundleExceptionpublic ReloadResult reloadBundles(ReloadContext context) throws org.osgi.framework.BundleException
ReloadServicereloadBundles in interface ReloadServiceorg.osgi.framework.BundleExceptionprotected List<File> copyBundlesToDeploy(ReloadContext context) throws org.osgi.framework.BundleException
org.osgi.framework.BundleExceptionprotected ReloadResult _deployBundles(List<File> bundlesToDeploy) throws org.osgi.framework.BundleException
org.osgi.framework.BundleExceptionprotected ReloadResult _undeployBundles(List<String> bundleNames) throws org.osgi.framework.BundleException
org.osgi.framework.BundleExceptionprotected void clearJarFileFactoryCache(ReloadResult result)
protected URL toURL(org.osgi.framework.Bundle bundle)
Bundle.getLocation() throw a NPE.protected void logComponentManagerStatus()
ComponentManager status.public Long lastFlushed()
ReloadServiceReloadService.flush() or
ReloadService.flushJaasCache() or ReloadService.flushSeamComponents(), or null if never called.lastFlushed in interface ReloadServiceprotected void setFlushedNow()
@Deprecated public void installWebResources(File file) throws IOException
runDeploymentPreprocessor() instead. Keep it as compatibility code until
NXP-9642 is done.ReloadServiceinstallWebResources in interface ReloadServiceIOExceptionpublic void runDeploymentPreprocessor() throws IOException
ReloadServicerunDeploymentPreprocessor in interface ReloadServiceIOExceptionDeploymentPreprocessor}public String getOSGIBundleName(File file)
ReloadServicegetOSGIBundleName in interface ReloadService@Deprecated protected void triggerReloadWithNewTransaction(String eventId)
@Deprecated protected void triggerReload(String eventId)
Copyright © 2019 Nuxeo. All rights reserved.