org.jboss.aop.advice
Enum AdviceType

java.lang.Object
  extended by java.lang.Enum<AdviceType>
      extended by org.jboss.aop.advice.AdviceType
All Implemented Interfaces:
Serializable, Comparable<AdviceType>

public enum AdviceType
extends Enum<AdviceType>

Indicates whether the type of an advice is before, around, after, throwing or finally.
Notice that interceptors are a special type of around advices.

For internal use only.

Author:
Flavia Rainone

Enum Constant Summary
AFTER
          Advice will be invoked after the joinpoint execution, only if it returns normally.
AROUND
          Advice will be invoked around the joinpoint execution, and as such is responsible for invoking the next advice in the chain and returning the joinpoint result value.
BEFORE
          Advice will be invoked before the joinpoint execution.
FINALLY
          Advice will be invoked after the joinpoint execution, regardless of how it returns.
THROWING
          Advice will be invoked after the joinpoint execution, only if it throws an exception.
 
Method Summary
 String getAccessor()
          Returns an accessor string for this type.
 AdviceMethodFactory getFactory()
          An advice method factory for this type.
 String getName()
          Returns a lower case name of this type.
 boolean isGeneratedOnly()
          Indicates if the use of this advice type is restrictive to the generated advisor mode, or if it can be used on all instrumentation modes.
 String toString()
          Returns the verbose description of this type (for use on output).
static AdviceType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static AdviceType[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BEFORE

public static final AdviceType BEFORE
Advice will be invoked before the joinpoint execution.


AROUND

public static final AdviceType AROUND
Advice will be invoked around the joinpoint execution, and as such is responsible for invoking the next advice in the chain and returning the joinpoint result value.


AFTER

public static final AdviceType AFTER
Advice will be invoked after the joinpoint execution, only if it returns normally.


THROWING

public static final AdviceType THROWING
Advice will be invoked after the joinpoint execution, only if it throws an exception.


FINALLY

public static final AdviceType FINALLY
Advice will be invoked after the joinpoint execution, regardless of how it returns.

Method Detail

values

public static final AdviceType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(AdviceType c : AdviceType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static AdviceType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

getName

public final String getName()
Returns a lower case name of this type.


getAccessor

public final String getAccessor()
Returns an accessor string for this type.
This accessor is built by concatenating "get" with the the description starting with an upper case.

Returns:
an accessor string for this type.

getFactory

public final AdviceMethodFactory getFactory()
An advice method factory for this type. Notice this factory is for use on generated mode only.

Returns:
an advice method factory

isGeneratedOnly

public final boolean isGeneratedOnly()
Indicates if the use of this advice type is restrictive to the generated advisor mode, or if it can be used on all instrumentation modes.

Returns:
true only if this advice type must be used on generated advisor mode.

toString

public String toString()
Returns the verbose description of this type (for use on output).

Overrides:
toString in class Enum<AdviceType>
Returns:
the lower-case verbose description of this type


Copyright © 2008 JBoss, a division of Red Hat, Inc.. All Rights Reserved.