Package org.apache.ofbiz.service
Class DispatchContext
java.lang.Object
org.apache.ofbiz.service.DispatchContext
- All Implemented Interfaces:
Serializable
Dispatcher Context
- See Also:
-
Constructor Summary
ConstructorDescriptionDispatchContext
(String name, ClassLoader loader, LocalDispatcher dispatcher) Creates new DispatchContext as an immutable object. -
Method Summary
Modifier and TypeMethodDescriptionGets all service names.Gets the classloader of this contextGets the Delegator associated with this context/dispatcherGets the LocalDispatcher used with this contextgetModelService
(String serviceName) Gets the ModelService instance that corresponds to given the namegetName()
Gets the name of the local dispatcherGets the Security object associated with this dispatcherGets wsdl.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 fieldsmakeValidContext
(ModelService model, String mode, Map<String, ? extends Object> context) 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
-
Constructor Details
-
DispatchContext
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 DispatchContextloader
- The immutable class loaderdispatcher
- The immutable dispatcher associated to the DispatchContext
-
-
Method Details
-
getClassLoader
Gets the classloader of this context- Returns:
- ClassLoader of the context
-
getName
Gets the name of the local dispatcher- Returns:
- String name of the LocalDispatcher object
-
getDispatcher
Gets the LocalDispatcher used with this context- Returns:
- LocalDispatcher that was used to create this context
-
getDelegator
Gets the Delegator associated with this context/dispatcher- Returns:
- Delegator associated with this context
-
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 GenericServiceExceptionUses 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 formode
- 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 GenericServiceExceptionUses 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 formode
- 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
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
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 namelocationURI
- the location uri- Returns:
- the wsdl
- Throws:
GenericServiceException
- the generic service exceptionjavax.wsdl.WSDLException
- the wsdl exception
-