Package com.jk.core.context
Class JKContextFactory
java.lang.Object
com.jk.core.context.JKContextFactory
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method creates a new desktop context object.This method creates a new Servlet context object.This method creates a new JSF context object.this method creates a new mobile context object.static JKContext
This method gets the current context, if the context is null, it sets it to desktop context before returning it.protected static JKContextFactory
This method gets the single instance ofJKContextFactory
class.static void
setCurrentContext
(JKContext context) This method sets the current context to the specified value.static void
setInstance
(JKContextFactory instance) This method replaces the factory instance with the provided instance.
-
Constructor Details
-
JKContextFactory
public JKContextFactory()
-
-
Method Details
-
getInstance
This method gets the single instance ofJKContextFactory
class.- Returns:
- the only instance of
JKContextFactory
class.
-
setInstance
This method replaces the factory instance with the provided instance.- Parameters:
instance
- Specifies the new factory instance.
-
createDesktopContext
This method creates a new desktop context object.- Returns:
- the new desktop context object.
-
createMobileContext
this method creates a new mobile context object.- Returns:
- the new mobile context object.
-
createJsfContext
This method creates a new JSF context object.- Returns:
- the new JSF context object.
-
createJkServletContext
This method creates a new Servlet context object.- Returns:
- the new servlet context object.
-
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
This method sets the current context to the specified value.- Parameters:
context
- Specifies the new current context.
-