Package dynaop

Examples of dynaop.Aspects.interceptor()


     * @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());
    }

    public Object intercept(Invocation invocation) throws Throwable {
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

    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

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.