In this section we shall discuss the method interceptor mechanism provided by the Spring AOP framework.
First we need to create a
Spring bean, which is an object managed, instantiated, and configured by Spring Framework. We shall create a JavaBean class for the Spring bean. The JavaBean object implements a journal catalog with properties representing the catalog's journal name, publisher, edition, title, and author. The bean class also provides accessor methods for the bean properties. We need to create an interface, CatalogInterface
, for the bean class. Select the project node and select File | New | Other. In the New wizard select Java | Interface and click on Next. Specify a package name (spring.catalog
) in the Package field and an interface name (CatalogInterface
) in the
Name field and click on Finish, as shown in the following screenshot:
A spring.catalog.CatalogInterface
interface gets added to the src
folder. The CatalogInterface.java...