Skip to main content

Posts

Showing posts with the label screencast

IoT: Monitor Home Temperature using Raspberry Pi 2 via MQTT Protocol

In this post I am going to demonstrate that remotely monitor the Temperature using Raspberry Pi and MQTT protocol. This work is done  using Java code.

IoT : Remotely Control the LED in Raspberry Pi 2 using Java (pi4j) and MQTT Protocol

In this post I am going to demonstrate that how remotely control LED and how it can be connected to Raspberry Pi using MQTT protocol and control GPIO pins using pi4j library. This work is done  using Java code. Recently I bought Raspberry Pi 2, so I just wanted to do some learning stuff, basically how to blink (on/off)  LED remotely. I have performed extensive survey about Raspberry Pi on internet I found lots of stuff about connect LED with Raspberry Pi via GPIO pins. This created a lots of interest. So I m searched Java library to control gpio pins and I got pi4j library .   Actually pi4j library easy to learn and provide bunch of examples. Details of its are mentioned below:

Docker : Tomcat Clustering with Load Balancer (Tomcat and Nginx)

In this post i will show Tomcat Clustering in Docker Container. In  my previous post i discussed how to achieve tomcat clustering with Nginx Front end . Its almost same scenario, but this time we will achieve via docker container. Docker Docker  is an  open-source  project that automates the deployment of  applications  inside  software containers , by providing an additional layer of abstraction and automation of  operating-system-level virtualization  on  Linux . [4]  Docker uses resource isolation features of the Linux kernel  such as  cgroups  and kernel  namespaces  to allow independent "containers" to run within a single Linux instance, avoiding the overhead of starting and maintaining  virtual machine   --Wikipedia

HTML5 support in JSF 2.2 with Bean Validation 1.1 (JavaEE 7)

In this post i will show the HTML5 Support given by JSF 2.2, Which is part of Java EE 7 Spec. Also how to integrate the Bean Validation 1.1 feature with help of CDI (Contexts and Dependency Injection) 1.1 spec. Before going the HTML5 support, my earlier posts on JSF, i used @ManagedBean annotation, because its part of Managed Bean Specification (Java EE 6). Another Reason i used Tomcat as a primary container, if i used Managed Bean Spec then its part of Mojjara implementation, so no need to add more CDI specific (Jboss Weld lib) lib to class-path. But from Java EE 7 on-wards, JCP community expand the CDI capabilities and make CDI as important spec in Java EE 7 and Managed Bean spec is deprecated in favor of CDI . so they recommend to use CDI wherever its possible. so our future all post to target the CDI. next post i will show how add the CDI capability to tomcat container.

File Upload is Easy in JSF2.2

To bring the File Upload feature in Java based web application is one of the difficult and complex job, we need to dependent on 3rd party libraries like Apache Commons FileUpload  Libraries. These libraries codes are complex and most of them boilerplate code. If we are using Java Server Faces (JSF), we have the page with some fields and file upload menu the its add more complexity, fields are binded to backing bean but these file uploads components are need to tie up with some 3rd party file upload libraries. In Primefaces provide easy way to do the file upload in JSF web application, even though primefaces internally used the same Apache Commons FileUpload Libraries, but provide simple JSF tags. We need configure  some listeners.

Tomcat Clustering Series Part 5 : NginX as Load Balancer

Hi this is my fifth part of the  Tomcat Clustering Series . In this post we are going to discuss how to replace Apache httpd load balancer to Nginx as a load balancer.  [Check the video below for better understanding] Hi i finished Tomcat Clustering Series . In these series we have 2 big setups needed for Tomcat Clustering Setup and configure the Load Balancer Configure the Session Replication in Tomcat. In first setup, we configure the Load Balancer using Apache httpd web server. Its open source and widely used. Second setup is session replication in Tomcat through modify/add <cluster> tag in server.xml file. These tomcat instance may run on single machine or different machine. In our Tomcat Clustering Series , the big part is configure the Load balancer (Apache httpd web server). Because there are lots of steps are involved Install the Apache httpd web server from either source or repo Compile and install...

