Package dynaop

Examples of dynaop.Aspects


     * pointcuts factory.
     *
     * @param pointcutsFactory the pointcuts factory.
     */
    public DynaopAspectsManager(PointcutsFactory pointcutsFactory) {
        this(new Aspects(), pointcutsFactory);
    }
View Full Code Here


    /**
     * Creates a new <code>DynaopAspectsManager</code>.
     */
    public DynaopAspectsManager() {
        this(new Aspects());
    }
View Full Code Here

        return pointcutsFactory;
    }

    public Object applyAspects(Object componentKey, Object component, PicoContainer container) {
        containerLoader.setContainer(container);
        Aspects aspects = componentAspects.registerAspects(componentKey, containerAspects);
        return ProxyFactory.getInstance(aspects).wrap(component);
    }
View Full Code Here

     * @return a new <code>dynaop.Aspects</code> object that contains
     *         everything in <code>containerAspects</code> plus the component
     *         aspects that match <code>componentKey</code>.
     */
    Aspects registerAspects(Object componentKey, Aspects containerAspects) {
        Aspects aspects = copyAspects(containerAspects);
        Iterator iterator = componentsAspects.iterator();
        while (iterator.hasNext()) {
            ComponentAspect componentAspect = (ComponentAspect) iterator.next();
            componentAspect.registerAspect(componentKey, aspects);
        }
View Full Code Here

        return (MutablePicoContainer) temp.getComponentInstance(containerClass);
    }

    private AspectablePicoContainer mixinAspectablePicoContainer(AspectsManager aspectsManager,
            MutablePicoContainer pico) {
        Aspects aspects = new Aspects();
        aspects.mixin(Pointcuts.ALL_CLASSES, new Class[]{AspectsContainer.class}, new InstanceMixinFactory(aspectsManager));
        aspects.interfaces(Pointcuts.ALL_CLASSES, new Class[]{AspectablePicoContainer.class});
        return (AspectablePicoContainer) ProxyFactory.getInstance(aspects).wrap(pico);
    }
View Full Code Here

        }
    }

    private AspectablePicoContainer mixinAspectablePicoContainer(AspectsManager aspectsManager,
                                                                 MutablePicoContainer pico) {
        Aspects aspects = new Aspects();
        aspects.mixin(Pointcuts.ALL_CLASSES, new Class[]{AspectsContainer.class}, new InstanceMixinFactory(aspectsManager));
        aspects.interfaces(Pointcuts.ALL_CLASSES, new Class[]{AspectablePicoContainer.class});
        return (AspectablePicoContainer) ProxyFactory.getInstance(aspects).wrap(pico);
    }
View Full Code Here

     *
     * @param containerLoader the container loader.
     * @return the dynamically generated proxy.
     */
    static PicoContainer create(ContainerLoader containerLoader) {
        Aspects aspects = new Aspects();
        aspects.interceptor(Pointcuts.ALL_CLASSES, Pointcuts.ALL_METHODS, new PicoContainerProxy(containerLoader));
        aspects.interfaces(Pointcuts.ALL_CLASSES, new Class[]{PicoContainer.class});
        return (PicoContainer) ProxyFactory.getInstance(aspects).wrap(new Object());
    }
View Full Code Here

    AccessManager manager = new AccessManagerImpl(aclStore);
    MethodAccessManager methodAccessManager = new MethodAccessManagerImpl(manager, methodStore);

    // The we setup our aop to wrap objects
    Aspects aspects = new Aspects();
    aspects.interceptor(Pointcuts.instancesOf(SecureObject.class),
        Pointcuts.ALL_METHODS, new AccessInterceptor(methodAccessManager));

    ProxyFactory proxyFactory = ProxyFactory.getInstance(aspects);

    System.out.println("Setting our subject to \"We\" with empty principals.");
View Full Code Here

    super.setUp();
    this.callAccessManager = mock(MethodAccessManager.class);
  }

  public void testAnnotateWithMixin() {
    Aspects aspects = new Aspects();
    aspects.interceptor(Pointcuts.instancesOf(SecureObject.class),
        Pointcuts.ALL_METHODS, new AccessInterceptor((MethodAccessManager) callAccessManager.proxy()));
    aspects.mixin(Pointcuts.instancesOf(SecureObject.class),
        OwnableMixin.class, new Closure() {
          public void execute(Object o) {
          }
        });
View Full Code Here

    principals = new HashSet();
    Subject subject = Subject.get();
    subject.setPrincipals(principals);

    aspects = new Aspects();
  }
View Full Code Here

TOP

Related Classes of dynaop.Aspects

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.