Package javassist

Examples of javassist.CtMethod.insertBefore()


            "      " + updatedAdvicesFieldName + " = false;" +
            "      super.rebindJoinPointWithInstanceInformation(" + names.getInfoFieldName() + ");" +
            "   } finally {" +
            "   " + names.getInfoFieldName() + ".getInterceptorChainReadWriteLock().writeLock().unlock();}" +
            "}";
         instanceAdvisorMethod.insertBefore(code);
         genInstanceAdvisor.addMethod(instanceAdvisorMethod);
      }
   }

   protected void initaliseMethodInfo(String infoName, long hash, long unadvisedHash)throws NotFoundException
View Full Code Here


            managedCtClass
        );
      }

      if ( enhancementContext.doDirtyCheckingInline( managedCtClass ) && !isComposite ) {
                writer.insertBefore( typeDescriptor.buildInLineDirtyCheckingBodyFragment( persistentField  ));
      }

            if( isComposite) {
                StringBuilder builder = new StringBuilder();
                builder.append(" if(  ")
View Full Code Here

                        .append(EnhancerConstants.TRACKER_COMPOSITE_FIELD_NAME)
                        .append(".callOwner(\".")
                        .append(persistentField.getName())
                        .append("\");");

                writer.insertBefore( builder.toString() );
            }

            //composite types
            if(persistentField.getAnnotation(Embedded.class) != null) {
                //make sure to add the CompositeOwner interface
View Full Code Here

                //if a composite have a embedded field we need to implement the method as well
                if(isComposite)
                    createTrackChangeCompositeMethod(managedCtClass);


                writer.insertBefore( cleanupPreviousOwner(persistentField));

                writer.insertAfter( compositeMethodBody(persistentField));
            }

      managedCtClass.addMethod( writer );
View Full Code Here

            "      " + updatedAdvicesFieldName + " = false;" +
            "      super.rebindJoinPointWithInstanceInformation(" + names.getInfoFieldName() + ");" +
            "   } finally {" +
            "   " + names.getInfoFieldName() + ".getInterceptorChainReadWriteLock().writeLock().unlock();}" +
            "}";
         instanceAdvisorMethod.insertBefore(code);
         genInstanceAdvisor.addMethod(instanceAdvisorMethod);
      }
   }

   protected void initaliseMethodInfo(String infoName, long hash, long unadvisedHash)throws NotFoundException
View Full Code Here

            "      " + updatedAdvicesFieldName + " = false;" +
            "      super.rebindJoinPointWithInstanceInformation(" + names.getInfoFieldName() + ");" +
            "   } finally {" +
            "   " + names.getInfoFieldName() + ".getInterceptorChainReadWriteLock().writeLock().unlock();}" +
            "}";
         instanceAdvisorMethod.insertBefore(code);
         genInstanceAdvisor.addMethod(instanceAdvisorMethod);
      }
   }

   protected void initaliseMethodInfo(String infoName, long hash, long unadvisedHash)throws NotFoundException
View Full Code Here

            managedCtClass
        );
      }

      if ( enhancementContext.doDirtyCheckingInline( managedCtClass ) && !isComposite ) {
                writer.insertBefore( typeDescriptor.buildInLineDirtyCheckingBodyFragment( persistentField  ));
      }

            if( isComposite) {
                StringBuilder builder = new StringBuilder();
                builder.append(" if(  ")
View Full Code Here

                        .append(EnhancerConstants.TRACKER_COMPOSITE_FIELD_NAME)
                        .append(".callOwner(\".")
                        .append(persistentField.getName())
                        .append("\");");

                writer.insertBefore( builder.toString() );
            }

            //composite types
            if(persistentField.getAnnotation(Embedded.class) != null) {
                //make sure to add the CompositeOwner interface
View Full Code Here

                //if a composite have a embedded field we need to implement the method as well
                if(isComposite)
                    createTrackChangeCompositeMethod(managedCtClass);


                writer.insertBefore( cleanupPreviousOwner(persistentField));

                writer.insertAfter( compositeMethodBody(persistentField));
            }

      managedCtClass.addMethod( writer );
View Full Code Here

            "      " + updatedAdvicesFieldName + " = false;" +
            "      super.rebindJoinPointWithInstanceInformation(" + names.getInfoFieldName() + ");" +
            "   } finally {" +
            "   " + names.getInfoFieldName() + ".getInterceptorChainReadWriteLock().writeLock().unlock();}" +
            "}";
         instanceAdvisorMethod.insertBefore(code);
         genInstanceAdvisor.addMethod(instanceAdvisorMethod);
      }
   }

   protected void initaliseMethodInfo(String infoName, long hash, long unadvisedHash)throws NotFoundException
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.