com.xenonsoft.bridgetown.aop.impl
Class DefaultMethodPointCut

java.lang.Object
  extended bycom.xenonsoft.bridgetown.aop.impl.DefaultMethodPointCut
All Implemented Interfaces:
IMethodPointCut, IPointCut, java.io.Serializable

public class DefaultMethodPointCut
extends java.lang.Object
implements IMethodPointCut, java.io.Serializable

Default implementation of the method pointcut.

This implementation uses CGLIB and Jakarta ORO to provide glob style expression filters on both fully qualified class name and a method name.

Version:
$Id: DefaultMethodPointCut.java,v 1.8 2005/03/17 02:24:48 peter_pilgrim Exp $
Author:
peterp, 21-Sep-2004
See Also:
Serialized Form

Constructor Summary
DefaultMethodPointCut()
          Default constructor
DefaultMethodPointCut(java.lang.String name, IMethodInterceptor interceptor)
          Convenience method pointcut constructor.
DefaultMethodPointCut(java.lang.String name, java.lang.String methodExpr, IMethodInterceptor interceptor)
          Convenience method pointcut constructor that excepts the method filters as glob expression strings.
DefaultMethodPointCut(java.lang.String name, java.lang.String classExpr, java.lang.String methodExpr, IMethodInterceptor interceptor)
          Convenience method pointcut constructor that excepts the class and method filters as glob expression strings.
 
Method Summary
 void addJoinPoint(IJoinPoint joinpoint)
          Implements / overrides addJoinPoint
 void addJoinPoint(IMethodJoinPoint joinpoint)
          Implements / overrides addJoinPoint
 java.lang.Object getContext()
          Gets the AOP implementation defined context associated with this pointcut.
 int getJoinPointCount()
          Returns the number of join points associated with the pointcut
 IJoinPoint[] getJoinPoints()
          Implements / overrides getJoinPoints
 IMethodInterceptor getMethodInterceptor()
          The method interceptor
 java.lang.String getName()
          Gets the name of the method pointcut
 java.lang.Object getParameter(java.lang.String name)
          Implements / overrides getParameter
 java.util.Iterator getParameterNames()
          Implements / overrides getParameters
 ITransactionConfig getTransactionConfig()
          Gets the transaction configuration context for this pointcut
 void setContext(java.lang.Object context)
          Sets the context
 void setMethodInterceptor(IMethodInterceptor interceptor)
          The method interceptor
 void setName(java.lang.String name)
          Sets the name of the method pointcut
 void setParameter(java.lang.String name, java.lang.Object value)
          Implements / overrides setParameter
 void setTransactionConfig(ITransactionConfig transactionConfig)
          Sets the transactionConfig
 java.lang.String toString()
          Prints the debuggable string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultMethodPointCut

public DefaultMethodPointCut()
Default constructor


DefaultMethodPointCut

public DefaultMethodPointCut(java.lang.String name,
                             IMethodInterceptor interceptor)
Convenience method pointcut constructor.

Parameters:
name - the pointcut name
interceptor - the method interceptor

DefaultMethodPointCut

public DefaultMethodPointCut(java.lang.String name,
                             java.lang.String methodExpr,
                             IMethodInterceptor interceptor)
Convenience method pointcut constructor that excepts the method filters as glob expression strings. The constructor creates a class filter that matches any Java class.

Parameters:
name - the pointcut name
methodExpr - the method glob expression
interceptor - the method interceptor
See Also:
DefaultMethodPointCut(String, String, IMethodInterceptor)

DefaultMethodPointCut

public DefaultMethodPointCut(java.lang.String name,
                             java.lang.String classExpr,
                             java.lang.String methodExpr,
                             IMethodInterceptor interceptor)
Convenience method pointcut constructor that excepts the class and method filters as glob expression strings. This method creates the pointcut with one method joinpoint.

For example a method pointcut to weave all mutator (setter) methods on a Java package called org.criminal.sleaze would be:

class glob expression org\.criminal\.sleaze*.

method glob expression set*.

