Class WCBLifecycleManager

    • Field Detail

      • myComponentManager

        protected nl.gx.webmanager.wcb.componentmanager.impl.ComponentManagerImpl myComponentManager
      • myPreferencesService

        protected org.osgi.service.prefs.PreferencesService myPreferencesService
      • myRepositoryService

        protected JcrRepository myRepositoryService
      • myBundle

        protected org.osgi.framework.Bundle myBundle
      • myIsWCB

        protected boolean myIsWCB
    • Constructor Detail

      • WCBLifecycleManager

        public WCBLifecycleManager​(nl.gx.webmanager.wcb.componentmanager.impl.ComponentManagerImpl componentManager,
                                   org.osgi.framework.Bundle bundle)
        Constructor of the lifecycle manager with the bundle. Can be invoked in any state of the bundle.
        Parameters:
        componentManager - The component manager this class is instantiated from
        bundleDefinition - The component bundle definition subject to the lifecycle change
      • WCBLifecycleManager

        public WCBLifecycleManager​(nl.gx.webmanager.wcb.componentmanager.impl.ComponentManagerImpl componentManager,
                                   ComponentBundleDefinition bundleDefinition)
        Constructor of the lifecycle manager with an active Component bundle definition. Can only be invoked when the component bundle is in the ACTIVE state
        Parameters:
        componentManager - The component manager this class is instantiated from
        bundleDefinition - The component bundle definition subject to the lifecycle change
    • Method Detail

      • deleteResourcesFromDisk

        protected void deleteResourcesFromDisk​(String[] fileNames,
                                               String relativePath)
        Deletes an array of files on a given relative path from disk.
        Parameters:
        fileNames - Array of file names
        relativePath - Relative path on disk
      • getBaseDirectory

        protected String getBaseDirectory()
        Returns the WCB base directory.
        Returns:
        the WCB base directory
      • getWebrootDirectory

        protected String getWebrootDirectory()
        Returns the webroot directory.
        Returns:
        the webroot directory
      • setLastModified

        protected void setLastModified()
                                throws org.osgi.service.prefs.BackingStoreException
        Store the last modified timestamp of the bundle in the component bundle's preferences.
        Throws:
        org.osgi.service.prefs.BackingStoreException
      • setBooleanPreference

        protected void setBooleanPreference​(String baseNode,
                                            String subNode,
                                            String preference,
                                            boolean value)
        Sets a preference for the given base node and the given subnode.
        Parameters:
        baseNode - Identifying name of the base node.
        subNode - Identifying name of the sub node.
        preference - Identifying name of the preference to be set.
        value - Value for the preference to be set.
      • deleteBundleResources

        public void deleteBundleResources()
        Delete the bundle resources from disk
      • setLanguageResources

        protected void setLanguageResources()
        Sets the language resources for the bundle definition from the JAR file
      • purgePreferences

        protected void purgePreferences​(boolean deleteAll)
        Purge the preferences
        Parameters:
        deleteAll - If true, all preferences are removed, event the ones that are used by the WebManager platform (lastmodified)
      • startInfoMessage

        protected long startInfoMessage​(String action)
        Start an info message
        Parameters:
        action - Lifecycle action that is performed
        Returns:
        Current time in milliseconds
      • stopInfoMessage

        protected void stopInfoMessage​(String action,
                                       boolean success,
                                       long starttime)
        Stop an info message
        Parameters:
        action - Lifecycle action that was performed
        success - Indication if the lifecycle action
        starttime -