Package net.buffalo.service.defaults

Examples of net.buffalo.service.defaults.ServiceHolder


  /**
   * Get the service via service id
   */
  public Object get(String serviceId) {
    Object serviceInstance = null;
    ServiceHolder s = (ServiceHolder) (services.get(serviceId));
    if (s == null) {
      throw new NoSuchServiceException(serviceId);
    }
   
    if (s.getFactoryId().equals(ServiceFactory.DEFAULT)) {
      serviceInstance = simpleFactory.getService(s.getServiceId(), s.getServiceName());
    } else if (s.getFactoryId().equals(ServiceFactory.SPRING)) {
      if (springAvailable()) {
        serviceInstance = springFactory.getService(s.getServiceId(), s.getServiceName());
      }
    } else {
      // ommited, should throw NoSuchServiceFactoryException
    }
   
View Full Code Here


 
  /**
   * register a service
   */
  public void register(String serviceId, String serviceName, String factoryId) {
    services.put(serviceId, new ServiceHolder(serviceId, serviceName, factoryId));
  }
View Full Code Here

TOP

Related Classes of net.buffalo.service.defaults.ServiceHolder

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.