Package jodd.proxetta.pointcuts

Examples of jodd.proxetta.pointcuts.ProxyPointcutSupport


   * Returns {@link WrapperProxetta} used for building loggable prepared statements.
   * Initializes proxetta when called for the first time.
   */
  public static WrapperProxetta getProxetta() {
    if (proxetta == null) {
      proxetta = WrapperProxetta.withAspects(new ProxyAspect(LoggableAdvice.class, new ProxyPointcutSupport() {
        public boolean apply(MethodInfo methodInfo) {
          int argumentsCount = methodInfo.getArgumentsCount();
          char argumentType = 0;
          if (argumentsCount >= 1) {
            argumentType = methodInfo.getArgumentOpcodeType(1);
View Full Code Here


   * Returns {@link WrapperProxetta} used for building loggable prepared statements.
   * Initializes proxetta when called for the first time.
   */
  public static WrapperProxetta getProxetta() {
    if (proxetta == null) {
      proxetta = WrapperProxetta.withAspects(new ProxyAspect(LoggableAdvice.class, new ProxyPointcutSupport() {
        public boolean apply(MethodInfo methodInfo) {
          int argumentsCount = methodInfo.getArgumentsCount();
          char argumentType = 0;
          if (argumentsCount >= 1) {
            argumentType = methodInfo.getArgumentOpcodeType(1);
View Full Code Here

  @Test
  public void testAllFeatures() throws IOException, IllegalAccessException, InstantiationException {
    StatCounter.counter = 0;
    final MutableBoolean firstTime = new MutableBoolean(true);

    ProxyAspect aspect = new ProxyAspect(StatCounterAdvice.class, new ProxyPointcutSupport() {
      public boolean apply(MethodInfo mi) {
        if (firstTime.value) {
          firstTime.value = false;
          ClassInfo ci = mi.getClassInfo();
          assertEquals("BigFatJoe", ci.getClassname());
View Full Code Here

  @Test
  public void testClassWrapper() throws Exception {
    Calc calc = new CalcImpl();

    WrapperProxetta proxetta = WrapperProxetta.withAspects(new ProxyAspect(StatCounterAdvice.class, new ProxyPointcutSupport() {
      public boolean apply(MethodInfo methodInfo) {
        return !isRootMethod(methodInfo) && isPublic(methodInfo);
      }
    }));
View Full Code Here

  @Test
  public void testClassWrapperCastToInterface() throws Exception {
    Calc calc = new CalcImpl();

    WrapperProxetta proxetta = WrapperProxetta.withAspects(new ProxyAspect(StatCounterAdvice.class, new ProxyPointcutSupport() {
      public boolean apply(MethodInfo methodInfo) {
        return !isRootMethod(methodInfo) && isPublic(methodInfo);
      }
    }));
View Full Code Here

  @Test
  public void testInterfaceWrapper() throws Exception {
    Calc calc = new CalcImpl();

    WrapperProxetta proxetta = WrapperProxetta.withAspects(new ProxyAspect(StatCounterAdvice.class, new ProxyPointcutSupport() {
      public boolean apply(MethodInfo methodInfo) {
        return isTopLevelMethod(methodInfo) && isPublic(methodInfo);
      }
    }));
View Full Code Here

  @Test
  public void testPartialMethodsWrapped() throws Exception {

    Calc calc = new CalcSuperImpl();

    WrapperProxetta proxetta = WrapperProxetta.withAspects(new ProxyAspect(StatCounterAdvice.class, new ProxyPointcutSupport() {
      public boolean apply(MethodInfo methodInfo) {
        return
            isPublic(methodInfo) &&
                (methodInfo.getMethodName().equals("hello") || methodInfo.getMethodName().equals("ola"));
      }
View Full Code Here

  @Test
  public void testNoPointcutMatched() throws Exception {

    Calc calc = new CalcSuperImpl();

    WrapperProxetta proxetta = WrapperProxetta.withAspects(new ProxyAspect(StatCounterAdvice.class, new ProxyPointcutSupport() {
      public boolean apply(MethodInfo methodInfo) {
        return false;
      }
    }));
View Full Code Here

TOP

Related Classes of jodd.proxetta.pointcuts.ProxyPointcutSupport

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.