Class SharedTagContent<T>

java.lang.Object
com.webfirmframework.wffweb.tag.html.SharedTagContent<T>
Type Parameters:
T - class type of content in this SharedTagContent object

public class SharedTagContent<T> extends Object
This class is highly thread-safe so you can even declare a static object to use under multiple threads. Changing the content of this object will be reflected in all consuming tags if shared property of this object is true. The shared property can be set as by passing constructor argument or by setter method. Its default value is true if not explicitly specified.

Usage Eg:-
 SharedTagContent<String> stc = new SharedTagContent<>("Initial Content");

 Div div = new Div(null);

 Span span1 = new Span(div);
 span1.subscribeTo(stc);

 Span span2 = new Span(div);
 span2.addInnerHtml(stc);

 System.out.println(div.toHtmlString());
 stc.setContent("Content Changed");
 System.out.println(div.toHtmlString());
 
prints
 <div><span>Initial Content</span><span>Initial Content</span></div>

 <div><span>Content Changed</span><span>Content Changed</span></div>
 
Since:
3.0.6
  • Constructor Details

    • SharedTagContent

      public SharedTagContent(Executor executor, SharedTagContent.UpdateClientNature updateClientNature, boolean shared, T content, boolean contentTypeHtml)
      Parameters:
      executor - the executor object for async push or null if no preference. This executor object will be used only if the updateClientNature is SharedTagContent.UpdateClientNature.ALLOW_ASYNC_PARALLEL or SharedTagContent.UpdateClientNature.ALLOW_PARALLEL.
      NB: You may need only one copy of executor object for all sharedTagContent instances in the project. So it could be declared as a static final object. Eg:
       
      
       public static final Executor EXECUTOR = Executors.newCachedThreadPool();
       sharedTagContent.setExecutor(EXECUTOR);
       
                                 
      When Java releases Virtual Thread we may be able to use as follows
       
       public static final Executor EXECUTOR = Executors.newVirtualThreadExecutor();
       sharedTagContent.setExecutor(EXECUTOR);
       
                                 
      updateClientNature - If this SharedTagContent object has to update content of tags from multiple BrowserPage instances, UpdateClientNature.ALLOW_ASYNC_PARALLEL will allow parallel operation in the background for pushing changes to client browser page and UpdateClientNature.ALLOW_PARALLEL will allow parallel operation but will wait for the push to finish to exit the setContent method. UpdateClientNature.SEQUENTIAL will sequentially do each browser page push operation.
      shared - true to share its content across all consuming tags when setContent(T) is called.
      content - the content to embed in the consumer tags.
      contentTypeHtml - true to treat the given content as HTML otherwise false.
      Since:
      3.0.15
    • SharedTagContent

      public SharedTagContent(SharedTagContent.UpdateClientNature updateClientNature, boolean shared, T content, boolean contentTypeHtml)
      or null if no preference.
      Parameters:
      updateClientNature - If this SharedTagContent object has to update content of tags from multiple BrowserPage instances, UpdateClientNature.ALLOW_ASYNC_PARALLEL will allow parallel operation in the background for pushing changes to client browser page and UpdateClientNature.ALLOW_PARALLEL will allow parallel operation but will wait for the push to finish to exit the setContent method. UpdateClientNature.SEQUENTIAL will sequentially do each browser page push operation.
      shared - true to share its content across all consuming tags when setContent(T) is called.
      content - the content to embed in the consumer tags.
      contentTypeHtml - true to treat the given content as HTML otherwise false.
      Since:
      3.0.15
    • SharedTagContent

      public SharedTagContent(Executor executor, T content)
      plain text content with updateClientNature as UpdateClientNature.ALLOW_ASYNC_PARALLEL.
      Parameters:
      executor - the executor object for async push or null if no preference. This executor object will be used only if the updateClientNature is SharedTagContent.UpdateClientNature.ALLOW_ASYNC_PARALLEL or SharedTagContent.UpdateClientNature.ALLOW_PARALLEL.
      NB: You may need only one copy of executor object for all sharedTagContent instances in the project. So it could be declared as a static final object. Eg:
       
      
       public static final Executor EXECUTOR = Executors.newCachedThreadPool();
       sharedTagContent.setExecutor(EXECUTOR);
       
                       
      When Java releases Virtual Thread we may be able to use as follows
       
       public static final Executor EXECUTOR = Executors.newVirtualThreadExecutor();
       sharedTagContent.setExecutor(EXECUTOR);
       
                       
      content - the content its content type will be considered as plain text, i.e. contentTypeHtml will be false.
      Since:
      3.0.15
    • SharedTagContent

      public SharedTagContent(T content)
      plain text content with updateClientNature as UpdateClientNature.ALLOW_ASYNC_PARALLEL.
      Parameters:
      content - the content its content type will be considered as plain text, i.e. contentTypeHtml will be false.
      Since:
      3.0.6
    • SharedTagContent

      public SharedTagContent(SharedTagContent.UpdateClientNature updateClientNature, T content)
      Parameters:
      updateClientNature - If this SharedTagContent object has to update content of tags from multiple BrowserPage instances, UpdateClientNature.ALLOW_ASYNC_PARALLEL will allow parallel operation in the background for pushing changes to client browser page and UpdateClientNature.ALLOW_PARALLEL will allow parallel operation but will wait for the push to finish to exit the setContent method. UpdateClientNature.SEQUENTIAL will sequentially do each browser page push operation.
      content - the content its content type will be considered as plain text, i.e. contentTypeHtml will be false.
      Since:
      3.0.6
    • SharedTagContent

      public SharedTagContent(Executor executor, SharedTagContent.UpdateClientNature updateClientNature, T content)
      Parameters:
      executor - the executor object for async push or null if no preference. This executor object will be used only if the updateClientNature is SharedTagContent.UpdateClientNature.ALLOW_ASYNC_PARALLEL or SharedTagContent.UpdateClientNature.ALLOW_PARALLEL.
      NB: You may need only one copy of executor object for all sharedTagContent instances in the project. So it could be declared as a static final object. Eg:
       
      
       public static final Executor EXECUTOR = Executors.newCachedThreadPool();
       sharedTagContent.setExecutor(EXECUTOR);
       
                                 
      When Java releases Virtual Thread we may be able to use as follows
       
       public static final Executor EXECUTOR = Executors.newVirtualThreadExecutor();
       sharedTagContent.setExecutor(EXECUTOR);
       
                                 
      updateClientNature - If this SharedTagContent object has to update content of tags from multiple BrowserPage instances, UpdateClientNature.ALLOW_ASYNC_PARALLEL will allow parallel operation in the background for pushing changes to client browser page and UpdateClientNature.ALLOW_PARALLEL will allow parallel operation but will wait for the push to finish to exit the setContent method. UpdateClientNature.SEQUENTIAL will sequentially do each browser page push operation.
      content - the content its content type will be considered as plain text, i.e. contentTypeHtml will be false.
      Since:
      3.0.15
    • SharedTagContent

      public SharedTagContent(T content, boolean contentTypeHtml)
      The default value of updateClientNature is UpdateClientNature.ALLOW_ASYNC_PARALLEL.
      Parameters:
      content - the content to embed in the consumer tags.
      contentTypeHtml - true to treat the given content as HTML otherwise false.
      Since:
      3.0.6
    • SharedTagContent

      public SharedTagContent(Executor executor, T content, boolean contentTypeHtml)
      The default value of updateClientNature is UpdateClientNature.ALLOW_ASYNC_PARALLEL.
      Parameters:
      executor - the executor object for async push or null if no preference. This executor object will be used only if the updateClientNature is SharedTagContent.UpdateClientNature.ALLOW_ASYNC_PARALLEL or SharedTagContent.UpdateClientNature.ALLOW_PARALLEL.
      NB: You may need only one copy of executor object for all sharedTagContent instances in the project. So it could be declared as a static final object. Eg:
       
      
       public static final Executor EXECUTOR = Executors.newCachedThreadPool();
       sharedTagContent.setExecutor(EXECUTOR);
       
                              
      When Java releases Virtual Thread we may be able to use as follows
       
       public static final Executor EXECUTOR = Executors.newVirtualThreadExecutor();
       sharedTagContent.setExecutor(EXECUTOR);
       
                              
      content - the content to embed in the consumer tags.
      contentTypeHtml - true to treat the given content as HTML otherwise false.
      Since:
      3.0.15
    • SharedTagContent

      public SharedTagContent(SharedTagContent.UpdateClientNature updateClientNature, T content, boolean contentTypeHtml)
      Parameters:
      updateClientNature - If this SharedTagContent object has to update content of tags from multiple BrowserPage instances, UpdateClientNature.ALLOW_ASYNC_PARALLEL will allow parallel operation in the background for pushing changes to client browser page and UpdateClientNature.ALLOW_PARALLEL will allow parallel operation but will wait for the push to finish to exit the setContent method. UpdateClientNature.SEQUENTIAL will sequentially do each browser page push operation.
      content - the content to embed in the consumer tags.
      contentTypeHtml - true to treat the given content as HTML otherwise false.
      Since:
      3.0.6
    • SharedTagContent

      public SharedTagContent(Executor executor, SharedTagContent.UpdateClientNature updateClientNature, T content, boolean contentTypeHtml)
      Parameters:
      executor - the executor object for async push or null if no preference. This executor object will be used only if the updateClientNature is SharedTagContent.UpdateClientNature.ALLOW_ASYNC_PARALLEL or SharedTagContent.UpdateClientNature.ALLOW_PARALLEL.
      NB: You may need only one copy of executor object for all sharedTagContent instances in the project. So it could be declared as a static final object. Eg:
       
      
       public static final Executor EXECUTOR = Executors.newCachedThreadPool();
       sharedTagContent.setExecutor(EXECUTOR);
       
                                 
      When Java releases Virtual Thread we may be able to use as follows
       
       public static final Executor EXECUTOR = Executors.newVirtualThreadExecutor();
       sharedTagContent.setExecutor(EXECUTOR);
       
                                 
      updateClientNature - If this SharedTagContent object has to update content of tags from multiple BrowserPage instances, UpdateClientNature.ALLOW_ASYNC_PARALLEL will allow parallel operation in the background for pushing changes to client browser page and UpdateClientNature.ALLOW_PARALLEL will allow parallel operation but will wait for the push to finish to exit the setContent method. UpdateClientNature.SEQUENTIAL will sequentially do each browser page push operation.
      content - the content to embed in the consumer tags.
      contentTypeHtml - true to treat the given content as HTML otherwise false.
      Since:
      3.0.15
    • SharedTagContent

      public SharedTagContent(SharedTagContent.UpdateClientNature updateClientNature, boolean shared, T content)
      Parameters:
      updateClientNature - If this SharedTagContent object has to update content of tags from multiple BrowserPage instances, UpdateClientNature.ALLOW_ASYNC_PARALLEL will allow parallel operation in the background for pushing changes to client browser page and UpdateClientNature.ALLOW_PARALLEL will allow parallel operation but will wait for the push to finish to exit the setContent method. UpdateClientNature.SEQUENTIAL will sequentially do each browser page push operation.
      shared - true to share its content across all consuming tags when setContent(T) is called.
      content - the content which will be treated as plain text in the consumer tags.
      Since:
      3.0.15
    • SharedTagContent

      public SharedTagContent(Executor executor, SharedTagContent.UpdateClientNature updateClientNature, boolean shared, T content)
      Parameters:
      executor - the executor object for async push or null if no preference. This executor object will be used only if the updateClientNature is SharedTagContent.UpdateClientNature.ALLOW_ASYNC_PARALLEL or SharedTagContent.UpdateClientNature.ALLOW_PARALLEL.
      NB: You may need only one copy of executor object for all sharedTagContent instances in the project. So it could be declared as a static final object. Eg:
       
      
       public static final Executor EXECUTOR = Executors.newCachedThreadPool();
       sharedTagContent.setExecutor(EXECUTOR);
       
                                 
      When Java releases Virtual Thread we may be able to use as follows
       
       public static final Executor EXECUTOR = Executors.newVirtualThreadExecutor();
       sharedTagContent.setExecutor(EXECUTOR);
       
                                 
      updateClientNature - If this SharedTagContent object has to update content of tags from multiple BrowserPage instances, UpdateClientNature.ALLOW_ASYNC_PARALLEL will allow parallel operation in the background for pushing changes to client browser page and UpdateClientNature.ALLOW_PARALLEL will allow parallel operation but will wait for the push to finish to exit the setContent method. UpdateClientNature.SEQUENTIAL will sequentially do each browser page push operation.
      shared - true to share its content across all consuming tags when setContent(T) is called.
      content - the content which will be treated as plain text in the consumer tags.
      Since:
      3.0.15
    • SharedTagContent

      public SharedTagContent(boolean shared, T content, boolean contentTypeHtml)
      Parameters:
      shared - true to share its content across all consuming tags when setContent(T) is called.
      content - the content to embed in the consumer tags.
      contentTypeHtml - true to treat the given content as HTML otherwise false.
      Since:
      3.0.6
    • SharedTagContent

      public SharedTagContent(Executor executor, boolean shared, T content, boolean contentTypeHtml)
      Parameters:
      executor - the executor object for async push or null if no preference. This executor object will be used only if the updateClientNature is SharedTagContent.UpdateClientNature.ALLOW_ASYNC_PARALLEL or SharedTagContent.UpdateClientNature.ALLOW_PARALLEL.
      NB: You may need only one copy of executor object for all sharedTagContent instances in the project. So it could be declared as a static final object. Eg:
       
      
       public static final Executor EXECUTOR = Executors.newCachedThreadPool();
       sharedTagContent.setExecutor(EXECUTOR);
       
                              
      When Java releases Virtual Thread we may be able to use as follows
       
       public static final Executor EXECUTOR = Executors.newVirtualThreadExecutor();
       sharedTagContent.setExecutor(EXECUTOR);
       
                              
      shared - true to share its content across all consuming tags when setContent(T) is called.
      content - the content to embed in the consumer tags.
      contentTypeHtml - true to treat the given content as HTML otherwise false.
      Since:
      3.0.15
    • SharedTagContent

      public SharedTagContent(boolean shared, T content)
      Parameters:
      shared - true to share its content across all consuming tags when setContent(T) is called.
      content - the content which will be treated as plain text in the consumer tags.
      Since:
      3.0.6
    • SharedTagContent

      public SharedTagContent(Executor executor, boolean shared, T content)
      Parameters:
      executor - the executor object for async push or null if no preference. This executor object will be used only if the updateClientNature is SharedTagContent.UpdateClientNature.ALLOW_ASYNC_PARALLEL or SharedTagContent.UpdateClientNature.ALLOW_PARALLEL.
      NB: You may need only one copy of executor object for all sharedTagContent instances in the project. So it could be declared as a static final object. Eg:
       
      
       public static final Executor EXECUTOR = Executors.newCachedThreadPool();
       sharedTagContent.setExecutor(EXECUTOR);
       
                       
      When Java releases Virtual Thread we may be able to use as follows
       
       public static final Executor EXECUTOR = Executors.newVirtualThreadExecutor();
       sharedTagContent.setExecutor(EXECUTOR);
       
                       
      shared - true to share its content across all consuming tags when setContent(T) is called.
      content - the content which will be treated as plain text in the consumer tags.
      Since:
      3.0.15
  • Method Details

    • getContent

      public T getContent()
      Returns:
      the content
      Since:
      3.0.6
    • isContentTypeHtml

      public boolean isContentTypeHtml()
      Returns:
      true if content type is HTML
      Since:
      3.0.6
    • isShared

      public boolean isShared()
      Returns:
      true if its content is shared across all consuming tags.
      Since:
      3.0.6
    • getUpdateClientNature

      public SharedTagContent.UpdateClientNature getUpdateClientNature()
      Returns:
      UpdateClientNature which specifies the nature.
      Since:
      3.0.6
    • setUpdateClientNature

      public void setUpdateClientNature(SharedTagContent.UpdateClientNature updateClientNature)
      Parameters:
      updateClientNature - If this SharedTagContent object has to update content of tags from multiple BrowserPage instances, UpdateClientNature.ALLOW_ASYNC_PARALLEL will allow parallel operation in the background for pushing changes to client browser page and UpdateClientNature.ALLOW_PARALLEL will allow parallel operation but will wait for the push to finish to exit the setContent method. UpdateClientNature.SEQUENTIAL will sequentially do each browser page push operation.
      Since:
      3.0.6
    • isUpdateClient

      public boolean isUpdateClient()
      its default value is true if not explicitly set
      Returns:
      true if updating client browser page is turned off
      Since:
      3.0.6
    • getExecutor

      public Executor getExecutor()
      Returns:
      the Executor object.
      Since:
      3.0.15
    • setUpdateClient

      public void setUpdateClient(boolean updateClient)
      Parameters:
      updateClient - true to turn on updating client browser page. By default it is true.
      Since:
      3.0.6
    • setShared

      public void setShared(boolean shared)
      Parameters:
      shared - true to make content of this SharedTagContent object across all consuming tags while setContent(Object) is called.
      Since:
      3.0.6
    • setExecutor

      public void setExecutor(Executor executor)
      Parameters:
      executor - the executor object for async push or null if no preference. This executor object will be used only if the updateClientNature is SharedTagContent.UpdateClientNature.ALLOW_ASYNC_PARALLEL or SharedTagContent.UpdateClientNature.ALLOW_PARALLEL.
      NB: You may need only one copy of executor object for all sharedTagContent instances in the project. So it could be declared as a static final object. Eg:
       
      
       public static final Executor EXECUTOR = Executors.newCachedThreadPool();
       sharedTagContent.setExecutor(EXECUTOR);
       
                       
      When Java releases Virtual Thread we may be able to use as follows
       
       public static final Executor EXECUTOR = Executors.newVirtualThreadExecutor();
       sharedTagContent.setExecutor(EXECUTOR);
       
                       
      Since:
      3.0.15
    • setContent

      public void setContent(T content)
      Parameters:
      content - content to be reflected in all consuming tags.
      Since:
      3.0.6
    • setContent

      public void setContent(SharedTagContent.UpdateClientNature updateClientNature, T content)
      Parameters:
      updateClientNature - If this SharedTagContent object has to update content of tags from multiple BrowserPage instances, UpdateClientNature.ALLOW_ASYNC_PARALLEL will allow parallel operation in the background for pushing changes to client browser page and UpdateClientNature.ALLOW_PARALLEL will allow parallel operation but will wait for the push to finish to exit the setContent method. UpdateClientNature.SEQUENTIAL will sequentially do each browser page push operation.
      content - content to be reflected in all consuming tags.
      Since:
      3.0.6
    • setContent

      public void setContent(T content, boolean contentTypeHtml)
      Parameters:
      content - content to be reflected in all consuming tags
      contentTypeHtml - true if the content type is HTML or false if plain text
      Since:
      3.0.6
    • setContent

      public void setContent(SharedTagContent.UpdateClientNature updateClientNature, T content, boolean contentTypeHtml)
      Parameters:
      updateClientNature - If this SharedTagContent object has to update content of tags from multiple BrowserPage instances, UpdateClientNature.ALLOW_ASYNC_PARALLEL will allow parallel operation in the background for pushing changes to client browser page and UpdateClientNature.ALLOW_PARALLEL will allow parallel operation but will wait for the push to finish to exit the setContent method. UpdateClientNature.SEQUENTIAL will sequentially do each browser page push operation.
      content - content to be reflected in all consuming tags
      contentTypeHtml - true if the content type is HTML or false if plain text
      Since:
      3.0.6
    • setContent

      public void setContent(Set<AbstractHtml> exclusionTags, T content)
      Parameters:
      exclusionTags - tags to be excluded only from client update. It means that the content of all consumer tags will be kept updated at server side so their content content formatter and change listeners will be invoked.
      content -
      Since:
      3.0.6
    • setContent

      public void setContent(Set<AbstractHtml> exclusionTags, T content, boolean contentTypeHtml)
      Parameters:
      exclusionTags - tags to be excluded only from client update. It means that the content of all consumer tags will be kept updated at server side so their content content formatter and change listeners will be invoked.
      content -
      contentTypeHtml -
      Since:
      3.0.6
    • detach

      public void detach(Set<AbstractHtml> exclusionTags)
      Detaches without removing contents from consuming tags.
      Parameters:
      exclusionTags - excluded tags from detachment of this SharedTagConent object
      Since:
      3.0.6
    • detach

      public void detach(boolean removeContent)
      Parameters:
      removeContent - true to remove content from the attached tags or false not to remove but will detach
      Since:
      3.0.6
    • detach

      public void detach(boolean removeContent, Set<AbstractHtml> exclusionTags)
      Parameters:
      removeContent - true to remove content from the attached tags or false not to remove but will detach
      exclusionTags - excluded tags from detachment of this SharedTagConent object
      Since:
      3.0.6
    • detach

      public void detach(boolean removeContent, Set<AbstractHtml> exclusionTags, Set<AbstractHtml> exclusionClientUpdateTags)
      Parameters:
      removeContent - true to remove content from the attached tags or false not to remove but will detach
      exclusionTags - excluded tags from detachment of this SharedTagConent object
      exclusionClientUpdateTags - these tags will be excluded for client update
      Since:
      3.0.6
    • addContentChangeListener

      public void addContentChangeListener(AbstractHtml tag, SharedTagContent.ContentChangeListener<T> contentChangeListener)
      Parameters:
      tag - the tag on which the content change to be listened
      contentChangeListener - to be added
      Since:
      3.0.6, 3.0.18 the contentChangeListener object will be removed from this SharedTagContent when the tag is detached from this SharedTagContent.
    • addDetachListener

      public void addDetachListener(AbstractHtml tag, SharedTagContent.DetachListener<T> detachListener)
      Parameters:
      tag -
      detachListener -
      Since:
      3.0.6, 3.0.18 the detachListener object will be removed from this SharedTagContent when the tag is detached from this SharedTagContent.
    • removeContentChangeListener

      public void removeContentChangeListener(SharedTagContent.ContentChangeListener<T> contentChangeListener)
      NB: this method will traverse through all consumer tags of this SharedTagContent instance.
      Parameters:
      contentChangeListener - to be removed from all linked tags
      Since:
      3.0.6
    • removeContentChangeListener

      public void removeContentChangeListener(AbstractHtml tag, SharedTagContent.ContentChangeListener<T> contentChangeListener)
      Parameters:
      tag - the tag from which the listener to be removed
      contentChangeListener - to be removed
      Since:
      3.0.6
    • removeDetachListener

      public void removeDetachListener(SharedTagContent.DetachListener<T> detachListener)
      NB: this method will traverse through all consumer tags of this SharedTagContent instance.
      Parameters:
      detachListener - to be removed from all linked tags
      Since:
      3.0.6
    • removeDetachListener

      public void removeDetachListener(AbstractHtml tag, SharedTagContent.DetachListener<T> detachListener)
      Parameters:
      tag -
      detachListener -
      Since:
      3.0.6
    • removeContentChangeListeners

      public void removeContentChangeListeners(AbstractHtml tag, Collection<SharedTagContent.ContentChangeListener<T>> contentChangeListeners)
      Parameters:
      tag - the tag from which the listener to be removed
      contentChangeListeners - to be removed
      Since:
      3.0.6
    • removeDetachListeners

      public void removeDetachListeners(AbstractHtml tag, Collection<SharedTagContent.DetachListener<T>> detachListeners)
      Parameters:
      tag -
      detachListeners -
      Since:
      3.0.6
    • removeAllContentChangeListeners

      public void removeAllContentChangeListeners(AbstractHtml tag)
      Parameters:
      tag - the tag from which all listeners to be removed
      Since:
      3.0.6
    • removeAllContentChangeListeners

      public void removeAllContentChangeListeners()
      all listeners will be removed from all tags
      Since:
      3.0.6
    • removeAllDetachListeners

      public void removeAllDetachListeners(AbstractHtml tag)
      Parameters:
      tag - the tag from which all listeners to be removed
      Since:
      3.0.6
    • removeAllDetachListeners

      public void removeAllDetachListeners()
      all listeners will be removed from all tags
      Since:
      3.0.6
    • getContentFormatter

      public SharedTagContent.ContentFormatter<T> getContentFormatter(AbstractHtml tag)
      Parameters:
      tag - the tag whose ContentFormatter to be got.
      Returns:
      the ContentFormatter object set for the given tag.
      Since:
      3.0.11
    • getContentChangeListeners

      public Set<SharedTagContent.ContentChangeListener<T>> getContentChangeListeners(AbstractHtml tag)
      Parameters:
      tag - tag from which the listeners to be got.
      Returns:
      the ContentChangeListeners for the given tag.
      Since:
      3.0.11
    • getDetachListeners

      public Set<SharedTagContent.DetachListener<T>> getDetachListeners(AbstractHtml tag)
      Parameters:
      tag - tag from which the listeners to be got.
      Returns:
      the DetachListeners for the given tag.
      Since:
      3.0.11
    • clearTempCache

      public void clearTempCache()
      Clears the unwanted objects from the temporary cache only if required. The unwanted objects are automatically cleared from the temp cache but this method is for manually clearing it.
      Since:
      3.0.18