Package org.nuxeo.runtime.tomcat.dev
Class DevFrameworkBootstrap
- java.lang.Object
-
- org.nuxeo.osgi.application.FrameworkBootstrap
-
- org.nuxeo.runtime.tomcat.dev.DevFrameworkBootstrap
-
- All Implemented Interfaces:
LoaderConstants
,DevBundlesManager
public class DevFrameworkBootstrap extends FrameworkBootstrap implements DevBundlesManager
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected Timer
bundlesCheck
protected boolean
compatHotReload
protected static String
DEV_BUNDLES_CP
static String
DEV_BUNDLES_NAME
protected DevBundle[]
devBundles
protected File
devBundlesFile
protected long
lastModified
protected Log
log
protected ReloadServiceInvoker
reloadServiceInvoker
protected File
seamdev
static String
USE_COMPAT_HOT_RELOAD
static String
WEB_RESOURCES_NAME
protected File
webclasses
-
Fields inherited from class org.nuxeo.osgi.application.FrameworkBootstrap
DEFAULT_BUNDLES_CP, DEFAULT_LIBS_CP, env, flushCache, frameworkLoaderClass, home, loader, scanForNestedJars, startTime
-
Fields inherited from interface org.nuxeo.osgi.application.LoaderConstants
ARGS, BUNDLES, CONFIG_DIR, DATA_DIR, DEVMODE, FLUSH_CACHE, HOME_DIR, HOST_NAME, HOST_VERSION, INSTALL_RELOAD_TIMER, LIBS, LOG_DIR, PREPROCESSING, SCAN_FOR_NESTED_JARS, TMP_DIR, WEB_DIR
-
-
Constructor Summary
Constructors Constructor Description DevFrameworkBootstrap(MutableClassLoader cl, File home)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
clearClassLoader()
Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReload
DevBundle[]
getDevBundles()
String
getDevBundlesLocation()
protected void
initializeEnvironment()
protected void
installNewClassLoader(DevBundle[] bundles)
Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReload
void
installResourceBundleFragments(List<File> files)
Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReload
void
installSeamClasses(File[] dirs)
Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReload
boolean
isTimerRunning()
void
loadDevBundles()
protected void
postloadDevBundles()
Deprecated.since 9.3, we now have a new mechanism to hot reload bundles fromdevBundlesFile
.protected void
preloadDevBundles()
Deprecated.since 9.3, we now have a new mechanism to hot reload bundles fromdevBundlesFile
.protected void
reloadDevBundles(DevBundle[] bundles)
void
resetDevBundles(String path)
protected static String
resourceBundleName(File file)
Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReload
void
start(MutableClassLoader cl)
void
stop(MutableClassLoader cl)
void
toggleTimer()
void
writeComponentIndex()
protected void
writeDevBundles(DevBundle[] devBundles)
Writes to thedevBundlesFile
the inputdevBundles
by replacing the former file.protected Path
zipDirectory(Path source, Path target, CopyOption... options)
Zips recursively the content ofsource
to thetarget
zip file.-
Methods inherited from class org.nuxeo.osgi.application.FrameworkBootstrap
buildBundlesClassPath, buildClassPath, buildLibsClassPath, checkZipSlip, copyFile, copyToFile, copyTree, deleteAll, env, extractNestedJar, extractNestedJars, extractNestedJars, findFileStartingWidth, getClassLoader, getHome, getLoader, getZipEntryAsFile, initialize, installBundle, newFile, printStartedMessage, setDevMode, setDoPreprocessing, setFlushCache, setHostName, setHostVersion, setScanForNestedJars, uninstallBundle
-
-
-
-
Field Detail
-
DEV_BUNDLES_NAME
public static final String DEV_BUNDLES_NAME
- See Also:
- Constant Field Values
-
WEB_RESOURCES_NAME
public static final String WEB_RESOURCES_NAME
- See Also:
- Constant Field Values
-
USE_COMPAT_HOT_RELOAD
public static final String USE_COMPAT_HOT_RELOAD
- See Also:
- Constant Field Values
-
DEV_BUNDLES_CP
protected static final String DEV_BUNDLES_CP
- See Also:
- Constant Field Values
-
log
protected final Log log
-
devBundles
protected DevBundle[] devBundles
-
bundlesCheck
protected Timer bundlesCheck
-
lastModified
protected long lastModified
-
reloadServiceInvoker
protected ReloadServiceInvoker reloadServiceInvoker
-
devBundlesFile
protected File devBundlesFile
-
seamdev
protected final File seamdev
-
webclasses
protected final File webclasses
-
compatHotReload
protected boolean compatHotReload
-
-
Constructor Detail
-
DevFrameworkBootstrap
public DevFrameworkBootstrap(MutableClassLoader cl, File home) throws IOException
- Throws:
IOException
-
-
Method Detail
-
start
public void start(MutableClassLoader cl) throws ReflectiveOperationException, IOException, JMException
- Overrides:
start
in classFrameworkBootstrap
- Throws:
ReflectiveOperationException
IOException
JMException
-
initializeEnvironment
protected void initializeEnvironment() throws IOException
- Overrides:
initializeEnvironment
in classFrameworkBootstrap
- Throws:
IOException
-
toggleTimer
public void toggleTimer()
- Specified by:
toggleTimer
in interfaceDevBundlesManager
-
isTimerRunning
public boolean isTimerRunning()
- Specified by:
isTimerRunning
in interfaceDevBundlesManager
-
stop
public void stop(MutableClassLoader cl) throws ReflectiveOperationException, JMException
- Overrides:
stop
in classFrameworkBootstrap
- Throws:
ReflectiveOperationException
JMException
-
getDevBundlesLocation
public String getDevBundlesLocation()
- Specified by:
getDevBundlesLocation
in interfaceDevBundlesManager
-
preloadDevBundles
@Deprecated protected void preloadDevBundles() throws IOException
Deprecated.since 9.3, we now have a new mechanism to hot reload bundles fromdevBundlesFile
. The new mechanism copies bundles to nxserver/bundles, so it's now useless to preload dev bundles as they're deployed as a regular bundle.Load the development bundles and libs if any in the classpath before starting the framework.- Throws:
IOException
-
postloadDevBundles
@Deprecated protected void postloadDevBundles() throws ReflectiveOperationException
Deprecated.since 9.3, we now have a new mechanism to hot reload bundles fromdevBundlesFile
. The new mechanism copies bundles to nxserver/bundles, so it's now useless to postload dev bundles as they're deployed as a regular bundle.- Throws:
ReflectiveOperationException
-
loadDevBundles
public void loadDevBundles()
- Specified by:
loadDevBundles
in interfaceDevBundlesManager
-
resetDevBundles
public void resetDevBundles(String path)
- Specified by:
resetDevBundles
in interfaceDevBundlesManager
-
getDevBundles
public DevBundle[] getDevBundles()
- Specified by:
getDevBundles
in interfaceDevBundlesManager
-
reloadDevBundles
protected void reloadDevBundles(DevBundle[] bundles) throws ReflectiveOperationException, IOException
-
writeDevBundles
protected void writeDevBundles(DevBundle[] devBundles) throws IOException
Writes to thedevBundlesFile
the inputdevBundles
by replacing the former file.This method will
toggle
the file update check timer if needed.- Throws:
IOException
- Since:
- 9.3
-
zipDirectory
protected Path zipDirectory(Path source, Path target, CopyOption... options) throws IOException
Zips recursively the content ofsource
to thetarget
zip file.- Throws:
IOException
- Since:
- 9.3
-
clearClassLoader
@Deprecated protected void clearClassLoader()
Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReload
-
installNewClassLoader
@Deprecated protected void installNewClassLoader(DevBundle[] bundles)
Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReload
-
writeComponentIndex
public void writeComponentIndex()
-
installSeamClasses
@Deprecated public void installSeamClasses(File[] dirs) throws IOException
Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReload
- Throws:
IOException
-
installResourceBundleFragments
@Deprecated public void installResourceBundleFragments(List<File> files) throws IOException
Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReload
- Throws:
IOException
-
resourceBundleName
@Deprecated protected static String resourceBundleName(File file)
Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReload
-
-