org.jboss.aop.advice
Enum Scope

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

public enum Scope
extends Enum<Scope>

Defines the lifecycle of an aspect or interceptor instance.
When not specified, the default scope of an aspect or interceptor is PER_VM.

Version:
$Revision: 68585 $
Author:
Bill Burke

Enum Constant Summary
PER_CLASS
          An instance of the aspect will be created for each advised class.
PER_CLASS_JOINPOINT
          An instance of the aspect will be created for each advised joinpoint.
PER_INSTANCE
          An instance of the aspect will be created for each advised instance.
PER_JOINPOINT
          An instance of the aspect will be created for each advised joinpoint execution.
PER_VM
          A single instance of the aspect will be created to intercept any joinpoints during the Java VM execution.
 
Method Summary
static Scope valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Scope[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PER_VM

public static final Scope PER_VM
A single instance of the aspect will be created to intercept any joinpoints during the Java VM execution.


PER_CLASS

public static final Scope PER_CLASS
An instance of the aspect will be created for each advised class.


PER_INSTANCE

public static final Scope PER_INSTANCE
An instance of the aspect will be created for each advised instance.


PER_JOINPOINT

public static final Scope PER_JOINPOINT
An instance of the aspect will be created for each advised joinpoint execution.


PER_CLASS_JOINPOINT

public static final Scope PER_CLASS_JOINPOINT
An instance of the aspect will be created for each advised joinpoint. Notice that the same instance will be used for all executions of the same joinpoint.

Method Detail

values

public static final Scope[] 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(Scope c : Scope.values())
        System.out.println(c);

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

valueOf

public static Scope 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


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