01: package com.jat.business;
02:
03: import com.jat.integration.IntegrationException;
04: import java.io.Serializable;
05:
06: /**
07: * <p>Title: JAT</p>
08: * <p>Description: This class is a factory to get a list of Business Object ({@link com.jat.business.BusinessObjectList}).
09: * <br/> Is possible to obtain a list of Business Object using {@link getBusinessObjectList} methods from an instance of this class.
10: * </p>
11: * <p>
12: * If you want to build your own Business Object, you must create:
13: * <ul>
14: * <li>The Business Object extending {@link com.jat.business.BusinessObject} class</li>
15: * <li>The Business Object Factory extending {@link com.jat.business.BusinessObjectFactory} class</li>
16: * <li>The Business Object List object extending {@link com.jat.business.BusinessObjectList} class</li>
17: * </ul>
18: * </p>
19: * <p>Copyright: Copyright (c) 2004 -2005 Stefano Fratini (stefano.fratini@gmail.com)</p>
20: * <p>Distributed under the terms of the GNU Lesser General Public License, v2.1 or later</p>
21: * @author stf
22: * @version 1.2
23: * @since 1.0
24: * @see com.jat.business.BusinessObject
25: * @see com.jat.business.BusinessObjectList
26: */
27:
28: public abstract class BusinessObjectFactory implements Serializable {
29:
30: /**
31: * Return a list of business object loaded from a data source by an operation using the specific properties
32: * @param dataSourceName the configured data source (see {@link com.jat.integration.DataSource} configuration)
33: * @param name the operation name of the data source (see {@link com.jat.integration.DataSource} configuration)
34: * @param properties the list of property used by the specified operation. It can be null.
35: * @return the list of Business Object matching with properties in the operation of the data source
36: * @throws java.lang.Exception if an error occours
37: */
38: public final BusinessObjectList getBusinessObjectList(
39: String dataSourceName, String name,
40: BusinessObjectProperties properties)
41: throws IntegrationException, BusinessException {
42: return BusinessObjectList.getBusinessObjectList(this ,
43: dataSourceName, name, properties);
44: }
45:
46: /**
47: * Return a list of business object loaded from a data source by an operation
48: * @param dataSourceName the configured data source (see {@link com.jat.integration.DataSource} configuration)
49: * @param name the operation name of the data source (see {@link com.jat.integration.DataSource} configuration)
50: * @return the list of Business Object matching loaded by the operation of the data source
51: * @throws java.lang.Exception if an error occours
52: */
53: public final BusinessObjectList getBusinessObjectList(
54: String dataSourceName, String name)
55: throws BusinessException, IntegrationException {
56: return getBusinessObjectList(dataSourceName, name, null);
57: }
58:
59: /**
60: * return a Business Object List from a set of properties.
61: * <br/>Implement this method to build a new instance of your Business Object List
62: * using the constructor with data source name and {@link com.jat.BusinessObjectPropertyList}
63: * @param dataSourceName the configured data source (see {@link com.jat.integration.DataSource} configuration)
64: * @param properties the list of properties
65: * @return a new instance of a Business Object List implementation
66: */
67: protected abstract BusinessObjectList getBusinessObjectList(
68: String dataSourceName, BusinessObjectPropertyList properties);
69:
70: /** @link dependency
71: * @stereotype instantiate*/
72: /*# BusinessObjectList lnkBusinessObjectList; */
73:
74: /** @link dependency
75: * @stereotype use*/
76: /*# com.jat.integration.DataSourceFactory lnkDataSourceFactory; */
77: }
|