1 package net.sf.crispy.server; 2 3 /** 4 * 5 * Container for the service implementation. This is a mapping from service-interface to the service-implementation. 6 * The service instance exist once. They must be Thread safe. 7 * 8 * @author Linke 9 * 10 * @since 1.1.0 11 */ 12 public interface SingleServiceContainer { 13 14 /** 15 * Add service implementation. 16 * 17 * @param pvServiceInterfaceName Is the key in a map. 18 * @param pvServiceImpl Is the value in a map. 19 */ 20 public abstract void addService(String pvServiceInterfaceName, 21 Object pvServiceImpl); 22 23 /** 24 * Create a instance from the service impl class name. 25 * 26 * @param pvServiceInterfaceName Is the key in a map. 27 * @param pvServiceImplName Is the class name from the service impl. 28 */ 29 public abstract void addService(String pvServiceInterfaceName, 30 String pvServiceImplName); 31 32 /** 33 * Remove the service from the container. 34 * 35 * @param pvServiceInterfaceName Is the key in a map. 36 */ 37 public abstract void removeService(String pvServiceInterfaceName); 38 39 /** 40 * Find the service impl. 41 * 42 * @param pvServiceInterfaceName Is the key in a map. 43 * @return The service impl or <code>null</code>. 44 */ 45 public abstract Object getService(String pvServiceInterfaceName); 46 47 /** 48 * Size of services in the container. 49 * @return Size of services. 50 */ 51 public abstract int getServiceSize(); 52 53 }