Package org.olat.core.service

Examples of org.olat.core.service.ServiceCreatorFactory


   *
   * @param serviceInterfaceName
   * @return an instance of the service which belongs to exactly this usersession (= user scope)
   */
  public Object getServiceInstance(Class serviceInterfaceName) {
    ServiceCreatorFactory scf = (ServiceCreatorFactory) ServiceFactory.getService(ServiceCreatorFactory.class);
    String key = serviceInterfaceName.getName();
    synchronized(this) { //o_clusterOK by:fj // also helper classes and timers and so on may ask for a service -> sync on instance
      Object cachedService = sessionServiceInstances.get(key);
      if (cachedService == null) {
        cachedService = scf.createNonNullServiceFor(serviceInterfaceName);
        sessionServiceInstances.put(key, cachedService);
      }
      return cachedService;
    }
  }
View Full Code Here

TOP

Related Classes of org.olat.core.service.ServiceCreatorFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.