Class CefObjectFactory

java.lang.Object
provided.owlMaps.cefUtils.impl.CefObjectFactory
All Implemented Interfaces:
ICefObjectFactory

public class CefObjectFactory
extends java.lang.Object
implements ICefObjectFactory
*** FOR INTERNAL USE ONLY!! DEVELOPER CODE SHOULD NEVER USE THIS CLASS DIRECTLY! ***
An concrete factory for instantiating new ICefObjects
Author:
swong
  • Field Summary

    Fields
    Modifier and Type Field Description
    static java.lang.String CEF_OBJECT_CALL
    The name of the Javascript method to make a method call on CEF accessible object that has a return value
    static java.lang.String CEF_OBJECT_CALL_VOID
    The name of the Javascript method to make a method call on CEF accessible object that has a void return
    static java.lang.String CEF_OBJECT_GET
    The name of the Javascript method to make a property gettor call on CEF accessible object
    static java.lang.String CEF_OBJECT_SET
    The name of the Javascript method to make a property settor call on CEF accessible object
    private ICefUtils cefUtils
    CEF utilities for internal use.
    static java.lang.String MAKE_CEF_OBJECT
    The name of the Javascript method to make a CEF accessible object
    private java.util.Map<java.util.UUID,​java.util.function.Consumer<java.util.UUID>> newObjQueue
    A map of IDs to processing functions for objects pending instantiation on the Javascript side.
  • Constructor Summary

    Constructors
    Constructor Description
    CefObjectFactory​(ICefUtils cefUtils)
    Construct a new factory instance
  • Method Summary

    Modifier and Type Method Description
    ICefObject make​(java.lang.String jsClassname, java.lang.Object... params)
    *** FOR INTERNAL USE ONLY!! DEVELOPER CODE SHOULD NEVER USE THIS METHOD DIRECTLY! ***
    Instantiate a new ICefObject given a JavaScript classname and constructor parameters
    private ICefObject make​(java.util.function.Supplier<java.util.UUID> getIdFn)
    Instantiate a new ICefObject instance given a Supplier of its ID value.
    ICefObject make​(java.util.UUID id)
    *** FOR INTERNAL USE ONLY!! DEVELOPER CODE SHOULD NEVER USE THIS METHOD DIRECTLY! ***
    Instantiate a new ICefObject with a known ID value
    void serviceObjectReturn​(java.util.UUID requestId, java.util.UUID cefObjId)
    *** FOR INTERNAL USE ONLY!! DEVELOPER CODE SHOULD NEVER USE THIS METHOD DIRECTLY! ***
    Service the the returned CEF object ID associated with the given request ID.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAKE_CEF_OBJECT

      public static final java.lang.String MAKE_CEF_OBJECT
      The name of the Javascript method to make a CEF accessible object
      See Also:
      Constant Field Values
    • CEF_OBJECT_SET

      public static final java.lang.String CEF_OBJECT_SET
      The name of the Javascript method to make a property settor call on CEF accessible object
      See Also:
      Constant Field Values
    • CEF_OBJECT_GET

      public static final java.lang.String CEF_OBJECT_GET
      The name of the Javascript method to make a property gettor call on CEF accessible object
      See Also:
      Constant Field Values
    • CEF_OBJECT_CALL

      public static final java.lang.String CEF_OBJECT_CALL
      The name of the Javascript method to make a method call on CEF accessible object that has a return value
      See Also:
      Constant Field Values
    • CEF_OBJECT_CALL_VOID

      public static final java.lang.String CEF_OBJECT_CALL_VOID
      The name of the Javascript method to make a method call on CEF accessible object that has a void return
      See Also:
      Constant Field Values
    • newObjQueue

      private java.util.Map<java.util.UUID,​java.util.function.Consumer<java.util.UUID>> newObjQueue
      A map of IDs to processing functions for objects pending instantiation on the Javascript side. Entries MUST be removed from the queue once they have been processed!
    • cefUtils

      private ICefUtils cefUtils
      CEF utilities for internal use.
  • Constructor Details

    • CefObjectFactory

      public CefObjectFactory​(ICefUtils cefUtils)
      Construct a new factory instance
      Parameters:
      cefUtils - The CEF utilties for internal use. Be careful about circular calls between this factory and the utilities!
  • Method Details

    • make

      private ICefObject make​(java.util.function.Supplier<java.util.UUID> getIdFn)
      Instantiate a new ICefObject instance given a Supplier of its ID value. The use of a Supplier here decouples this process from whether or not the ID value is available synchronously or asynchronously.
      Parameters:
      getIdFn - A Supplier of the ID value
      Returns:
      A new ICefObject instance
    • make

      public ICefObject make​(java.lang.String jsClassname, java.lang.Object... params)
      Description copied from interface: ICefObjectFactory
      *** FOR INTERNAL USE ONLY!! DEVELOPER CODE SHOULD NEVER USE THIS METHOD DIRECTLY! ***
      Instantiate a new ICefObject given a JavaScript classname and constructor parameters
      Specified by:
      make in interface ICefObjectFactory
      Parameters:
      jsClassname - The JavaScript classname for the new object. Use empty string for generic Javascript object
      params - The constructor parameters for the class
      Returns:
      A new ICefObject instance
    • make

      public ICefObject make​(java.util.UUID id)
      Description copied from interface: ICefObjectFactory
      *** FOR INTERNAL USE ONLY!! DEVELOPER CODE SHOULD NEVER USE THIS METHOD DIRECTLY! ***
      Instantiate a new ICefObject with a known ID value
      Specified by:
      make in interface ICefObjectFactory
      Parameters:
      id - The ID for the new ICefObject
      Returns:
      A new ICefObject instance
    • serviceObjectReturn

      public void serviceObjectReturn​(java.util.UUID requestId, java.util.UUID cefObjId)
      Description copied from interface: ICefObjectFactory
      *** FOR INTERNAL USE ONLY!! DEVELOPER CODE SHOULD NEVER USE THIS METHOD DIRECTLY! ***
      Service the the returned CEF object ID associated with the given request ID.
      Specified by:
      serviceObjectReturn in interface ICefObjectFactory
      Parameters:
      requestId - The request ID for the object creation process
      cefObjId - The ID of the created CEF object.