01: package net.sf.crispy;
02:
03: import java.util.Iterator;
04:
05: import net.sf.crispy.concurrent.AsynchronousCallback;
06:
07: /**
08: * Minimun on method for ServiceManager. You can implement your own ServiceManager and delegate all
09: * calls to the implementation from the ServiceManager. In your own implementation you can (for example) set
10: * default properties or you can hide implementations details (capsule).
11: *
12: * @author Linke
13: *
14: */
15: public interface IServiceManager {
16:
17: public Interceptor getInterceptorByPos(int pvPos);
18:
19: public int getInterceptorSize();
20:
21: public Interceptor removeInterceptorByPos(int pvPos);
22:
23: public void addInterceptor(Interceptor pvInterceptor);
24:
25: public Modifier getModifier();
26:
27: public void setModifier(Modifier pvModifier);
28:
29: public String getProperty(String pvKey);
30:
31: public Iterator getPropertyKeys();
32:
33: /**
34: * Create a Proxy-Instance to the Service-Interface for <b>synchronous</b> invocation.
35: *
36: * @param pvServiceInterface Service-Interface
37: *
38: * @return Proxy-Object.
39: */
40: public abstract Object createService(Class pvServiceInterface);
41:
42: /**
43: * Create a Proxy-Object for <b>asynchronous</b> invocation.
44: *
45: * @param pvServiceInterface For this Interface is created a Proxy-Object.
46: * @param pvAsynchronousCallback Hanlder for asynchronous execution.
47: * @param pvMethodFilter Only for method-names in this array are asynchronous execution
48: * @param pvMaxSizeOfThreads Max size of keeping Threads.
49: *
50: * @return Proxy-Object.
51: */
52: public abstract Object createService(Class pvServiceInterface,
53: AsynchronousCallback pvAsynchronousCallback,
54: String[] pvMethodFilter, int pvMaxSizeOfThreads);
55:
56: /**
57: * Are calls asynchronous.
58: * @param pvServiceInterface Test to asynchronous for this service interface.
59: * @return If asynchronous, than <code>true</code>, else <code>false</code>.
60: */
61: public boolean isInvocationAsynchronous(Class pvServiceInterface);
62:
63: /**
64: * Remove asynchronous callback interface. All execution are synchronous.
65: * @param pvServiceInterface This is apply to this service interface.
66: */
67: public void removeAsynchronousCallback(Class pvServiceInterface);
68: }
|