Package de.petris.dynamicaspects

Examples of de.petris.dynamicaspects.DefaultBeforeAfterAdvice


          e.printStackTrace()
        }
   }
  
   public void simpleTest() {
     DefaultBeforeAfterAdvice a = new PrintoutAspect();
    
     // apply aspect to one method
//     a.install(
//       SimpleTarget.class,
//       "public .* doIt.*" );
    
     a.installAroundExecution(
//            Reflection.getInnerClassOf( "SimpleInner", SimpleTarget.class ),
            SimpleTarget.class,
       new PointcutFactory().addMethodName( "doIt" ).
//       addParamTypeList(
//                    double.class, int.class,    long.class, boolean[].class ).
           addParamTypeList(
                    double.class, ArrayList.class).
                getPattern() );
    
     SimpleTarget t = new SimpleTarget();
     t.catchMe( "i am the argument" );
    

        a.deinstall( SimpleTarget.class );

//     a.deinstall( Reflection.getInnerClassOf( "SimpleInner", SimpleTarget.class ) );
    
     t.catchMe( "i am the argument" );
   }
View Full Code Here


  
   
    public void cFlowTest() {
    
       
        DefaultBeforeAfterAdvice a = new PrintoutAspect();
        List<CFlowCondition> l = new ArrayList<CFlowCondition>();
       
        l.add( new CFlowCondition( new Class[] { SimpleTarget.class },
                new PointcutFactory().addMethodName("doIt").addParamTypeList(
                        double.class, ArrayList.class ).getPattern(), true ) );
       
        a.install(
            Reflection.getInnerClassOf( "SimpleInner", SimpleTarget.class ),
            new PointcutFactory().addMethodName( "doIt" ).getPattern(),
            new CFlow( WeaveType.EXECUTION, l ) );
           
        SimpleTarget t = new SimpleTarget();
View Full Code Here

TOP

Related Classes of de.petris.dynamicaspects.DefaultBeforeAfterAdvice

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.