Class JakartaAppContext

java.lang.Object
com.oorian.jakarta.JakartaAppContext
All Implemented Interfaces:
AppContext

public class JakartaAppContext extends Object implements AppContext
Adapter that wraps a ServletContext to implement the framework-agnostic AppContext interface.

This class is used by the thin Jakarta library to bridge between the servlet container and the Oorian common library.

Since:
2.1
Version:
1.0
Author:
Oorian Framework
See Also:
  • Constructor Details

    • JakartaAppContext

      public JakartaAppContext(jakarta.servlet.ServletContext context)
      Creates a new adapter wrapping the given servlet context.
      Parameters:
      context - The Jakarta servlet context to wrap.
  • Method Details

    • getContextPath

      public String getContextPath()
      Description copied from interface: AppContext
      Returns the context path of the web application.
      Specified by:
      getContextPath in interface AppContext
      Returns:
      the context path
    • getResourceAsStream

      public InputStream getResourceAsStream(String path)
      Description copied from interface: AppContext
      Returns an input stream for reading the specified resource.
      Specified by:
      getResourceAsStream in interface AppContext
      Parameters:
      path - the resource path (e.g., "/WEB-INF/config.xml")
      Returns:
      an input stream for the resource, or null if not found
    • getRealPath

      public String getRealPath(String path)
      Description copied from interface: AppContext
      Returns the real filesystem path for the specified virtual path.
      Specified by:
      getRealPath in interface AppContext
      Parameters:
      path - the virtual path (e.g., "/WEB-INF/config.xml")
      Returns:
      the real path, or null if the translation cannot be performed
    • getAttribute

      public Object getAttribute(String name)
      Description copied from interface: AppContext
      Returns the value of the named context attribute.
      Specified by:
      getAttribute in interface AppContext
      Parameters:
      name - the attribute name
      Returns:
      the attribute value, or null if not set
    • setAttribute

      public void setAttribute(String name, Object value)
      Description copied from interface: AppContext
      Sets a context attribute.
      Specified by:
      setAttribute in interface AppContext
      Parameters:
      name - the attribute name
      value - the attribute value
    • getInitParameter

      public String getInitParameter(String name)
      Description copied from interface: AppContext
      Returns the value of the named context initialization parameter.
      Specified by:
      getInitParameter in interface AppContext
      Parameters:
      name - the parameter name
      Returns:
      the parameter value, or null if not defined
    • getMimeType

      public String getMimeType(String file)
      Description copied from interface: AppContext
      Returns the MIME type of the specified file, or null if unknown.
      Specified by:
      getMimeType in interface AppContext
      Parameters:
      file - the file name
      Returns:
      the MIME type, or null
    • getDelegate

      public jakarta.servlet.ServletContext getDelegate()
      Returns the underlying Jakarta servlet context.
      Returns:
      The wrapped ServletContext.