View Javadoc

1   package net.sf.crispy;
2   
3   import java.util.Iterator;
4   
5   import net.sf.crispy.concurrent.AsynchronousCallback;
6   
7   /**
8    * Minimun on method for ServiceManager. You can implement your own ServiceManager and delegate all
9    * 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  	public int getInterceptorSize ();
19  	public Interceptor removeInterceptorByPos (int pvPos);
20  	public void addInterceptor (Interceptor pvInterceptor);
21  	
22  	public Modifier getModifier();
23  	public void setModifier(Modifier pvModifier);
24  	
25  	public String getProperty(String pvKey);
26  	public Iterator getPropertyKeys ();
27  
28      /**
29       * Create a Proxy-Instance to the Service-Interface for <b>synchronous</b> invocation.
30       * 
31       * @param pvServiceInterface Service-Interface
32       * 
33       * @return Proxy-Object.
34  	 */
35  	public abstract Object createService(Class pvServiceInterface);
36  	
37      /**
38       * Create a Proxy-Object for <b>asynchronous</b> invocation.
39       *  
40       * @param pvServiceInterface For this Interface is created a Proxy-Object. 
41       * @param pvAsynchronousCallback Hanlder for asynchronous execution.
42       * @param pvMethodFilter Only for method-names in this array are asynchronous execution
43       * @param pvMaxSizeOfThreads Max size of keeping Threads.
44       * 
45       * @return Proxy-Object.
46       */
47      public abstract Object createService(Class pvServiceInterface, 
48      										AsynchronousCallback pvAsynchronousCallback, 
49      										String[] pvMethodFilter, 
50      										int pvMaxSizeOfThreads);
51  
52  
53      /**
54       * Are calls asynchronous.
55       * @param pvServiceInterface Test to asynchronous for this service interface.
56       * @return If asynchronous, than <code>true</code>, else <code>false</code>.
57       */
58      public boolean isInvocationAsynchronous(Class pvServiceInterface);
59      
60      /**
61       * Remove asynchronous callback interface. All execution are synchronous.
62       * @param pvServiceInterface This is apply to this service interface.  
63       */
64      public void removeAsynchronousCallback(Class pvServiceInterface);
65  }