|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jac.core.AspectComponent
This class is the root class for the aspect components defined by a Jac application programmers.
When programming a new aspect, the programmer must extends this
class and define new pointcuts to link a set of base method
invocation to a wrapping method. If necessary, the programmer can
also redefine the methods of the interface
BaseProgramListener
to be able to react on several
events happenning in the base programm such as object
(de)serialization, object instantiation, object naming, object
cloning, or wrappers execution.
Pointcut
,
Serialized FormField Summary | |
protected String |
application
|
protected String[] |
blockKeywords
Block keywords which can be used instead of "block" |
protected static ClassRepository |
cr
|
protected ConfigMethod |
currentConfigMethod
|
protected Imports |
currentImports
|
int |
firstCall
Memorize how many calls have been performed on start_weaving_type.start_weaving_method . |
protected static boolean |
NOT_SHARED
|
protected static boolean |
SHARED
|
int |
startWeavingCCount
The number of instance of startWeavingType where
the weaving has to start. |
int |
startWeavingCount
The number of calls of startWeavingType.startWeavingMethod where the
weaving has to start. |
String |
startWeavingMethod
The method where the weaving has to start. |
Class |
startWeavingType
The type where the weaving has to start. |
protected boolean |
systemListener
Tells if this aspect component is a system listener one so that it can receive events from the org.objectweb.jac.core objects. |
protected WeakHashSet |
wrappers
The wrappers handled by this aspect component. |
Fields inherited from interface org.objectweb.jac.core.BaseProgramListener |
FOUND_OBJECT |
Constructor Summary | |
AspectComponent()
The default constructor of the aspect component. |
Method Summary | |
void |
addWrapper(Wrapper wrapper)
Add a wrapper to the wrappers handled by this aspect component. |
void |
afterApplicationStarted()
Upcalled after a new application is started on the JAC system. |
void |
afterRunningWrapper(Wrapper wrapper,
String wrappingMethod)
This method is called after the application of the wrapper. |
void |
afterWrap(Wrappee wrappee,
Wrapper wrapper,
String[] wrapping_methods,
String[][] wrapped_methods)
This method is called after a new wrapper wraps a wrappee. |
void |
afterWrappeeInit(Wrappee wrappee)
This method should be called by the GUI system after an object has been created and initialized (tells the other aspects that the object is now regular). |
Object |
attr(String name)
|
void |
attrdef(String name,
Object value)
|
void |
beforeConfiguration()
To overload in order to perform some treatements before the configuration. |
void |
beforeReload()
|
boolean |
beforeRunningWrapper(Wrapper wrapper,
String wrappingMethod)
This method is called when a wrapper is going to be applied to a wrappee. |
void |
beforeWrappeeInit(Wrappee wrappee)
This method should be called by the GUI system before an object is being created and initialized (but the process is not finished yet). |
void |
configure(String name,
String filePath)
Configures this aspect component with a given configuration file. |
static boolean |
defines(String methodName)
Returns true if the method is defined in the aspect component class. |
void |
defineTimer(long period,
MethodItem callback,
Object[] args)
A common configuration method that defines a timer and its callback. |
void |
doRegister()
This method is upcalled by the system when the aspect is actually registered in the AC manager. |
void |
doUnregister()
This method is upcalled by the system when the aspect is actually registered in the AC manager. |
protected void |
error(String message)
Issue an error containing the file, line number and configuration method name (if available) |
protected AspectComponent |
getAC(String name)
Returns a named aspect component in the same application |
String |
getApplication()
Gets the application that declares this aspect component. |
Set |
getBlockKeywords()
|
Collection |
getConfigurationMethods()
Returns all the configuration methods of the aspect |
Collection |
getConfigurationMethodsName()
Returns all the name of the configuration methods of the aspect |
List |
getConfigurationMethodsName(Class firstParamType)
Returns all the configuration methods of the aspect whose first parameter is compatible with a given type. |
String[] |
getDefaultConfigs()
Returns defaults configuration files that must be loaded before the user's configuration |
String |
getName()
|
void |
getNameCounters(Map counters)
|
Collection |
getWrappers()
Returns the wrappers handled by this aspect component. |
void |
init()
Initializes the aspect component so that its state is resetted to the default state. |
boolean |
isConfigurationMethod(Method method)
Tells wether a method is configuration method of this aspect |
boolean |
isSystemListener()
Tells if this aspect component is a system listener. |
void |
onExit()
This method is upcalled when the system exits. |
Pointcut |
pointcut(String wrappeeExpr,
String wrappeeClassExpr,
String methodName,
Object[] methodArgs,
String exceptionHandler)
Defines and adds a new pointcut that upcalls an aspect method when the matching object is created. |
Pointcut |
pointcut(String wrappeeExpr,
String wrappeeClassExpr,
String methodName,
Object[] methodArgs,
String hostExpr,
String exceptionHandler)
Defines and adds a new localized pointcut that upcalls an aspect method when the matching object is created. |
Pointcut |
pointcut(String wrappeeExpr,
String wrappeeClassExpr,
String wrappeeMethodExpr,
String wrappingClassName,
Object[] initParameters,
String exceptionHandler,
boolean one2One)
Defines and adds a new method pointcut. |
Pointcut |
pointcut(String wrappeeExpr,
String wrappeeClassExpr,
String wrappeeMethodExpr,
String wrappingClassName,
Object[] initParameters,
String hostExpr,
String exceptionHandler,
boolean one2One)
Defines and adds a new localized method pointcut. |
Pointcut |
pointcut(String wrappeeExpr,
String wrappeeClassExpr,
String wrappeeMethodExpr,
String wrappingClassName,
String exceptionHandler,
boolean one2one)
Defines and adds a new method pointcut. |
Pointcut |
pointcut(String wrappeeExpr,
String wrappeeClassExpr,
String wrappeeMethodExpr,
String wrappingClassName,
String hostExpr,
String exceptionHandler,
boolean one2One)
Defines and adds a new localized method pointcut. |
Pointcut |
pointcut(String wrappeeExpr,
String wrappeeClassExpr,
String wrappeeMethodExpr,
Wrapper wrapper,
String exceptionHandler)
Defines and adds a new method pointcut. |
Pointcut |
pointcut(String wrappeeExpr,
String wrappeeClassExpr,
String wrappeeMethodExpr,
Wrapper wrapper,
String hostExpr,
String exceptionHandler)
Defines and adds a new localized method pointcut. |
void |
setApplication(String application)
Gets the application that declares this aspect component. |
void |
setAttribute(AbstractMethodItem method,
String name,
String value)
Generic config method to set an attribute on a method |
void |
setAttribute(ClassItem cli,
String name,
String value)
Generic config method to set an attribute on a class |
void |
setAttribute(FieldItem field,
String name,
String value)
Generic config method to set an attribute on a class |
void |
setSystemListener(boolean systemListener)
Sets this aspect component to be a system or non-system listener. |
protected void |
simulateUsingNewInstance(Wrappee wrappee)
This method simulates an instance first use so that the system upcalls whenUsingNewInstance() with a fake
collaboration point (method() is null and
args is null too). |
void |
unweave()
The programmer should overload this method to unwrap all the currently wrapped Jac objects so that it unplugs a given aspect. |
protected void |
unwrapAll()
This method unwraps all the instances that have been wrapped by the aspect component. |
void |
updateNameCounters(Map counters)
|
protected void |
warning(String message)
Issue a warning containing the file, line number and configuration method name (if available) |
void |
weave()
The programmer should define this method to wrap all the currently instantiated Jac objects so that it plugs a given aspect. |
void |
whenClone(Wrappee cloned,
Wrappee clone)
This method is automatically called when a Jac Object is cloned. |
void |
whenCloseDisplay(Display display)
Upcalled when a display is closing. |
void |
whenConfigured()
This method should be defined by the programmer when specific actions are needed once the aspect component has be configured. |
void |
whenDeleted(Wrappee object)
Upcalled when an object is deleted. |
Wrappee |
whenDeserialized(SerializedJacObject orgObject,
Wrappee finalObject)
This method is called when a base object is deserialized and can parametrize the deserialization by reading the SerializedJacObject instance to get some extra infos on the aspects. |
void |
whenFree(Wrappee object)
Upcalled when an object is freed from the memory. |
void |
whenGetObjects(Collection objects,
ClassItem cl)
This method is called when a program gets a set of object from the object repository. |
String |
whenNameObject(Object object,
String name)
Upcalled when the naming aspect names an object. |
void |
whenObjectMiss(String name)
This method is upcalled by JAC when an object was seeked into the name repository and was not found. |
void |
whenReload()
Called when the aspect's configuration is reloaded |
void |
whenRemoteInstantiation(Wrappee newInstance,
String name)
This method is upcalled when a new object is instanciated from a remote site. |
Wrappee |
whenSerialized(Wrappee orgObject,
SerializedJacObject finalObject)
This method is called when a JAC object is serialized and can parametrize the serialization by filling the finalObject
parameter.
|
void |
whenTopologyChanged()
This method is upcalled when a topological change occurs whithin the distributed application. |
void |
whenUsingNewClass(ClassItem cli)
This method is upcalled by JAC when a static method is called for the first time. |
void |
whenUsingNewInstance(Interaction interaction)
This method is called when a new instance (that has not been wrapped by the aspect component yet) is used by a peer object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final boolean SHARED
protected static final boolean NOT_SHARED
protected static final ClassRepository cr
public int firstCall
start_weaving_type.start_weaving_method
. The
weaving will start when this number reaches
start_weaving_count
.
weave()
public Class startWeavingType
weave()
public String startWeavingMethod
weave()
public int startWeavingCount
startWeavingType.startWeavingMethod
where the
weaving has to start.
weave()
public int startWeavingCCount
startWeavingType
where
the weaving has to start.
weave()
protected transient WeakHashSet wrappers
getWrappers()
,
addWrapper(Wrapper)
protected boolean systemListener
protected String application
protected String[] blockKeywords
protected ConfigMethod currentConfigMethod
protected Imports currentImports
Constructor Detail |
public AspectComponent()
weave()
is called as the aspect component is
registering to the aspect component manager
weave()
,
ACManager.register(String,Object)
Method Detail |
public static boolean defines(String methodName)
methodName
- the method to test
public void defineTimer(long period, MethodItem callback, Object[] args)
The method mi
is invoked every
period
ms. The method is defined in the aspect
component.
period
- the timer's period (in ms)callback
- the method that is called every periodargs
- the arguments the callback is called withpublic void setSystemListener(boolean systemListener)
systemListener
- if true, the component can receive events
from the JAC core objects (e.g. whenUsingNewInstance) ; if
false, these events are filteredpublic boolean isSystemListener()
setSystemListener(boolean)
public void init()
public String getApplication()
Application
,
ApplicationRepository
public void setApplication(String application)
This method is invoked by the system and should not be directly used.
application
- the application's nameApplication
,
ApplicationRepository
public Collection getWrappers()
Wrapper.getAspectComponent()
.
addWrapper(Wrapper)
,
Wrapper.getAspectComponent()
public void addWrapper(Wrapper wrapper)
The programmer should not call this method explicitly unless
s/he really hnows what s/he is doing. In fact, this method is
automatically upcalled when the aspect component wraps a base
program object (see Wrappee.wrap()
).
wrapper
- the wrapper to add to the handdled wrappersgetWrappers()
,
Wrapping.wrap(Wrappee,Wrapper,AbstractMethodItem)
public void weave()
Wrappee.isExtendedBy()
method. When a new AC is
registered the weave method is automatically called. In the
jac.prop file, the time when it is called can be parametrized
with the org.objectweb.jac.startWeavingPlaces property.
This method is only called once. For the objects that are
created after the weaving, the programmer must define the
whenUsingNewInstance
method to wrap them.
The default implementation of the weave method is the
following. In most of the case, it will work if the
whenUsingNewInstance()
is correctly defined (thus,
the programer do not have to redefine the weave method).
for (int i=0; i < JacObject.objectCount(); i++) { simulateUsingNewInstance ( (Wrappee)JacObject.getObject(i) ); }IMPORTANT NOTE: this method is not deprecated but the programmer should not overload it since it is much cleaner to define the
whenUsingNewInstance()
to implement the
weaving.
whenUsingNewInstance(Interaction)
,
simulateUsingNewInstance(Wrappee)
,
Wrapping.isExtendedBy(Wrappee,ClassItem,Class)
public void whenUsingNewInstance(Interaction interaction)
By default, this method check out all the pointcuts that have been defined within this aspect component and accordingly wraps the wrappee.
However, for performance or flexibility reasons, the programmer can also define it from scratch so that the aspects can dynamically apply while the base program creates new base objects. The aspect component is notified only once for each new instance.
Here is a typical implementation of this method for a many-to-one wrappees-wrapper relationship:
public class MyAC extends AspectComponent { public MyWrapper myWrapper = null; public void whenUsingNewInstance() { // creates the sole instance of MyWrapper if ( myWrapper == null ) myWrapper = new MyWrapper(); // make sure we do not wrap an object several times // (this is usually not useful!!) if ( wrappee().isExtendedBy( MyWrapper.class ) ) return; // Do not wrap system or aspect objects if ( wrappee().getClass().getName().startsWith( "org.objectweb.jac.core." ) || wrappee().getClass().getName().startsWith( "org.objectweb.jac.aspects." ) ) return; // wrap it... wrappee().wrapAll( myWrapper, "myWrappingMethod" ); } }
The same but with one-to-one wrappees-wrappers relationship:
public class MyAC extends AspectComponent { public void whenUsingNewInstance() { // make sure we do not wrap an object several times // (this is usually not useful!!) if ( wrappee().isExtendedBy( MyWrapper.class ) ) return; // Do not wrap system or aspect objects if ( wrappee().getClass().getName().startsWith( "org.objectweb.jac.core." ) || wrappee().getClass().getName().startsWith( "org.objectweb.jac.aspects." ) ) return; // one wrapper for each new instance MyWrapper myWrapper = new MyWrapper(); // wrap it... wrappee().wrapAll( myWrapper, "myWrappingMethod" ); } }NOTE: this method is not upcalled until the aspect component is woven.
whenUsingNewInstance
in interface BaseProgramListener
interaction
- the interaction that triggered the
whenUsingNewInstance event (usually a constructor invocation)weave()
public void whenUsingNewClass(ClassItem cli)
BaseProgramListener
whenUsingNewClass
in interface BaseProgramListener
cli
- the class that is used for the first time.CollaborationParticipant
,
BaseProgramListener.whenUsingNewInstance(Interaction)
protected void simulateUsingNewInstance(Wrappee wrappee)
whenUsingNewInstance()
with a fake
collaboration point (method()
is null and
args
is null too).
wrappee
- the wrappe on which the call is simulated.whenUsingNewInstance(Interaction)
public void whenRemoteInstantiation(Wrappee newInstance, String name)
The name that is passed is the name of the remote reference that has been used to create the object. Typically, it is the name that will be used by the naming aspect to name the new object.
whenRemoteInstantiation
in interface BaseProgramListener
newInstance
- the instance that have been created by a
remote hostname
- the name of the new instanceNamingAC.whenRemoteInstantiation(Wrappee,String)
protected final void unwrapAll()
This is done in a generic way that is not very efficient. To
optimize this process, the user may overload the
unweave()
method to change its default
behavior.
unweave()
public void unweave()
By default, calls the unwrapAll
method but the
programmer can implement the unveaving process in a more
efficient way.
unwrapAll()
public void whenClone(Wrappee cloned, Wrappee clone)
whenClone
in interface BaseProgramListener
cloned
- the object that is being clonedclone
- the new object (the clone of cloned)public Wrappee whenSerialized(Wrappee orgObject, SerializedJacObject finalObject)
finalObject
parameter.
IMPORTANT: this method is upcalled only if the
serialization is done with a
JacObjectOutputStream
. To ensure the correct use of
this class, only use JacObject.serialize()
to
serialize an object.
whenSerialized
in interface BaseProgramListener
orgObject
- the object being serializedfinalObject
- the corresponding serialized structure
SerializedJacObject
,
JacObjectOutputStream
public Wrappee whenDeserialized(SerializedJacObject orgObject, Wrappee finalObject)
IMPORTANT: this method is upcalled only if the
deserialization is done with a
JacObjectInputStream
. To ensure the correct use of
this class, only use JacObject.deserialize()
to
deserialize an object.
whenDeserialized
in interface BaseProgramListener
orgObject
- the corresponding serialized structurefinalObject
- the object being deserialized
SerializedJacObject
,
JacObjectInputStream
public void onExit()
BaseProgramListener
onExit
in interface BaseProgramListener
public boolean beforeRunningWrapper(Wrapper wrapper, String wrappingMethod)
By overloading this method, the aspect component can skip the
wrapper, for instance if the current collaboration shows that
the wrapper has allready been applied.
If the method returns true, then the wrapper is run, else it
is skipped. Default: return true.
beforeRunningWrapper
in interface BaseProgramListener
wrapper
- the wrapper that is going to be runnedwrappingMethod
- the name of the may-be runned wrapping
method
Wrappee
,
Wrapping.wrap(Wrappee,Wrapper,AbstractMethodItem)
,
Wrapper
,
Wrapper.proceed(Invocation)
public void afterRunningWrapper(Wrapper wrapper, String wrappingMethod)
Typically, the aspect component can set an attribute to the collaboration that indicates that the wrapper has been applied (and that can be used by the beforeRunningWrapper method).
afterRunningWrapper
in interface BaseProgramListener
wrapper
- the wrapper that has just been runnedwrappingMethod
- the name of the runned wrapping methodWrappee
,
Wrapping.wrap(Wrappee,Wrapper,AbstractMethodItem)
,
Wrapper
,
Wrapper.proceed(Invocation)
public void afterWrap(Wrappee wrappee, Wrapper wrapper, String[] wrapping_methods, String[][] wrapped_methods)
afterWrap
in interface BaseProgramListener
Wrapper
,
Wrappee
,
Wrapping.wrap(Wrappee,Wrapper,AbstractMethodItem)
public void whenGetObjects(Collection objects, ClassItem cl)
At this step, the aspect can change the returned list so that the program will see the right set of objects (for instance a security aspect may filter this set so that the user will not see the objects s/he is not allowed to see or a persistance aspect may force the load of a set of objects from the storage and add them to the list).
whenGetObjects
in interface BaseProgramListener
objects
- the returned list (can be modified)cl
- the class that was used by the program to filter its
instances (can be null for all the objects)ObjectRepository
public String whenNameObject(Object object, String name)
BaseProgramListener
whenNameObject
in interface BaseProgramListener
object
- the object to namename
- current name of the object or null
public void getNameCounters(Map counters)
public void updateNameCounters(Map counters)
public void whenObjectMiss(String name)
The reason of this miss can be multiple. For instance, the persistence aspect may have not already load the object from the storage, or the distribution aspect may need to bind to a remote object. Thus, this method allows the aspects to resolve the object.
By default, this method does nothing.
The final choosen name is a contextual attribute called FOUND_OBJECT.
whenObjectMiss
in interface BaseProgramListener
name
- the name of the objectBaseProgramListener.FOUND_OBJECT
public void whenDeleted(Wrappee object)
BaseProgramListener
whenDeleted
in interface BaseProgramListener
object
- the deleted objectpublic void whenFree(Wrappee object)
BaseProgramListener
whenFree
in interface BaseProgramListener
object
- the deleted objectpublic void afterApplicationStarted()
BaseProgramListener
afterApplicationStarted
in interface BaseProgramListener
public void whenCloseDisplay(Display display)
BaseProgramListener
whenCloseDisplay
in interface BaseProgramListener
display
- the closing displaypublic void whenTopologyChanged()
BaseProgramListener
whenTopologyChanged
in interface BaseProgramListener
public void whenReload()
public void beforeReload()
public void whenConfigured()
public void beforeConfiguration() throws Exception
Exception
public String getName()
public void doRegister()
Here it does nothing.
public void doUnregister()
Here it does nothing.
public Pointcut pointcut(String wrappeeExpr, String wrappeeClassExpr, String wrappeeMethodExpr, String wrappingClassName, String exceptionHandler, boolean one2one)
For more details on how to use pointcuts, see the
MethodPointcut
class.
wrappeeExpr
- the wrappee definition that matches the names
as defined by the naming aspectwrappeeClassExpr
- the wrappee class expression (matches
the fully qualified class name)wrappeeMethodExpr
- the wrappee method expression (matches
the full method name as defined by the rtti)wrappingClassName
- the name of the wrapper classone2one
- true if each new wrapped instance corresponds to
one different wrapperMethodPointcut
public Pointcut pointcut(String wrappeeExpr, String wrappeeClassExpr, String wrappeeMethodExpr, String wrappingClassName, Object[] initParameters, String exceptionHandler, boolean one2One)
For more details on how to use pointcuts, see the
MethodPointcut
class.
wrappeeExpr
- the wrappee definition that matches the names
as defined by the naming aspectwrappeeClassExpr
- the wrappee class expression (matches
the fully qualified class name)wrappeeMethodExpr
- the wrappee method expression (matches
the full method name as defined by the rtti)wrappingClassName
- the name of the wrapper classinitParameters
- the initialization parameters of the
wrapper (passed to the wrappers constructor that matches the
parameters types)one2One
- true if each new wrapped instance corresponds to
one different wrapperMethodPointcut
public Pointcut pointcut(String wrappeeExpr, String wrappeeClassExpr, String wrappeeMethodExpr, String wrappingClassName, String hostExpr, String exceptionHandler, boolean one2One)
For more details on how to use pointcuts, see the
MethodPointcut
class.
wrappeeExpr
- the wrappee definition that matches the names
as defined by the naming aspectwrappeeClassExpr
- the wrappee class expression (matches
the fully qualified class name)wrappeeMethodExpr
- the wrappee method expression (matches
the full method name as defined by the rtti)wrappingClassName
- the name of the wrapper classhostExpr
- a regular expression that macthes the hosts
where the pointcut has to be applied (if null or empty string,
default is ".*" which means that the pointcut will be applied on
all the hosts)one2One
- true if each new wrapped instance corresponds to
one different wrapperMethodPointcut
public Pointcut pointcut(String wrappeeExpr, String wrappeeClassExpr, String wrappeeMethodExpr, String wrappingClassName, Object[] initParameters, String hostExpr, String exceptionHandler, boolean one2One)
For more details on how to use pointcuts, see the
MethodPointcut
class.
wrappeeExpr
- the wrappee definition that matches the names
as defined by the naming aspectwrappeeClassExpr
- the wrappee class expression (matches
the fully qualified class name)wrappeeMethodExpr
- the wrappee method expression (matches
the full method name as defined by the rtti)wrappingClassName
- the name of the wrapper classinitParameters
- the initialization parameters of the
wrapper (passed to the wrappers constructor that matches the
parameters types)hostExpr
- a regular expression that macthes the hosts
where the pointcut has to be applied (if null or empty string,
default is ".*" which means that the pointcut will be applied on
all the hosts)one2One
- true if each new wrapped instance corresponds to
one different wrapperMethodPointcut
public Pointcut pointcut(String wrappeeExpr, String wrappeeClassExpr, String wrappeeMethodExpr, Wrapper wrapper, String exceptionHandler)
For more details on how to use pointcuts, see the
MethodPointcut
class.
wrappeeExpr
- the wrappee definition that matches the names
as defined by the naming aspectwrappeeClassExpr
- the wrappee class expression (matches
the fully qualified class name)wrappeeMethodExpr
- the wrappee method expression (matches
the full method name as defined by the rtti)wrapper
- the wrapper that contains the wrapping method,
cannot be nullMethodPointcut
public Pointcut pointcut(String wrappeeExpr, String wrappeeClassExpr, String wrappeeMethodExpr, Wrapper wrapper, String hostExpr, String exceptionHandler)
For more details on how to use pointcuts, see the
MethodPointcut
class.
wrappeeExpr
- the wrappee definition that matches the names
as defined by the naming aspectwrappeeClassExpr
- the wrappee class expression (matches
the fully qualified class name)wrappeeMethodExpr
- the wrappee method expression (matches
the full method name as defined by the rtti)wrapper
- the wrapper that contains the wrapping method,
cannot be nullhostExpr
- a regular expression that macthes the hosts
where the pointcut has to be applied (if null or empty string,
default is ".*" which means that the pointcut will be applied on
all the hosts)MethodPointcut
public Pointcut pointcut(String wrappeeExpr, String wrappeeClassExpr, String methodName, Object[] methodArgs, String exceptionHandler)
For more details on how to use pointcuts, see the
MethodPointcut
class.
wrappeeExpr
- the wrappee definition that matches the names
as defined by the naming aspectwrappeeClassExpr
- the wrappee class expression (matches
the fully qualified class name)methodName
- a method of the aspect component to callmethodArgs
- the arguments of this methods when calledMethodPointcut
public Pointcut pointcut(String wrappeeExpr, String wrappeeClassExpr, String methodName, Object[] methodArgs, String hostExpr, String exceptionHandler)
For more details on how to use pointcuts, see the
MethodPointcut
class.
wrappeeExpr
- the wrappee definition that matches the names
as defined by the naming aspectwrappeeClassExpr
- the wrappee class expression (matches
the fully qualified class name)methodName
- a method of the aspect component to callmethodArgs
- the arguments of this methods when calledMethodPointcut
public void setAttribute(ClassItem cli, String name, String value)
cli
- the class to set an attribute onname
- name of the attributevalue
- string value of the attributepublic void setAttribute(FieldItem field, String name, String value)
field
- the field to set an attribute onname
- name of the attributevalue
- string value of the attributepublic void setAttribute(AbstractMethodItem method, String name, String value)
method
- the method to set an attribute onname
- name of the attributevalue
- string value of the attributepublic final void attrdef(String name, Object value)
public final Object attr(String name)
public Set getBlockKeywords()
public String[] getDefaultConfigs()
public Collection getConfigurationMethods()
public Collection getConfigurationMethodsName()
public List getConfigurationMethodsName(Class firstParamType)
firstParamType
- the type the first parameter must be compatible with
public boolean isConfigurationMethod(Method method)
method
-
public void configure(String name, String filePath)
name
- name of the aspect component (informative)filePath
- path to a resource of file containing the configurationpublic void beforeWrappeeInit(Wrappee wrappee)
BaseProgramListener
Then, some aspects should deal differently with this object thant with already created objects (for instance, the GUI aspect should not show the object to other users, or a remote access aspect should disable forwarding.
beforeWrappeeInit
in interface BaseProgramListener
public void afterWrappeeInit(Wrappee wrappee)
BaseProgramListener
afterWrappeeInit
in interface BaseProgramListener
protected void warning(String message)
message
- the warning message to printerror(String)
protected void error(String message)
message
- the warning message to printwarning(String)
protected AspectComponent getAC(String name)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |