View Javadoc
1   package org.codehaus.plexus;
2   
3   /*
4    * Copyright 2001-2006 Codehaus Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import junit.framework.TestCase;
20  
21  /**
22   * This is the start of the sketch which outlines some of the things
23   * I would like to do with components during runtime.
24   *
25   * @author Jason van Zyl
26   *
27   * @version $Id$
28   */
29  public class DyanamicComponentKungFuTest
30      extends TestCase
31  {
32      /**
33       * Component additions during container operation.
34       *
35       * 1. Add a component at runtime
36       *    -> Additions could be made by specifying an URL which will be compatible with Wagon
37       *       and specifically Maven's way of using Wagon.
38       *
39       * 2. Configure the dynamically added component
40       *    -> We need to be able to deal with different flavours of components but we can focus
41       *       on Plexus components to start with. But some components may have meta information
42       *       and some may not like pico components. But one of the first flavours I want to
43       *       support is phoenix components because I specifically need the FTP server.
44       *
45       * 3. Let the component perform its role
46       *
47       * 4. Suspend the component
48       *    a) Define the criteria for which we can suspend a component
49       *       -> When there are no client connections?
50       *       -> Even when there are no connections and a client tries to obtain a connection what do we do?
51       *       -> If we are in desperate need to suspend the component, say for urgent security requirement, and
52       *          clients simply won't bugger off what do we do?
53       *
54       * 5. Reconfigure the component
55       *
56       * 6. Resume the component
57       *
58       * 7. Let the component perform its role
59       *
60       * 8. Release the component
61       */
62      public void testAdditionOfComponentDuringContainerOperation()
63          throws Exception
64      {
65      }
66  
67      /**
68       * Component replacement during container operation.
69       *
70       * This will force the design of a mechanism where the components communicate
71       * with one another via a connector. In order for components to be replaced
72       * dynamically the components cannot be directly coupled to one another.
73       *
74       * How to decide if a component is a suitable replacement given the versions
75       * of the specifications of the component and any required components if the
76       * component is a composite component.
77       *
78       * Definitely need to simulate the connection (a MockConnection) during
79       * runtime to make sure that in the event something goes wrong the container
80       * can just refuse to allow the component substitution. This shouldn't be trial
81       * and error but until much field testing has occurred I'm sure there will be
82       * instances where miscalculations happen simply due to lack of experience and
83       * usage with dynamic component replacement.
84       */
85      public void testComponentReplacementDuringContainerOperation()
86          throws Exception
87      {
88  
89      }
90  }