01: package org.osbl.client;
02:
03: import java.util.List;
04:
05: public abstract class ClientServiceProvider {
06: static final ThreadLocal<ClientServiceProvider> INSTANCES = new ThreadLocal<ClientServiceProvider>();
07:
08: public static void setInstance(ClientServiceProvider serviceProvider) {
09: INSTANCES.set(serviceProvider);
10: }
11:
12: public static void unsetInstance() {
13: INSTANCES.remove();
14: }
15:
16: public static ClientServiceProvider getInstance() {
17: return INSTANCES.get();
18: }
19:
20: public abstract List<String> getServiceNames();
21:
22: public abstract Object getService(String name);
23:
24: public abstract <T> T getService(Class<T> type);
25:
26: public abstract void autowireServices(Object bean);
27: }
|