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 TimerbundlesCheckprotected booleancompatHotReloadprotected static StringDEV_BUNDLES_CPstatic StringDEV_BUNDLES_NAMEprotected DevBundle[]devBundlesprotected FiledevBundlesFileprotected longlastModifiedprotected Loglogprotected ReloadServiceInvokerreloadServiceInvokerprotected Fileseamdevstatic StringUSE_COMPAT_HOT_RELOADstatic StringWEB_RESOURCES_NAMEprotected Filewebclasses-
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 voidclearClassLoader()Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReloadDevBundle[]getDevBundles()StringgetDevBundlesLocation()protected voidinitializeEnvironment()protected voidinstallNewClassLoader(DevBundle[] bundles)Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReloadvoidinstallResourceBundleFragments(List<File> files)Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReloadvoidinstallSeamClasses(File[] dirs)Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReloadbooleanisTimerRunning()voidloadDevBundles()protected voidpostloadDevBundles()Deprecated.since 9.3, we now have a new mechanism to hot reload bundles fromdevBundlesFile.protected voidpreloadDevBundles()Deprecated.since 9.3, we now have a new mechanism to hot reload bundles fromdevBundlesFile.protected voidreloadDevBundles(DevBundle[] bundles)voidresetDevBundles(String path)protected static StringresourceBundleName(File file)Deprecated.since 9.3 not needed anymore, here for backward compatibility, seecompatHotReloadvoidstart(MutableClassLoader cl)voidstop(MutableClassLoader cl)voidtoggleTimer()voidwriteComponentIndex()protected voidwriteDevBundles(DevBundle[] devBundles)Writes to thedevBundlesFilethe inputdevBundlesby replacing the former file.protected PathzipDirectory(Path source, Path target, CopyOption... options)Zips recursively the content ofsourceto thetargetzip 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:
startin classFrameworkBootstrap- Throws:
ReflectiveOperationExceptionIOExceptionJMException
-
initializeEnvironment
protected void initializeEnvironment() throws IOException- Overrides:
initializeEnvironmentin classFrameworkBootstrap- Throws:
IOException
-
toggleTimer
public void toggleTimer()
- Specified by:
toggleTimerin interfaceDevBundlesManager
-
isTimerRunning
public boolean isTimerRunning()
- Specified by:
isTimerRunningin interfaceDevBundlesManager
-
stop
public void stop(MutableClassLoader cl) throws ReflectiveOperationException, JMException
- Overrides:
stopin classFrameworkBootstrap- Throws:
ReflectiveOperationExceptionJMException
-
getDevBundlesLocation
public String getDevBundlesLocation()
- Specified by:
getDevBundlesLocationin 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:
loadDevBundlesin interfaceDevBundlesManager
-
resetDevBundles
public void resetDevBundles(String path)
- Specified by:
resetDevBundlesin interfaceDevBundlesManager
-
getDevBundles
public DevBundle[] getDevBundles()
- Specified by:
getDevBundlesin interfaceDevBundlesManager
-
reloadDevBundles
protected void reloadDevBundles(DevBundle[] bundles) throws ReflectiveOperationException, IOException
-
writeDevBundles
protected void writeDevBundles(DevBundle[] devBundles) throws IOException
Writes to thedevBundlesFilethe inputdevBundlesby replacing the former file.This method will
togglethe 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 ofsourceto thetargetzip 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
-
-