Class DispatchContext

java.lang.Object
org.apache.ofbiz.service.DispatchContext
All Implemented Interfaces:
Serializable

public class DispatchContext extends Object implements Serializable
Dispatcher Context
See Also:
  • Constructor Details

    • 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 Details

    • 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
    • getModelService

      public ModelService getModelService(String serviceName) throws GenericServiceException
      Gets the ModelService instance that corresponds to given the name
      Parameters:
      serviceName - Name of the service
      Returns:
      GenericServiceModel that corresponds to the serviceName
      Throws:
      GenericServiceException
    • getAllServiceNames

      public Set<String> getAllServiceNames()
      Gets all service names.
      Returns:
      the all service names
    • getWSDL

      public Document getWSDL(String serviceName, String locationURI) throws GenericServiceException, javax.wsdl.WSDLException
      Gets wsdl.
      Parameters:
      serviceName - the service name
      locationURI - the location uri
      Returns:
      the wsdl
      Throws:
      GenericServiceException - the generic service exception
      javax.wsdl.WSDLException - the wsdl exception