Generating HOTP example

In this post I will show with example how to generate HOTP. I will be using open source otp framework written by “BastiaanJansen” using Java programming language. Below is the link to the GitHub project https://github.com/BastiaanJansen/otp-java HOTP is generated using two input parameters1) a secret2) a counter Below is the main method that shows how…… Continue reading Generating HOTP example

Configuring StatisticsListener (using interceptor)

In this post under Spring Retry, I will show with example how to configure StatisticsListener using interceptor. Below is the complete xml code which shows how to configure StatisticsListener using interceptor. XML Code 1 <?xml version=”1.0″ encoding=”UTF-8″?>2 <beans xmlns=”http://www.springframework.org/schema/beans”3 xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”4 xmlns:aop = “http://www.springframework.org/schema/aop”5 xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd6 http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd&#8221;>7 <aop:config>8 <aop:pointcut id=”transactional” expression=”execution(* defaultPackage.Service1.executeWithException(..))”/>9 <aop:advisor pointcut-ref=”transactional” advice-ref=”retryAdvice”/>10…… Continue reading Configuring StatisticsListener (using interceptor)

Wiring together @Bean annotated beans using setter approach

In this post under Spring Core, I will explain with example how to wire two beans annotated with @Bean annotation using setter methods. For our example lets take the below two classes. Bean1 package package12; public class Bean1 { private Bean2 bean2; public Bean1() { } public void setBean2(Bean2 bean2) { this.bean2 = bean2; }…… Continue reading Wiring together @Bean annotated beans using setter approach

Configuring Recovery Callback (using interceptor)

In this post under Spring Retry –> XML Configuration –> Spring AOP, I will show with example how to configure RecoveryCallback using Spring AOP. For our example we will create a recovery class as shown below CustomMethodInvocationRecoverer package defaultPackage; import org.springframework.retry.interceptor.MethodInvocationRecoverer; public class CustomMethodInvocationRecoverer implements MethodInvocationRecoverer<Void> { @Override public Void recover(Object[] args, Throwable cause) {…… Continue reading Configuring Recovery Callback (using interceptor)

Changing scopes of @Bean annotated beans

In this post under Spring Core, I will explain with example how to change scopes of Spring beans annotated with “@Bean” annotation. By default the “@Bean” annotated beans have singleton scope. Which means that whenever a dependee bean asks for a reference to dependent bean and the dependent bean scope is “singleton” then Spring makes…… Continue reading Changing scopes of @Bean annotated beans