public class ReloadComponent extends DefaultComponent implements ReloadService
Modifier and Type | Field and Description |
---|---|
protected static org.osgi.framework.Bundle |
bundle |
protected Long |
lastFlushed |
lastModified
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)
Activates the component.
|
void |
deactivate(ComponentContext context)
Deactivates the component.
|
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
|
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 |
triggerReload(String id) |
protected void |
triggerReloadWithNewTransaction(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, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLastModified, setLastModified
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 contextpublic void reload()
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
ReloadService.reloadProperties()
public void reloadProperties() throws IOException
ReloadService
reloadProperties
in interface ReloadService
IOException
public void reloadRepository()
ReloadService
reloadRepository
in interface ReloadService
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
public String deployBundle(File file) throws org.osgi.framework.BundleException
ReloadService
deployBundle
in interface ReloadService
org.osgi.framework.BundleException
ReloadService.deployBundle(File, boolean)
public String deployBundle(File file, boolean reloadResourceClasspath) throws org.osgi.framework.BundleException
ReloadService
deployBundle
in interface ReloadService
org.osgi.framework.BundleException
public void undeployBundle(File file, boolean reloadResources) throws org.osgi.framework.BundleException
ReloadService
undeployBundle
in interface ReloadService
org.osgi.framework.BundleException
public void undeployBundle(String bundleName) throws org.osgi.framework.BundleException
ReloadService
undeployBundle
in interface ReloadService
org.osgi.framework.BundleException
public Long lastFlushed()
ReloadService
ReloadService.flush()
or
ReloadService.flushJaasCache()
or ReloadService.flushSeamComponents()
, or null if never calledlastFlushed
in interface ReloadService
protected void setFlushedNow()
@Deprecated public void installWebResources(File file) throws IOException
runDeploymentPreprocessor()
insteadReloadService
installWebResources
in interface ReloadService
IOException
public void runDeploymentPreprocessor() throws IOException
ReloadService
runDeploymentPreprocessor
in interface ReloadService
IOException
public String getOSGIBundleName(File file)
ReloadService
getOSGIBundleName
in interface ReloadService
protected String getRuntimeStatus()
protected void triggerReload(String id)
protected void triggerReloadWithNewTransaction(String id)
Copyright © 2015 Nuxeo SA. All rights reserved.