How To Install apache-commons-chain on CentOS 7

In this tutorial we learn how to install apache-commons-chain on CentOS 7. apache-commons-chain is An implementation of the GoF Chain of Responsibility pattern

Introduction

In this tutorial we learn how to install apache-commons-chain on CentOS 7.

What is apache-commons-chain

A popular technique for organizing the execution of complex processing flows is the “Chain of Responsibility” pattern, as described (among many other places) in the classic “Gang of Four” design patterns book. Although the fundamental API contracts required to implement this design pattern are extremely simple, it is useful to have a base API that facilitates using the pattern, and (more importantly) encouraging composition of command implementations from multiple diverse sources. Towards that end, the Chain API models a computation as a series of “commands” that can be combined into a “chain”. The API for a command consists of a single method (execute()), which is passed a “context” parameter containing the dynamic state of the computation, and whose return value is a boolean that determines whether or not processing for the current chain has been completed (true), or whether processing should be delegated to the next command in the chain (false).

We can use yum or dnf to install apache-commons-chain on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install apache-commons-chain.

Install apache-commons-chain on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install apache-commons-chain using yum by running the following command:

sudo yum -y install apache-commons-chain

Install apache-commons-chain on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install apache-commons-chain using dnf by running the following command:

sudo dnf -y install apache-commons-chain

How To Uninstall apache-commons-chain on CentOS 7

To uninstall only the apache-commons-chain package we can use the following command:

sudo dnf remove apache-commons-chain

References

Summary

In this tutorial we learn how to install apache-commons-chain on CentOS 7 using yum and dnf.