Search in sources :

Example 1 with RequestWriter

use of org.qi4j.library.rest.client.spi.RequestWriter in project qi4j-sdk by Qi4j.

the class RequestWriterDelegator method initialize.

@Override
public void initialize() throws InitializationException {
    Logger logger = LoggerFactory.getLogger(getClass());
    ResourceBundle defaultRequestWriters = ResourceBundle.getBundle("org.qi4j.library.rest.client.rest-client");
    String requestWriterClasses = defaultRequestWriters.getString("requestwriters");
    logger.info("Using request writers:" + requestWriterClasses);
    for (String className : requestWriterClasses.split(",")) {
        try {
            Class writerClass = module.classLoader().loadClass(className.trim());
            RequestWriter requestWriter = (RequestWriter) module.newObject(writerClass);
            registerRequestWriter(requestWriter);
        } catch (ClassNotFoundException e) {
            logger.warn("Could not register request writer " + className, e);
        }
    }
}
Also used : ResourceBundle(java.util.ResourceBundle) RequestWriter(org.qi4j.library.rest.client.spi.RequestWriter) Logger(org.slf4j.Logger)

Aggregations

ResourceBundle (java.util.ResourceBundle)1 RequestWriter (org.qi4j.library.rest.client.spi.RequestWriter)1 Logger (org.slf4j.Logger)1