Class DispatchContext

    • Field Detail

      • module

        public static final String module
    • Constructor Detail

      • DispatchContext

        public DispatchContext​(String name,
                               ClassLoader loader,
                               LocalDispatcher dispatcher)
        Creates new DispatchContext as an immutable object. The "dispatcher" argument can be null if the "name" argument matches the name of a valid entity model reader. The thread safety of a DispatchContext object is a consequence of its immutability.
        Parameters:
        name - The immutable name of the DispatchContext
        loader - The immutable class loader
        dispatcher - The immutable dispatcher associated to the DispatchContext
    • Method Detail

      • getClassLoader

        public ClassLoader getClassLoader()
        Gets the classloader of this context
        Returns:
        ClassLoader of the context
      • getName

        public String getName()
        Gets the name of the local dispatcher
        Returns:
        String name of the LocalDispatcher object
      • getDispatcher

        public LocalDispatcher getDispatcher()
        Gets the LocalDispatcher used with this context
        Returns:
        LocalDispatcher that was used to create this context
      • getDelegator

        public Delegator getDelegator()
        Gets the Delegator associated with this context/dispatcher
        Returns:
        Delegator associated with this context
      • getSecurity

        public Security getSecurity()
        Gets the Security object associated with this dispatcher
        Returns:
        Security object associated with this dispatcher
      • makeValidContext

        public Map<String,​Object> makeValidContext​(String serviceName,
                                                         String mode,
                                                         Map<String,​? extends Object> context)
                                                  throws GenericServiceException
        Uses an existing map of name value pairs and extracts the keys which are used in serviceName Note: This goes not guarantee the context will be 100% valid, there may be missing fields
        Parameters:
        serviceName - The name of the service to obtain parameters for
        mode - The mode to use for building the new map (i.e. can be IN or OUT)
        context - The initial set of values to pull from
        Returns:
        Map contains any valid values
        Throws:
        GenericServiceException
      • makeValidContext

        public static Map<String,​Object> makeValidContext​(ModelService model,
                                                                String mode,
                                                                Map<String,​? extends Object> context)
                                                         throws GenericServiceException
        Uses an existing map of name value pairs and extracts the keys which are used in serviceName Note: This goes not guarantee the context will be 100% valid, there may be missing fields
        Parameters:
        model - The ModelService object of the service to obtain parameters for
        mode - The mode to use for building the new map (i.e. can be IN or OUT)
        context - The initial set of values to pull from
        Returns:
        Map contains any valid values
        Throws:
        GenericServiceException
      • getAllServiceNames

        public Set<String> getAllServiceNames()