Package gabriel.components.dynaop

Examples of gabriel.components.dynaop.AccessInterceptor


    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.");
    Subject subject = new Subject("We");
View Full Code Here


  }

  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

        with(eq(principals),
            eq("example.SecureObject.setName")).
        will(returnValue(false));

    aspects.interceptor(Pointcuts.instancesOf(SecureObject.class),
        Pointcuts.ALL_METHODS, new AccessInterceptor((MethodAccessManager) callAccessManager.proxy()));

    proxyFactory = ProxyFactory.getInstance(aspects);

    SecureObject object = new SecureObjectImpl("TestName");
    SecureObject wrapped = (SecureObject) proxyFactory.wrap(object);
View Full Code Here

TOP

Related Classes of gabriel.components.dynaop.AccessInterceptor

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.