Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/flexstor/flexdbserver/services/Service.java


1   /*
2    * Service.java
3    *
4    * Copyright $Date: 2003/08/11 02:22:38 $ FLEXSTOR.net Inc.
5    *
6    * This work is licensed for use and distribution under license terms found at
7    * http://www.flexstor.org/license.html
8    *
9    */
10  
11  package com.flexstor.flexdbserver.services;
12  
13  import com.flexstor.common.data.ActionData;
14  import com.flexstor.common.data.ActionResult;
15   
16  public interface Service
17  {
18     /**
19      * Calls before the service is initialized (before initData is called) to 
20      * pass information about the environment in which the service is running.
21      * This environment consists of information about the properties set for the
22      * service in one of these files (services.config, roletype_services.config,
23      * or *.ctl), plus methods to access other information such as an instance
24      * of the service broker to invoke other services, the transaction id for
25      * the service, file separator character and local path for the installation
26      * directory and configuration directory.
27      * 
28      * @param context Holds information about the environment in which the service
29      *                is running.
30      */
31     public void setServiceContext(ServiceContext context);
32  
33     /**
34      * A data initialization method called at the beginning of the service.
35      * Not business logic, relevant to the functionality of the service, should be 
36      * added here, other than initializing some variables, etc.
37      * 
38      * @param data Holds the information required for the service to perform its
39      *             task.
40      */
41     public void initData(ActionData data);
42     
43     /**
44      * This methods carries the load of the business logic for the service.
45      * 
46      * @return A ActionResult object with state information after the service is
47      *         executed. It can also hold an updated ActionData object.
48      */
49     public ActionResult go();
50  }