Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] FW: Server is on go slow with AspectJ

Hi,

 

I'm wondering if you heard of anything like this before.  I've got a project using AspectJ and on my local machine this all works fine, however when I send it to my remote server it goes really slowly and it only seems to slow down for the anything that calls the aspectJ and the CPU seems to go crazy.  The method I'm looking at is only getting called around 60 times but it's taking 600ms to execute the set method!  on my local machine this is only taking around 3ms.  Here's the joinpoint but I don't think this is the issue, perhaps something I need to set somewhere?

 

 

      

       pointcut checkForReadOnly(AplosAbstractBean xe): target( xe ) && set(* *)

             && !set(static * *) && !set(@Transient * *);

      

       void around( AplosAbstractBean xe ): checkForReadOnly( xe ) {

             AplosAbstractBean targetBean = ((AplosAbstractBean) xe);

             if( targetBean.isReadOnly() ) {

                    String propertyName = thisJoinPointStaticPart.getSignature().getName();

//                  System.out.println( "checkReadOnly " + propertyName );

                    Map<String, FieldInfo> fieldInfoSetterMap = ApplicationUtil.getFieldInfoSetterMap( xe.getClass() );

                    if( !fieldInfoSetterMap.containsKey( propertyName ) ) {

                           PersistentClass persistentClass = ApplicationUtil.getPersistentClass( targetBean.getClass() );

                           if( persistentClass != null ) {

                                 fieldInfoSetterMap.put( propertyName, persistentClass.getFieldInfoFromSqlName( propertyName, true ) );

                           } else {

                                 fieldInfoSetterMap.put( propertyName, null );

                           }

                    } 

                    if( fieldInfoSetterMap.get( propertyName ) != null ) {

                           ApplicationUtil.handleError( new Exception( "test" ), false );

                    }

       //                  JSFUtil.addMessage( "You cannot edit this bean as it is not saveable" );

       //           } else {

                           proceed( xe );

       //           }

             } else {

                    proceed( xe );

             }

       }

 

All the best,

 

Anthony.

 

aplosLogoSmall

A : Aplos Systems Ltd, 17 Carlton Place, Southampton, SO15 2DY.

T : 0800 520 0690

 

Registered in England, 111 rattle Road, Westham, Pevensey, East Sussex, BN24 5DH; Registration number 6657177

 


Back to the top