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 */ 28 public class DyanamicComponentKungFuTest extends TestCase { 29 /** 30 * Component additions during container operation. 31 * 32 * <ol> 33 * <li>Add a component at runtime 34 * <ul> 35 * <li>Additions could be made by specifying an URL which will be compatible with Wagon 36 * and specifically Maven's way of using Wagon.</li> 37 * </ul> 38 * </li> 39 * 40 * <li>Configure the dynamically added component 41 * <ul> 42 * <li>We need to be able to deal with different flavours of components but we can focus 43 * on Plexus components to start with. But some components may have meta information 44 * and some may not like pico components. But one of the first flavours I want to 45 * support is phoenix components because I specifically need the FTP server.</li> 46 * </ul> 47 * </li> 48 * 49 * <li>Let the component perform its role</li> 50 * <li>Suspend the component 51 * <ol type="a"> 52 * <li>Define the criteria for which we can suspend a component 53 * <ul> 54 * <li>When there are no client connections?</li> 55 * <li>Even when there are no connections and a client tries to obtain a connection what do we do?</li> 56 * <li>If we are in desperate need to suspend the component, say for urgent security requirement, and 57 * clients simply won't bugger off what do we do?</li> 58 * </ul> 59 * </li> 60 * </ol> 61 * </li> 62 * 63 * <li>Reconfigure the component</li> 64 * 65 * <li>Resume the component</li> 66 * 67 * <li>Let the component perform its role</li> 68 * 69 * <li>Release the component</li> 70 * </ol> 71 * 72 * @throws Exception in case of a failure. 73 */ 74 public void testAdditionOfComponentDuringContainerOperation() throws Exception {} 75 76 /** 77 * Component replacement during container operation. 78 * 79 * This will force the design of a mechanism where the components communicate 80 * with one another via a connector. In order for components to be replaced 81 * dynamically the components cannot be directly coupled to one another. 82 * 83 * How to decide if a component is a suitable replacement given the versions 84 * of the specifications of the component and any required components if the 85 * component is a composite component. 86 * 87 * Definitely need to simulate the connection (a MockConnection) during 88 * runtime to make sure that in the event something goes wrong the container 89 * can just refuse to allow the component substitution. This shouldn't be trial 90 * and error but until much field testing has occurred I'm sure there will be 91 * instances where miscalculations happen simply due to lack of experience and 92 * usage with dynamic component replacement. 93 * 94 * @throws Exception in case of a failure. 95 */ 96 public void testComponentReplacementDuringContainerOperation() throws Exception {} 97 }