1 package net.sf.crispy.server;
2
3 import java.lang.reflect.Method;
4
5 import net.sf.crispy.InterceptorHandler;
6
7 /**
8 * This is the entry point on the server side for the transport provider.
9 * This is the complement to the Proxy on the client side (created from the
10 * <code>ServiceManage</code>).
11 *
12 * @author Linke
13 *
14 * @since 1.1.0
15 *
16 */
17 public interface ServiceEndpoint {
18
19 /**
20 * Set a implementation for the interface <code>InterceptorHandlerCreator</code>. It is
21 * equally with the method <code>createNewInterceptorHandlerInstance</code>.
22 * @param pvCreator
23 */
24 public void setInterceptorHandlerCreator(InterceptorHandlerCreator pvCreator);
25
26 /**
27 * Get a implementation for the interface <code>InterceptorHandlerCreator</code>.
28 * @return The <code>InterceptorHandlerCreator</code> implementation.
29 */
30 public InterceptorHandlerCreator getInterceptorHandlerCreator();
31
32 /**
33 * <b>Hint:</b>Every call from this method <b>must get a new instance</b> from <code>InterceptorHandler</code>!
34 *
35 * @return The desired implementation with registered interceptors.
36 */
37 public InterceptorHandler createNewInterceptorHandlerInstance();
38
39
40 /**
41 * Execute the service with the <code>InvocationHandler</code> with delegate to <code>doInvoke</code>.
42 * If parameter <code>InterceptorHandler</code> is <code>null</code>, then is calling the method <code>createNewInterceptorHandlerInstance</code>,
43 * else is using the parameter <code>InterceptorHandler</code>.
44 *
45 * @param pvServiceImpl
46 * @param pvMethod
47 * @param pvArgs
48 * @param pvInterceptorHandler
49 *
50 * @return The result from the method execution.
51 */
52 public Object doInvoke(Object pvServiceImpl, Method pvMethod, Object[] pvArgs, InterceptorHandler pvInterceptorHandler);
53
54 }