View Javadoc
1   /*
2    * Copyright 2010 James Pether Sörling
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *   http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   *	$Id$
17   *  $HeadURL$
18  */
19  
20  package com.hack23.cia.service.api;
21  
22  import java.io.Serializable;
23  import java.util.concurrent.Future;
24  
25  import com.hack23.cia.service.api.action.common.ServiceRequest;
26  import com.hack23.cia.service.api.action.common.ServiceResponse;
27  
28  
29  
30  
31  /**
32   * The Interface ApplicationManager.
33   */
34  public interface ApplicationManager {
35  
36  	/**
37  	 * Gets the agent container.
38  	 *
39  	 * @return the agent container
40  	 */
41  	AgentContainer getAgentContainer();
42  
43  	/**
44  	 * Gets the data container.
45  	 *
46  	 * @param <T>
47  	 *            the generic type
48  	 * @param <V>
49  	 *            the value type
50  	 * @param dataObject
51  	 *            the data object
52  	 * @return the data container
53  	 */
54  	<T extends Serializable,V extends Serializable> DataContainer<T,V> getDataContainer(Class<T> dataObject);
55  
56  
57  	/**
58  	 * Service.
59  	 *
60  	 * @param serviceRequest
61  	 *            the service request
62  	 * @return the service response
63  	 */
64  	ServiceResponse service(ServiceRequest serviceRequest);
65  
66  
67  	/**
68  	 * Async service.
69  	 *
70  	 * @param serviceRequest
71  	 *            the service request
72  	 * @return the future
73  	 */
74  	Future<ServiceResponse> asyncService(ServiceRequest serviceRequest);
75  
76  }