1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package javax.xml.rpc.server;
17
18 import javax.xml.rpc.ServiceException;
19
20 /**
21 * The <code>javax.xml.rpc.server.ServiceLifecycle</code> defines a lifecycle interface for a
22 * JAX-RPC service endpoint. If the service endpoint class implements the
23 * <code>ServiceLifeycle</code> interface, the servlet container based JAX-RPC runtime system
24 * is required to manage the lifecycle of the corresponding service endpoint objects.
25 *
26 * @version 1.0
27 */
28 public interface ServiceLifecycle {
29
30 /**
31 * Used for initialization of a service endpoint. After a service
32 * endpoint instance (an instance of a service endpoint class) is
33 * instantiated, the JAX-RPC runtime system invokes the
34 * <code>init</code> method. The service endpoint class uses the
35 * <code>init</code> method to initialize its configuration
36 * and setup access to any external resources. The context parameter
37 * in the <code>init</code> method enables the endpoint instance to
38 * access the endpoint context provided by the underlying JAX-RPC
39 * runtime system.
40 * <p>
41 * The init method implementation should typecast the context
42 * parameter to an appropriate Java type. For service endpoints
43 * deployed on a servlet container based JAX-RPC runtime system,
44 * the <code>context</code> parameter is of the Java type
45 * <code>javax.xml.rpc.server.ServletEndpointContext</code>. The
46 * <code>ServletEndpointContext</code> provides an endpoint context
47 * maintained by the underlying servlet container based JAX-RPC
48 * runtime system
49 * <p>
50 * @param context Endpoint context for a JAX-RPC service endpoint
51 * @throws ServiceException If any error in initialization of the service endpoint; or if any
52 * illegal context has been provided in the init method
53 */
54 public abstract void init(Object context) throws ServiceException;
55
56 /**
57 * JAX-RPC runtime system ends the lifecycle of a service endpoint instance by
58 * invoking the destroy method. The service endpoint releases its resources in
59 * the implementation of the destroy method.
60 */
61 public abstract void destroy();
62 }