private synchronized void setup(Module contributingModule)
{
if (_factory == null)
{
ServicePoint factoryPoint = contributingModule.getServicePoint(_factoryServiceId);
_factory = (ServiceInterceptorFactory) factoryPoint
.getService(ServiceInterceptorFactory.class);
ServicePointDefinition spd = factoryPoint.getServicePointDefinition();
if (!(spd instanceof XmlServicePointDefinitionImpl)) {
// TODO annotations: Externalize message
throw new ApplicationRuntimeException("ServicePoint used as InterceptorFactory must be of type XmlServicePointDefinitionImpl");
}
XmlServicePointDefinitionImpl xmlServicePoint = (XmlServicePointDefinitionImpl) spd;
Schema schema = xmlServicePoint.getParametersSchema();
if (schema != null) {
SchemaProcessorImpl processor = new SchemaProcessorImpl(factoryPoint.getErrorLog(),
schema);
_convertedParameters = constructParametersContainer(schema.getRootElementClassName(), factoryPoint.getModule());
processor.process(_convertedParameters, _parameters, contributingModule);
}
}
}