// check whether the service has been mapped in configuration
if (serviceDataMap.containsKey(serviceName))
{
// get service data from configuration mapping
ServiceData serviceData = serviceDataMap.get(serviceName);
// check whether the operation has been mapped in configuration
if (serviceData.getOperations().containsKey(operationName))
{
// get operation data from configuration mapping
OperationData operationData = serviceData.getOperations().get(operationName);
try
{
// create an instance of the operation handler setup in configuration
operationHandler = (OperationHandler)operationData.getClassType().newInstance();
}
catch (Exception ex)
{
SimpleLogger.Write("Reflection error!");
SimpleLogger.Write(ex);
// setup the handler for unavailable operations as a default
operationHandler = new UnavailableOperationHandler();
}
}
else
{
SimpleLogger.Write("Operation [" + operationName + "] in Service [" + serviceName + "] not mapped in configuration!");
SimpleLogger.Write(String.valueOf(serviceData.getOperations().size()));
// setup the handler for unavailable operations as a default
operationHandler = new UnavailableOperationHandler();
}
}