Parameters:
name - the pointcut name
classExpr - the class glob expression
methodExpr - the method glob expression
interceptor - the method interceptor
Method Detail

getName

public java.lang.String getName()
Gets the name of the method pointcut

Specified by:
getName in interface IPointCut
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Sets the name of the method pointcut

Specified by:
setName in interface IPointCut
Parameters:
name - The name to set.

getContext

public java.lang.Object getContext()
Gets the AOP implementation defined context associated with this pointcut.

CAUTION

: This object is obviously opaque data in terms of the Brigetown IoC Framework assembly. The context can be used by the particular Aspect Oriented Framework implementation. You may be able to retrieve additional implementation defined behaviour or data throught this method call. For instance more information about the particular point-cut, obviously you need to read the documentation for you AOP implementation for more information.

Specified by:
getContext in interface IPointCut
Returns:
the implementation data required for AOP plug-in implementation, or just return null
See Also:
IPointCut.getContext()

setContext

public void setContext(java.lang.Object context)
Sets the context

Parameters:
context - the context

getMethodInterceptor

public IMethodInterceptor getMethodInterceptor()
The method interceptor

Specified by:
getMethodInterceptor in interface IPointCut
Returns:
the method interceptor
See Also:
IPointCut.getMethodInterceptor()

setMethodInterceptor

public void setMethodInterceptor(IMethodInterceptor interceptor)
The method interceptor

Specified by:
setMethodInterceptor in interface IPointCut
Parameters:
interceptor -
Returns:
the method interceptor
See Also:
IPointCut.getMethodInterceptor()

addJoinPoint

public void addJoinPoint(IMethodJoinPoint joinpoint)
Implements / overrides addJoinPoint

Specified by:
addJoinPoint in interface IMethodPointCut
Parameters:
joinpoint -
See Also:
IMethodPointCut.addJoinPoint(com.xenonsoft.bridgetown.aop.IMethodJoinPoint)

addJoinPoint

public void addJoinPoint(IJoinPoint joinpoint)
Implements / overrides addJoinPoint

Specified by:
addJoinPoint in interface IPointCut
Parameters:
joinpoint -
See Also:
IPointCut.addJoinPoint(com.xenonsoft.bridgetown.aop.IJoinPoint)

getJoinPoints

public IJoinPoint[] getJoinPoints()
Implements / overrides getJoinPoints

Specified by:
getJoinPoints in interface IPointCut
Returns:
See Also:
IPointCut.getJoinPoints()

getJoinPointCount

public int getJoinPointCount()
Returns the number of join points associated with the pointcut

Specified by:
getJoinPointCount in interface IPointCut
Returns:
the joinpoint size
See Also:
IPointCut.getJoinPointCount()

getTransactionConfig

public ITransactionConfig getTransactionConfig()
Gets the transaction configuration context for this pointcut

Specified by:
getTransactionConfig in interface IPointCut
Returns:
See Also:
IPointCut.getTransactionConfig()

setTransactionConfig

public void setTransactionConfig(ITransactionConfig transactionConfig)
Sets the transactionConfig

Specified by:
setTransactionConfig in interface IPointCut
Parameters:
transactionConfig - The transactionConfig to set.

getParameter

public java.lang.Object getParameter(java.lang.String name)
Implements / overrides getParameter

Specified by:
getParameter in interface IPointCut
Parameters:
name -
Returns:
See Also:
IPointCut.getParameter(java.lang.String)

getParameterNames

public java.util.Iterator getParameterNames()
Implements / overrides getParameters

Specified by:
getParameterNames in interface IPointCut
Returns:
See Also:
com.xenonsoft.bridgetown.aop.IPointCut#getParameters()

setParameter

public void setParameter(java.lang.String name,
                         java.lang.Object value)
Implements / overrides setParameter

Specified by:
setParameter in interface IPointCut
Parameters:
name -
value -
See Also:
IPointCut.setParameter(java.lang.String, java.lang.Object)

toString

public java.lang.String toString()
Prints the debuggable string

Returns:
debug string
See Also:
Object.toString()


Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.