Interface IContext

  • public interface IContext
    Defines the context interface. The context defines the following aspects of requests:
    • Which session the request belongs to.
    • Which user executes the request and what roles that user has.
    • What data is available during the request.
    • Security: which attributes and associations are readable.
    • Security: which attributes and associations are writable.
    • How transactions are handled.
    • How data is internationalized (=localized).
    • Method Detail

      • getCurrentIdentifier

        IMendixIdentifier getCurrentIdentifier()
        Returns the Mendix identifier of the current object.
        the Mendix identifier
      • setExecutionId

        void setExecutionId​(java.lang.String requestId)
      • setExecutionThread

        void setExecutionThread​(java.lang.Thread executionThread)
      • getContextObjects

        java.util.List<IMendixIdentifier> getContextObjects()
        Returns the Mendix identifiers of all objects in the context.
        the object identifiers
      • getVariables

        java.util.Map<java.lang.String,​java.lang.Object> getVariables()
      • getSession

        ISession getSession()
        Returns the session for this context.
        the session
      • isInTransaction

        boolean isInTransaction()
        Returns whether a transaction exists, or not.
        true if a transaction exists, false otherwise
      • getTransactionId

        java.util.UUID getTransactionId()
        The identifier of the current transaction (if any). If one exists, all actions are executed within it.
        the transaction identifier if one exists, null otherwise
      • hashCode

        int hashCode()
        hashCode in class java.lang.Object
      • equals

        boolean equals​(java.lang.Object obj)
        equals in class java.lang.Object
      • isSudo

        boolean isSudo()
        Returns whether this context executes without access restrictions.
        false if access restrictions apply, false otherwise
      • startTransaction

        void startTransaction()
        Starts a new transaction for this context. If a transaction already exists for this context, a new savepoint is added. Note that endTransaction() must be called an equal amount of times to properly end the transaction.
      • endTransaction

        void endTransaction()
        Commits the current transaction for this context (if any). This will end this transaction or remove the last save point. This method must be called for each time startTransaction() is called. If no transaction exists, nothing happens.
      • rollbackTransAction

        void rollbackTransAction()
        Rolls back the current transaction for this context (if any). This method will abort the current transaction, regardless of how many times startTransaction() was called. If no transaction exists, nothing happens.
      • getExecutionThread

        java.lang.Thread getExecutionThread()
      • getActionStack

        java.util.Stack<CoreAction<?>> getActionStack()
      • getRequestStartTime

        long getRequestStartTime()
      • getExecutionId

        java.lang.String getExecutionId()
        Returns the current client execution identifier (if set). This is an identifier that is unique within this context.
        the client execution identifier
      • createSudoClone

        IContext createSudoClone()
      • getData

        java.util.Map<java.lang.String,​java.lang.Object> getData()
        Allows attaching data to the scope of the current request (as in web request).
      • getCurrentUserObject

        IMendixObject getCurrentUserObject()
        Return the current user object shared across all cloned contexts.
      • getRuntimeRequest

        java.util.Optional<com.mendix.m2ee.api.IMxRuntimeRequest> getRuntimeRequest()
        Returns the last incoming run-time request.
        the runtime request, or empty if none exists
      • getRuntimeResponse

        java.util.Optional<com.mendix.m2ee.api.IMxRuntimeResponse> getRuntimeResponse()
        Returns the last outgoing run-time response.
        the runtime response, or empty if none exists
      • getSystemConfiguration

        Configuration getSystemConfiguration()
        Returns the configuration of the Mendix runtime.
        the mendix runtime configuration