Class JKContextFactory

java.lang.Object
com.jk.core.context.JKContextFactory

public class JKContextFactory extends Object
This class is a factory used for creating JKContext objects.

It provides methods for creating different types of context objects.

Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Details

    • JKContextFactory

      public JKContextFactory()
  • Method Details

    • getInstance

      protected static JKContextFactory getInstance()
      This method gets the single instance of JKContextFactory class.
      Returns:
      the only instance of JKContextFactory class.
    • setInstance

      public static void setInstance(JKContextFactory instance)
      This method replaces the factory instance with the provided instance.
      Parameters:
      instance - Specifies the new factory instance.
    • createDesktopContext

      public JKContext createDesktopContext()
      This method creates a new desktop context object.
      Returns:
      the new desktop context object.
    • createMobileContext

      public JKMobileContext createMobileContext()
      this method creates a new mobile context object.
      Returns:
      the new mobile context object.
    • createJsfContext

      public JKJsfContext createJsfContext()
      This method creates a new JSF context object.
      Returns:
      the new JSF context object.
    • createJkServletContext

      public JKServletContext createJkServletContext()
      This method creates a new Servlet context object.
      Returns:
      the new servlet context object.
    • getCurrentContext

      public static JKContext getCurrentContext()
      This method gets the current context, if the context is null, it sets it to desktop context before returning it.
      Returns:
      the current context.
    • setCurrentContext

      public static void setCurrentContext(JKContext context)
      This method sets the current context to the specified value.
      Parameters:
      context - Specifies the new current context.