org.jboss.aop.microcontainer.beans
Class Aspect

java.lang.Object
  extended by org.jboss.aop.microcontainer.beans.Aspect
All Implemented Interfaces:
org.jboss.aop.instrument.Untransformable, KernelControllerContextAware

public class Aspect
extends Object
implements org.jboss.aop.instrument.Untransformable, KernelControllerContextAware

An Aspect. This installs the AspectDefinition and AspectFactory into aop

Version:
$Revision: 82280 $
Author:
Adrian Brock

Field Summary
protected  GenericBeanFactory advice
          The beanfactory representing the advice.
protected  String adviceBean
          The name of the beanfactory representing the advice.
protected  Map<String,Binding> bindings
          All the AspectBindings referencing this Aspect
protected  ManagedAspectDefinition definition
           
protected  boolean factory
          True if aspect is an aspect factory, rather than the aspect itself
protected  org.jboss.aop.AspectManager manager
          The AspectManager/Domain we are creating this aspect for
protected  String name
          The name of the aspect definition.
protected  org.jboss.aop.advice.Scope scope
          The scope of the aspect we are creating
 
Constructor Summary
Aspect()
           
 
Method Summary
protected  void addDefinitionToManager()
           
 GenericBeanFactory getAdvice()
          Get the advice.
 String getAdviceBean()
          Get the adviceBean.
protected  ManagedAspectDefinition getAspectDefinitionNoDependencies()
           
protected  ManagedAspectDefinition getAspectDefintionDependencies()
           
 org.jboss.aop.advice.AspectDefinition getDefinition()
          Get the definition.
 org.jboss.aop.AspectManager getManager()
          Get the manager.
 String getName()
          Get the name.
 String getScope()
          Get the scope.
 void install(GenericBeanFactory factory)
           
 void setAdvice(GenericBeanFactory advice)
          Set the advice.
 void setAdviceBean(String adviceBean)
          Set the adviceBean.
protected  void setDefinitionControllerContext(KernelControllerContext context)
           
 void setElement(Element element)
           
 void setFactory(boolean factory)
          Sets if we are an aspect factory or not
 void setKernelControllerContext(KernelControllerContext context)
          Set the controller context.
 void setManager(org.jboss.aop.AspectManager manager)
          Set the manager.
 void setName(String name)
          Set the name.
 void setScope(String scope)
          Set the scope.
 void start()
           
 void stop()
           
 void uninstall()
           
 void unsetKernelControllerContext(KernelControllerContext context)
          Unset the controller context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

protected org.jboss.aop.AspectManager manager
The AspectManager/Domain we are creating this aspect for


factory

protected boolean factory
True if aspect is an aspect factory, rather than the aspect itself


scope

protected org.jboss.aop.advice.Scope scope
The scope of the aspect we are creating


definition

protected ManagedAspectDefinition definition

advice

protected GenericBeanFactory advice
The beanfactory representing the advice. This should be used if the advice has no dependencies, in which case we have a real dependency on the beanfactory. If the advice has dependencies we need to use adviceBean instead;


adviceBean

protected String adviceBean
The name of the beanfactory representing the advice. This should be used if the advice has dependencies, in which case we have no real dependency on the beanfactory. If the advice has no dependencies we need to use advice instead;


name

protected String name
The name of the aspect definition. This should be the same as the raw form of this bean's name (when run in AS, the name is massaged to avoid name clashes)


bindings

protected Map<String,Binding> bindings
All the AspectBindings referencing this Aspect

Constructor Detail

Aspect

public Aspect()
Method Detail

getName

public String getName()
Get the name.

Returns:
the adviceName.

setFactory

public void setFactory(boolean factory)
Sets if we are an aspect factory or not

Parameters:
factory - true if we are a factory

setName

public void setName(String name)
Set the name.

Parameters:
name - The name to set.

getAdviceBean

public String getAdviceBean()
Get the adviceBean.

Returns:
the adviceBean.

setAdviceBean

public void setAdviceBean(String adviceBean)
Set the adviceBean.

Parameters:
adviceBean - the adviceBean.

getDefinition

public org.jboss.aop.advice.AspectDefinition getDefinition()
Get the definition.

Returns:
the definition.

getManager

public org.jboss.aop.AspectManager getManager()
Get the manager.

Returns:
the manager.

setManager

public void setManager(org.jboss.aop.AspectManager manager)
Set the manager.

Parameters:
manager - The manager to set.

getAdvice

public GenericBeanFactory getAdvice()
Get the advice.

Returns:
the advice.

setAdvice

public void setAdvice(GenericBeanFactory advice)
Set the advice.

Parameters:
advice - The advice to set.

getScope

public String getScope()
Get the scope.

Returns:
the scope.

setScope

public void setScope(String scope)
Set the scope.

Parameters:
scope - The scope to set.

setElement

public void setElement(Element element)

install

public void install(GenericBeanFactory factory)
             throws Exception
Throws:
Exception

start

public void start()
           throws Exception
Throws:
Exception

getAspectDefinitionNoDependencies

protected ManagedAspectDefinition getAspectDefinitionNoDependencies()

getAspectDefintionDependencies

protected ManagedAspectDefinition getAspectDefintionDependencies()

addDefinitionToManager

protected void addDefinitionToManager()

uninstall

public void uninstall()
               throws Exception
Throws:
Exception

stop

public void stop()

setKernelControllerContext

public void setKernelControllerContext(KernelControllerContext context)
                                throws Exception
Description copied from interface: KernelControllerContextAware
Set the controller context.

This is invoked after construction with the controller context.

WARNING: This protocol is subject to change with the classadapter implementation.

Specified by:
setKernelControllerContext in interface KernelControllerContextAware
Parameters:
context - the context
Throws:
Exception - for any error

unsetKernelControllerContext

public void unsetKernelControllerContext(KernelControllerContext context)
                                  throws Exception
Description copied from interface: KernelControllerContextAware
Unset the controller context.

This is before uninstallation with null.

WARNING: This protocol is subject to change with the classadapter implementation.

Specified by:
unsetKernelControllerContext in interface KernelControllerContextAware
Parameters:
context - the context
Throws:
Exception - for any error

setDefinitionControllerContext

protected void setDefinitionControllerContext(KernelControllerContext context)


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