Tomcat Clustering Series Part 4 : Session Replication using Backup Manager

Hi this is my fourth part of the  Tomcat Clustering Series . In this post we are going to discuss the how to setup session replication using Backup Manager in tomcat clustering environment. Session replication makes High availability and full fail-over capability to our clustering environment. [Check the video below for better understanding] Its continuation of the last post (session replication using Delta Manager) . In delta manager each tomcat instance need to replicate the session information to all other tomcat instances. Its take more time and replication if our cluster size is increased. so there is alternative manager is there. Its Backup Manager. Backup Manager is replicate the copy of session data to exactly one other tomcat instances. This big difference between both managers. here which tomcat creates that is primary copy of the session. and another tomcat whose hold the replicate session is backup copy . If any one of the tomcat is down....

Tomcat Clustering Series Part 3 : Session Replication

Hi this is my third part of the  Tomcat Clustering Series . In this post we are going to discuss the how to setup session replication in tomcat clustering environment. Session replication makes High availability and full fail-over capability to our clustering environment. [Check the video below for better understanding] In my previous post we discussed about setup simple load balancer and how to make session affinity concepts. How to setup Session Replication in tomcat    before going to session replication we need to understand 2 important concepts Multicast Session Manager in Tomcat Multicast       Multicast is To transmit a single message to a select group of recipients. here multicast used by tomcat cluster to identify the instances those part of cluster.  There is 2 types of cluster Static Tomcat Cluster Dynamic Tomcat Cluster In static cluster there is no need multicast, because...

Tomcat Clustering Series Part 2 : Session Affinity Load Balancer

Hi this second part of the  Tomcat Clustering Series . In my first part we discuss about how to setup simple load balancer. and we seen how load balancer distribute the request to tomcat instance in round robin fashion. [Check the video below for better understanding] In this post we discuss about what is the problem is occur in simple load balancer when we introduce sessions in our web application. and we will see how to resolve this issue. Its continuation of my first part of this series. so kindly go read my first part then continue here. How Session works in Servlet/Tomcat?        Before going into problem, let see the session management in Tomcat . If any if the page/servlet create the session then Tomcat create the Session Object and attached into group of session (HashMap kind structure) and that session can identify using session-id, its just random number generated through any one of the hash algorithm. then r...

Tomcat Clustering Series Part 1 : Simple Load Balancer

I am going to start new series of posts about Tomcat clustering . In this first post we will see what is problem in normal deployment in only single machine, what is clustering and why is necessary and how to setup the simple load balancer with Apache httpd web server + Tomcat server cluster. [Check the video for better understanding] Why need Clustering? (Tomcat Clustering)            In normal production servers are running in single machine. If that's machine may be failed due to crashed or hardware defects or OutOfMemory exception then  our site can't access by anybody. so how to solve this problem? . to add more tomcat machine to collectively (group/cluster) run as a production server. (oppose of single machine). Each tomcat has deployed the same web application. so any tomcat can process the client request. If one tomcat is failed, then other tomcat in the cluster to proceeds the request. Here ...

Integrate Chart Image into Jasper Report Part - 2

In my previous post we discussed how to Integrate the Charts into Jasper Reports  using JFreeChart API in Jasper Report. In this post there is another way to embeds the charts into Jasper Reports. This method, we need to generate/create the chart using any 3rd party Java Lib and convert into Image Object or stored into File-system, then just insert the Image into Jasper Report. here no need to use chart functionality in Jasper Report. because these chart are limited functionality. Steps: Create the chart using any Java libraries Convert the Chart into BufferedImage or Stored into files pass the Image into Jasper Report. 1. Create the chart using any Java libraries      In this step we going to create the chart. here i m using jopenchart Java library to create the chart. In their website tutorial section contain some sample codes. so i used these codes. and download the jopenchart lib from here . 2. Conve...