public class ExampleProvider extends AbstractProvider
Constructor and Description |
---|
ExampleProvider(OSService owner) |
Modifier and Type | Method and Description |
---|---|
protected RecommendationItem |
createRecommendationItem(java.lang.String task,
java.lang.String resource)
Creates a recommendation item, with given task name and resource name,
other attributes are randomly generated
|
void |
populateResponse(org.processmining.framework.util.socket.ServiceEnvironment environment,
Request request,
ProviderResponse response)
This is the main request method, which can be used to retrieve
recommendations for specific queries.
|
static Provider |
registerServiceProviderA(org.processmining.framework.plugin.PluginContext context,
OSService service) |
static Provider |
registerServiceProviderAUI(org.processmining.contexts.uitopia.UIPluginContext context,
OSService service) |
getOwner
public ExampleProvider(OSService owner)
public static Provider registerServiceProviderAUI(org.processmining.contexts.uitopia.UIPluginContext context, OSService service)
public static Provider registerServiceProviderA(org.processmining.framework.plugin.PluginContext context, OSService service)
public void populateResponse(org.processmining.framework.util.socket.ServiceEnvironment environment, Request request, ProviderResponse response)
Provider
This is the main request method, which can be used to retrieve recommendations for specific queries. All communication and encoding of parameters can be assumed to be performed in subclasses implementing this interface.
Note: This method may block for an unspecified time, including
network transport and resolving the request on the provider side. Use
this method in a separate thread if you wish your application to remain
responsive.
Also note that the request can fail, both due to transmission errors
(which will yield an IOException
, and due to the provider's
inability to resolve the request (i.e., an error occurred while handling
the issued request, signaled by an ordinary Exception
being
thrown; or, the request did not yield any usable result, which results in
a null
response value.
populateResponse
in interface Provider
populateResponse
in class AbstractProvider
environment
- The context which is monitoring the servicerequest
- The request for recommendations.protected RecommendationItem createRecommendationItem(java.lang.String task, java.lang.String resource)
task
- the task name for the recommendation itemresource
- the resource name