Package de.petris.dynamicaspects.test.aspects

Examples of de.petris.dynamicaspects.test.aspects.PrintoutAspect


          // all constructors
//          new PrintoutAspect().installAroundExecution( MultipleTargets.class,
//              JoinpointPatternFactory.PATTERN_ALL_CONSTRUCTORS );
         
          // the two 'setter'-methods
          new PrintoutAspect().installAroundExecution(
            MultipleTargets.class, PointcutFactory.PATTERN_ALL_SETTER );
         
          // all private methods
//          new PrintoutAspect().installAroundExecution(
//            MultipleTargets.class, JoinpointPatternFactory.PATTERN_ALL_PRIVATE_METHODS );
View Full Code Here


          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.test.aspects.PrintoutAspect

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.