Class ResourceChangeHandler


  • public class ResourceChangeHandler
    extends java.lang.Object
    Encapsulates the details about resource change detection and persist the change information in build context.
    Since:
    1.7.2
    Author:
    Alex Objelean
    • Method Detail

      • create

        public static ResourceChangeHandler create​(ro.isdc.wro.manager.factory.WroManagerFactory managerFactory,
                                                   org.apache.maven.plugin.logging.Log log)
        Factory method which requires all mandatory fields.
      • isResourceChanged

        public boolean isResourceChanged​(ro.isdc.wro.model.resource.Resource resource)
      • remember

        public void remember​(ro.isdc.wro.model.resource.Resource resource)
        Will persist the information regarding the provided resource in some internal store. This information will be used later to check if the resource is changed.
        Parameters:
        resource - Resource to touch.
      • getLog

        public org.apache.maven.plugin.logging.Log getLog()
      • setManagerFactory

        public ResourceChangeHandler setManagerFactory​(ro.isdc.wro.manager.factory.WroManagerFactory wroManagerFactory)
      • setBuildContext

        public ResourceChangeHandler setBuildContext​(org.sonatype.plexus.build.incremental.BuildContext buildContext)
      • setIncrementalBuildEnabled

        public ResourceChangeHandler setIncrementalBuildEnabled​(boolean incrementalBuildEnabled)
      • isIncrementalBuild

        public boolean isIncrementalBuild()
      • destroy

        public void destroy()
        Destroys all information about resource tracked for changes.
      • forget

        public void forget​(ro.isdc.wro.model.resource.Resource resource)
        After invoking this method on a resource, the next invocation of isResourceChanged(Resource) will return true.
        Parameters:
        resourceUri - uri of the resource to clear from persisted storage.
      • persist

        public void persist()
        Persist the values stored in BuildContext(Holder)