Search in sources :

Example 1 with CallContextAwareCmisService

use of org.apache.chemistry.opencmis.server.support.wrapper.CallContextAwareCmisService in project iaf by ibissource.

the class RepositoryConnectorFactory method getService.

@Override
public CmisService getService(CallContext context) {
    if (!CMIS_BRIDGE_ENABLED) {
        throw new CmisRuntimeException("CMIS bridge not enabled");
    }
    if (!CmisEventDispatcher.getInstance().hasEventListeners()) {
        throw new CmisRuntimeException("no CMIS bridge events registered");
    }
    LOG.debug("retrieve repository service");
    // Make sure that each thread in the HTTP CONN POOL has it's own BridgedCmisService
    CallContextAwareCmisService service = threadLocalService.get();
    if (service == null) {
        service = new ConformanceCmisServiceWrapper(createService(context));
        threadLocalService.set(service);
        LOG.debug("stored repository service in local http-conn-thread");
    }
    // Update the CallContext
    service.setCallContext(context);
    return service;
}
Also used : CallContextAwareCmisService(org.apache.chemistry.opencmis.server.support.wrapper.CallContextAwareCmisService) CmisRuntimeException(org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException) ConformanceCmisServiceWrapper(org.apache.chemistry.opencmis.server.support.wrapper.ConformanceCmisServiceWrapper)

Aggregations

CmisRuntimeException (org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException)1 CallContextAwareCmisService (org.apache.chemistry.opencmis.server.support.wrapper.CallContextAwareCmisService)1 ConformanceCmisServiceWrapper (org.apache.chemistry.opencmis.server.support.wrapper.ConformanceCmisServiceWrapper)1