A new pointcut in Spring 2.5 : bean() pointcut

Spring framework 2.5 introducing a new pointcut method to its users. Its called the bean pointcut. This will help us to weave Aspects in to the beans. According to the bean name(s) which we had specified or according to the pattern which we mentioned,  we can weave the aspects into that points.

Besides selecting a specific bean, this pointcut designator offers two interesting ways to select beans if you follow an appropriate naming convention:

  1. Selecting a vertical slice of beans: If you follow a convention where bean names include a string indicating their role from the business perspective, a bean() pointcut can select beans based on their business role. For example, you may use the bean(account*) pointcut to select all accounting-related beans such as accountRepository, accountService, and accountController if bean names start with a string representing their business functionality.
  2. Selecting a horizontal slice of beans: If you follow a convention where bean names include a string indicating their role from the architectural perspective, a bean() pointcut can select beans based on their architectural role. For example, you can use bean(*Repository) to select all repository beans if bean names end with a string representing their architectural role. Without the bean() pointcut, you had to rely on the package structure or type-based pointcuts, which can be sometimes a bit too restrictive.

These are the different ways or patterns of weaving this pointcut…

Pointcut

Join points selected in

bean(accountRepository)

The bean named “accountRepository”

!bean(accountRepository)

Any bean except the “accountRepository” bean

bean(*)

Any bean

bean(account*)

Any bean with name starting in “account”

bean(*Repository)

Any bean with name ending in “Repository”

bean(accounting/showaccount)

The bean named accounting/showaccount (designating, say, a controller handling that URL)

bean(accounting/*)

Any bean whose name starts with “accounting/” (designating, say, any controller handling accounting-related URLs)

bean(accounting/*/edit)

Any bean whose name starts with “accounting/” and ends with “/edit” (designating, say, any controller handling the edit operation functionality related to accounting)

bean(*dataSource) || bean(*DataSource)

Any bean whose name ends with either “dataSource” or “DataSource”

bean(service:name=monitoring)

The bean named “service:name=monitoring”

For more read it from Spring Team blog.

Technorati Tags: ,

Different types of US Visas

 

Ever wondered what type of Visa you need if you want to enter USA. Here are the different types of Visa for USA. [Its taken from Bhuvan’s Blog].

A – Official Visa

  • A-1: For Ambassadors, public ministers & consular officers
  • A-2: For immediate family members of A-1
  • A-3: Attendants & servants of A-1 and A-2 holders

    B – Business/Visitor Visa

  • B-1: Temporary visitor for business
  • B-2: Temporary visitor for leisure

    C & D Visa (For Aliens in transit)

  • C-1,2: Alien in transit directly through US
  • C-3: Family of C-1,C-2 in transit
  • C-4: Transit without Visa(TWOV)
  • D-1: Sailors departing on vessel of arrival
  • D-2: Sailors departing by other means

    E – Visa (For Traders/Investors)

  • E-1: Treaty Trader, spouse and children
  • E-2: Treaty Investor, spouse and children

    F Visa (Students)

    Want to study or research at a U.S. college? Then F is the visa for you –

  • F-1: Academic Student
  • F-2: Spouse or child of F-1

    H (Temporary Worker) Visa

  • H-1B: Persons in a specialty occupation
  • H-2B: Seasonal nonagricultural workers
  • H-3: Trainees other than medical/academic; also training of handicaps
  • H-4: Dependants of H visa holders

    I Visa (Media persons)

    Are you a reporter, film person, Editor? Then you require an I-visa –Essential documents: Your press ID, a letter from the editor.

    J & Q Exchange Visitor Visa

  • J-1: Visas for exchange visitors. exchange visitors may be academics, scientists, businesspeople or students.
  • J-2: Spouse or ‘child’ of J-1 under 21

    K Fiance(e) of US Citizen

  • K-1: Fiance(e)
  • K-2: Minor child of K-1
  • K-3: Spouse of a U.S. Citizen (LIFE Act)
  • K-4: Child of K-3 (LIFE Act)Essential documents: Marriage certificate & Photos, Intent of marrying within 90 days in US(for K1).

    L Visa (Intra company Transferees)

  • L-1A: Executive, managerial
  • L-1B: Specialized knowledge
  • L-2: Spouse or child of L-1

    M Visa – Vocational and Language Students

  • M-1: Vocational student or other non-academic student
  • M-2: Spouse or child of M-1

    O Visa – For Prodigies

  • O-1: For a Genius in Sciences, Arts, Education, Business, or Athletics.
  • O-2: Alien’s (support) accompanying O-1
  • O-3: Spouse or child of O-1 or O-2

    P Visa – Athletes and Entertainers

  • P-1: Athletes & Entertainment groups
  • P-2: Entertainers in exchange programs
  • P-3: Entertainers in cultural programs
  • P-4: Spouse or child of P-1, 2, or 3

    R Visa – Religious Workers

  • R-1: Religious workers
  • R-2: Spouse or child of R-1
  • Technorati Tags: ,

    Google’s Gmail Offline is coming

    According to some newspaper resources, Google has already developed an offline version of Gmail that is likely to be made available within this year.  googlegmaillogo

    Like Google Reader which lets you work offline using Google Gears, GMail users will be able to interact with their GMail account even when they don’t have an active Internet connection. For instance, the report says that you would have to download a GMail software client for that would automatically synchronize with the Gmail server. Read more here

    Technorati Tags: ,

    Reading Properties File from outside of a JAR File

    Today in my project I had a requirement to fetch the properties file from out side of my JAR file. Its easy to pick it from the CLASSPATH of that JAR file but not that much easy to pick from a “Special location” like TOMCAT home, outside the JAR file. At first I tried to read it as a ResourceBundle. But with our so much difference I done it as follows…

    Click here to Read Full Article

    Design a site like this with WordPress.com
    Get started