Package jodd.proxetta

Examples of jodd.proxetta.ProxyAspect


   * Creates TX aspect that will be applied on all classes
   * having at least one public top-level method annotated
   * with {@link #jtxAnnotations registered JTX annotations}.
   */
  protected ProxyAspect createTxProxyAspects() {
    return new ProxyAspect(
        AnnotationTxAdvice.class,
        new MethodAnnotationPointcut(jtxAnnotations) {
      @Override
      public boolean apply(MethodInfo methodInfo) {
        return
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

   * 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

  public void testMethRefOnProxifiedClass() {
    Methref<? extends Oink> m = Methref.on(Oink.class);
    m.to().woink();
    assertEquals("woink", m.ref());

    ProxyAspect a1 = new ProxyAspect(DummyAdvice.class, new AllTopMethodsPointcut());
    ProxyProxetta pp = ProxyProxetta.withAspects(a1);
    Oink oink = (Oink) pp.builder(Oink.class).newInstance();

    assertFalse(oink.getClass().equals(Oink.class));
View Full Code Here

  protected final ProxyProxetta proxetta;

  public static final String METHREF_CLASSNAME_SUFFIX = "$Methref";

  public MethrefProxetta() {
    ProxyAspect aspects = new ProxyAspect(MethrefAdvice.class, new AllMethodsPointcut());

    proxetta = ProxyProxetta.withAspects(aspects);

    proxetta.setClassNameSuffix(METHREF_CLASSNAME_SUFFIX);
  }
View Full Code Here

  }

  @Test
  public void testProxyProxetta() {
    ProxyProxetta proxetta = ProxyProxetta.withAspects(
      new ProxyAspect(AddStringAdvice.class, new AllRealMethodsPointcut()));

    PetiteContainer papc = new ProxettaAwarePetiteContainer(proxetta);

    papc.registerPetiteBean(SecretService.class, null, null, null, false);
    BeanDefinition beanDefinition = papc.registerPetiteBean(PublicService.class, null, null, null, false);
View Full Code Here

TOP

Related Classes of jodd.proxetta.ProxyAspect

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.