public class AspectDefinition extends Object
AspectManager.addAspectDefinition(AspectDefinition)
Modifier and Type | Field and Description |
---|---|
Map<Advisor,Boolean> |
advisors
Deprecated.
should not call this directly
|
protected boolean |
deployed
Indicates whether this definition has been deployed in the
domain . |
protected AspectFactory |
factory
Aspect's factory, responsible for creating the aspect instances.
|
protected String |
name
Name of the aspect.
|
protected Scope |
scope
Scope of the aspect, defines how many times it must be created during
execution.
|
Constructor and Description |
---|
AspectDefinition() |
AspectDefinition(String name,
Scope scope,
AspectFactory factory)
Creates an aspect definition.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Compares this aspect definition with
obj for equality. |
AspectFactory |
getFactory()
Returns the factory of this aspect definition, responsible for providing
the instances at runtime.
|
String |
getName()
Returns the name of this aspect definition.
|
Scope |
getScope()
Returns the scope of this aspect definition.
|
int |
hashCode() |
boolean |
isDeployed()
Returns
true if this aspect definition is deployed in its
domain .An aspect definition is considered to be deployed if it
is active in the domain, and can intercept joinpoints. |
void |
registerAdvisor(Advisor advisor)
Registers
advisor as being a client of this definition. |
void |
setFactory(AspectFactory factory)
Sets the factory of this aspect definition, responsible for providing the
instances at runtime.
|
void |
setName(String name)
Sets the name of this aspect definition.
|
void |
setScope(Scope scope)
Sets the scope of this aspect definition.
|
void |
undeploy()
Undeploys the aspect definition from its domain.
|
void |
unregisterAdvisor(Advisor advisor)
Unregisters
advisor as being a client of this definition. |
protected Scope scope
protected AspectFactory factory
protected boolean deployed
domain
.public AspectDefinition(String name, Scope scope, AspectFactory factory)
name
- the name of the aspect. This name is used by the domain to
identify the aspect, so it must be unique in the AOP
domain
.scope
- the aspect scope, indicates how many aspects instances must
be created during execution. Defaults to PER_VM if null
.factory
- factory responsible for creating the aspect instancesAspectFactory
,
GenericAspectFactory
public AspectDefinition()
public void undeploy()
public boolean isDeployed()
true
if this aspect definition is deployed in its
domain
.An aspect definition is considered to be deployed if it
is active in the domain, and can intercept joinpoints. It is not deployed when it
is inactive and won't intercept any joinpoints.true
if this aspect definition is active in its domainpublic void setName(String name)
domain
.name
- the new name of this aspect definition.public void setScope(Scope scope)
scope
- the new scope of this aspect definition.public void setFactory(AspectFactory factory)
factory
- the new factory of this aspect definitionpublic AspectFactory getFactory()
public String getName()
domain
.domain
public void registerAdvisor(Advisor advisor)
advisor
as being a client of this definition. This means
that advisor
uses an instance of the defined aspect for interception
of one or more joinpoints.
For internal use only
advisor
- an advisor responsible for managing joinpoints and their
interception executionpublic void unregisterAdvisor(Advisor advisor)
advisor
as being a client of this definition. This means
that advisor
no more uses an instance of the defined aspect for
interception.
For internal use only
advisor
- responsible for managing a set of joinpoints and their
interception executionpublic Scope getScope()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.