## 1 Introduction
Indeed, typical PF facility environments involve Wireless Sensor and Actuator Networks (WSANs) which consist of numerous sensor nodes for remotely acquiring real-time data about various features concerning the cultivations (i.e., environmental conditions, soil and crop properties), as well as of actuators for enabling the proper physical actions within the PF facilities [29; 38; 39; 40; 41]. However, sensory agricultural data refer to ambient parameters which quite obviously vary within diverse cultivations and distinct locations while they even tend to be modified according to the physiology of the crops, the soil texture and the environmental conditions as in [42]. Hence, due to the amount and the obvious diversity of the acquired raw data it is essential to structure them into processable and interchangeable formats of information to cover all aspects of agricultural exploitations. To address the issue of the extreme heterogeneity of sensory raw data acquired in agricultural environments and facilitate the complexity of developing a higher IoT level in a dynamically integrated PF system, a context-aware middleware-centric solution is regarded to be the most suitable one, as context awareness offers the competence of representing static or dynamic changes, comprehending the situational context of the acquired data and providing services compatible to all stakeholders' specialized needs [43; 44; 45; 46; 47]. Let it be noted that in this research the term \"context\" is attributed to agriculture context referring to the combination of plant, place, environment, and sensor device information. Consequently, taking into account that agricultural environments generate enormous amounts of diverse information which correspond to massive context spaces, while on the other hand the development of novel smart infrastructures is constantly increasing the demand for more complex intelligent services, the performance of such operations into local middleware components, could result into unscalable and deficient systems. Given the fact that cloud computing is a trend of information technology which offers centralized storage and processing power along with on demand availability of services [48; 49; 50], it is thought as deliberate to transpose context-aware middleware operations from local servers or smart devices to a distributed cloud environment for facilitating the management of  
Figure 1: Generalized concept of whole-farm management for Agriculture 4.0.  
such voluminous amounts of agricultural data, improving the processing time of context generation and expanding the capability to provide complex specialized services. This research article is keen to approach the aforementioned issues by presenting a complete cloud-based, context-aware middleware solution, as part of a responsive and adaptive context sensitive IoT integrated system, capable of delivering a wide variety of services in order to facilitate farm management. To this end, the introduced system framework adopts a layered hierarchical structure consisting of a PF facility (as the lower level) and three main cloud-based components (context-aware middleware cloud, services cloud and social network cloud) at the higher level. According to this structure all of the system's functional elements cope with context, while the operation of context awareness is accomplished into a cloud-based distributed middleware component which is the core of the entire system acting as a Decision Support System (DSS). It is considered that employing such an approach will enhance the scalability and flexibility of agricultural operations, by handling simultaneously large amounts of heterogeneous sensory raw data acquired remotely in multiple PF facility environments, and support the making of critical decisions related to the optimization of agricultural production by acting as an extendable source of knowledge. Subsequently to the introduction in Section 1, the rest of this paper is structured in five sections as follows.