Component-based development has become a commonly used technique for building complex software systems by composing a set of existing components. In general adapting an application means stopping the application and restarting it after the adaptation. This approach is not suitable for a large classes of software systems in which continuous availability is a critical requirement, hence the need of adapting dynamically the application at runtime. This paper presents an architecture based approach for dynamic adaptation in critical components based software using multi agent system.To achieve this, we use an agent based system to perform the adaptation. The agent system is guided by an architectural description. The adaptation mechanism is implemented within the connectors using the flexibility offered by the Java script language techniques. The script language Groovy is used. The evaluation is made by comparing the execution time before and after the adaptation mechanism.The paper is structured as follows: section 2 presents related works to dynamic adaptation. Section 3 describes the proposed solution to achieve a dynamic update of components-based software applications. The implementation details and some measurements relative to our solution are given in section 4. Section 5 concludes and presents some perspectives.