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
AFTER_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 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, getLastModified, registerContribution, registerExtension, setLastModified, setModifiedNow, start, stop, unregisterContribution, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deployBundle, deployBundle, deployBundles, undeployBundle, undeployBundle, undeployBundles
getLastModified, setLastModified
applicationStarted, getApplicationStartedOrder
public 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)
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 context@Deprecated protected void refreshComponents()
public void reload() throws InterruptedException
ReloadService
ReloadService.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 ReloadService
InterruptedException
ReloadService.reloadProperties()
public void reloadProperties() throws IOException
ReloadService
reloadProperties
in interface ReloadService
IOException
public void reloadSeamComponents()
ReloadService
ReloadService.RELOAD_SEAM_EVENT_ID
reloadSeamComponents
in interface ReloadService
public void flush()
ReloadService
ReloadService.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()
ReloadService
flushJaasCache
in interface ReloadService
public void flushSeamComponents()
ReloadService
ReloadService.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.ReloadService
deployBundles
in interface ReloadService
org.osgi.framework.BundleException
@Deprecated public void undeployBundles(List<String> bundleNames, boolean reloadResources) throws org.osgi.framework.BundleException
reloadBundles(ReloadContext)
instead.ReloadService
undeployBundles
in interface ReloadService
org.osgi.framework.BundleException
public ReloadResult reloadBundles(ReloadContext context) throws org.osgi.framework.BundleException
ReloadService
reloadBundles
in interface ReloadService
org.osgi.framework.BundleException
protected List<File> copyBundlesToDeploy(ReloadContext context) throws org.osgi.framework.BundleException
org.osgi.framework.BundleException
protected ReloadResult _deployBundles(List<File> bundlesToDeploy) throws org.osgi.framework.BundleException
org.osgi.framework.BundleException
protected ReloadResult _undeployBundles(List<String> bundleNames) throws org.osgi.framework.BundleException
org.osgi.framework.BundleException
protected URL toURL(org.osgi.framework.Bundle bundle)
Bundle.getLocation()
throw a NPE.protected void logComponentManagerStatus()
ComponentManager
status.public Long lastFlushed()
ReloadService
ReloadService.flush()
or
ReloadService.flushJaasCache()
or ReloadService.flushSeamComponents()
, or null if never called.lastFlushed
in interface ReloadService
protected void setFlushedNow()
@Deprecated public void installWebResources(File file) throws IOException
runDeploymentPreprocessor()
instead. Keep it as compatibility code until
NXP-9642 is done.ReloadService
installWebResources
in interface ReloadService
IOException
public void runDeploymentPreprocessor() throws IOException
ReloadService
runDeploymentPreprocessor
in interface ReloadService
IOException
DeploymentPreprocessor}
public String getOSGIBundleName(File file)
ReloadService
getOSGIBundleName
in interface ReloadService
@Deprecated protected void triggerReloadWithNewTransaction(String eventId) throws InterruptedException
InterruptedException
@Deprecated protected void triggerReload(String eventId)
Copyright © 2018 Nuxeo. All rights reserved.