View Javadoc

1   package com.sourceforge.jpatterns.core.configuration;
2   
3   import com.sourceforge.jpatterns.core.configuration.model.JPatternsConfigsBean;
4   
5   import java.io.File;
6   import java.util.List;
7   
8   /**
9    * This interface is a single entry point for the castor based configuration would be used to provide the framework with the working
10   * data. This interface would be used for the both purposes:
11   * <ul>
12   * <li>First one is to obtain the system configuration which would be used for the making the framework configured itself - the
13   * idea of this self configuration is as follows. First of all the initial stuff to be configured is obtained using the properties
14   * file, but then when the "factory" pattern would implemented (meaning at the appropriate layer of JPatterns, cause we can not
15   * use it here for example), we would be able to use JPatterns mechanisms itself to allow configuring the system effectively</li>
16   * <li>The second case is when JPatterns would be used by the user - then we should provide the way to another stuff of the
17   * JPatterns to receive the configuration to be used later</li>
18   * </ul>
19   * <br/>
20   * The implementations of this interface could deal also with the overriden files/folders(where to search for the JPatterns
21   * configuration). This overriding could be done via JVM and default properties files. It would allow to the user to override
22   * everything though the properties files, through JVM params etc.
23   * <br/>
24   * Please review the ways use of the framework is able to customize the behaviour of the system:
25   * <br/>
26   * The instance we need to use is configured at the
27   * properties file, so there is a way for the developer to override this implementation by the custom one.
28   * todo [zmicer]: pleaes think over how to configure this through the properties files at the PropertiesBasedFactory - currently it is not
29   * done in this way
30   *
31   * $Author:: zmicer             $<br/>
32   * $Rev:: 57                    $<br/> * $Date:: 2007-08-23 09:16:37 #$<br/>
33   * $Date:: 2007-08-23 09:16:37 #$<br/>
34   */
35  public interface IJPConfigurator
36  {
37      /**
38       * @return the name of the configuration file is used for the configuration of the working JPatterns itself
39       * <br/>
40       * Please review the Java Docs of the concrete implementation to obtain the algorithms for getting this name.
41       */
42      String getJPatternsFrameworkConfigurationFileName();
43  
44      /**
45       * @return the name of the configuration file is used for the configuration of the working JPatterns itself (custom configuration)
46       * Returns the custom configuration.
47       */
48      String getJPatternsFrameworkCustomConfigurationFileName();
49  
50      /**
51       * @return the List of String objects representing the configuration file names is provided by the consumers of the JPatterns
52       * (simply speaking the configuration of the third party factories, and another patterns, the configuration which is necessary to
53       * be parsed by JPatterns to make this framework help other developers - consumers of the framework)
54       */
55      List<File> getJPatternsConsumerConfigurationFiles();
56  
57      /**
58       * @return the List of String objects representing the configuration file names is provided by the consumers of the JPatterns
59       * (simply speaking the configuration of the third party factories, and another patterns, the configuration which is necessary to
60       * be parsed by JPatterns to make this framework help other developers - consumers of the framework).
61       * <br/>
62       * Returns the custom configuration.
63       */
64      List<File> getJPatternsConsumerCustomConfigurationFiles();
65  
66      /**
67       * @return true in the case the default XML framework configuration is presents.
68       */
69      boolean defaultJPatternsFrameworkConfigurationPresents();
70  
71      /**
72       * @return true in the case the system custom configuration is presents (the value was provided via the JVM parameter
73       * using the
74       * <code>com.sourceforge.jpatterns.core.JPConstants.XMLConfigFilesConstants.CUSTOM_XML_FRAMEWORK_CONFIG_FILE_NAME_JVM_PARAM</code>
75       * or this file with the name
76       * <code>com.sourceforge.jpatterns.core.JPConstants.XMLConfigFilesConstants.CUSTOM_XML_FRAMEWORK_CONFIG_FILE_NAME</code> exists)
77       */
78      boolean customJPatternsFrameworkConfigurationPresents();
79  
80      /**
81       * @return true in the case the default XML framework configuration is presents.
82       */
83      boolean defaultJPatternsConsumerConfigurationPresents();
84  
85      /**
86       * @return true in the case the system custom configuration is presents (the value was provided via the JVM parameter
87       * using the
88       * <code>com.sourceforge.jpatterns.core.JPConstants.XMLConfigFilesConstants.CUSTOM_XML_FRAMEWORK_CONFIG_FILE_NAME_JVM_PARAM</code>
89       * or this file with the name
90       * <code>com.sourceforge.jpatterns.core.JPConstants.XMLConfigFilesConstants.CUSTOM_XML_FRAMEWORK_CONFIG_FILE_NAME</code> exists)
91       */
92      boolean customJPatternsConsumerConfigurationPresents();
93  
94      /**
95       * @return the entry point for the system configuration is used for the JPatterns itself.
96       * <br/>
97       * Please be noticed this configuration is a merged one: the default and custom configuration are used
98       */
99      JPatternsConfigsBean getJPatternsFrameworkConfiguration();
100 
101     /**
102      * @return the JPatternsConfig storing all the users configuration.
103      * <br/>
104      * Please be noticed this configuration is a merged one: the default and custom configuration files are used (there are lots of
105      * the configurations files could be at the default pathes and at the custom specific pathes)
106      */
107     JPatternsConfigsBean getJPatternsConsumerConfiguration();
108 }
109