Package org.openengsb.labs.delegation.service

Examples of org.openengsb.labs.delegation.service.ClassProvider


        Dictionary<String, Object> wicketProviderProps = new Hashtable<String, Object>();
        wicketProviderProps.put(org.openengsb.labs.delegation.service.Constants.PROVIDED_CLASSES_KEY,
            WicketPermission.class.getName());
        wicketProviderProps.put(org.openengsb.labs.delegation.service.Constants.DELEGATION_CONTEXT_KEY,
            Constants.DELEGATION_CONTEXT_PERMISSIONS);
        ClassProvider wicketPermissionProvider =
            new ClassProviderImpl(bundle, Sets.newHashSet(WicketPermission.class.getName()));
        registerService(wicketPermissionProvider, wicketProviderProps, ClassProvider.class);

        SecurityAttributeProvider attributeStore = new SecurityAttributeProviderImpl();
        context.putBean("attributeStore", attributeStore);
View Full Code Here


        Filter filter = DelegationUtil.createClassProviderFilter(Constants.DELEGATION_CONTEXT_MODELS,
            model.getModelClassName(), Version.parseVersion(model.getVersionString()));
        ServiceTracker serviceTracker = new ServiceTracker(context, filter, null);
        serviceTracker.open();
        try {
            ClassProvider service = (ClassProvider) serviceTracker.waitForService(timeout);
            if (service == null) {
                throw new ClassNotFoundException(model.getModelClassName());
            }
            return service.loadClass(model.getModelClassName());
        } catch (InterruptedException e) {
            throw new ClassNotFoundException(model.getModelClassName(), e);
        } finally {
            serviceTracker.close();
        }
View Full Code Here

                new Class<?>[]{ UserDataManager.class }, invocationHandler);

        Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put(Constants.PROVIDED_CLASSES_KEY, TestPermission.class.getName());
        props.put(Constants.DELEGATION_CONTEXT_KEY, org.openengsb.core.api.Constants.DELEGATION_CONTEXT_PERMISSIONS);
        ClassProvider permissionProvider =
            new ClassProviderImpl(bundle, Sets.newHashSet(TestPermission.class.getName()));
        registerService(permissionProvider, props, ClassProvider.class);

    }
View Full Code Here

    @SuppressWarnings("unchecked")
    private static Class<? extends Permission> findPermissionClass(String name)
        throws ClassNotFoundException {
        Filter filter =
            FilterUtils.makeFilter(ClassProvider.class, String.format("(%s=%s)", Constants.PROVIDED_CLASSES_KEY, name));
        ClassProvider provider = utilsService.getOsgiServiceProxy(filter, ClassProvider.class);
        return (Class<? extends Permission>) provider.loadClass(name);
    }
View Full Code Here

    private void providePermissions() {
        EntryUtils.setUtilsService(new DefaultOsgiUtilsService(bundleContext));
        Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put(Constants.PROVIDED_CLASSES_KEY, TestPermission.class.getName());
        props.put(Constants.DELEGATION_CONTEXT_KEY, org.openengsb.core.api.Constants.DELEGATION_CONTEXT_PERMISSIONS);
        ClassProvider permissionProvider = new ClassProviderImpl(bundle,
            Sets.newHashSet(TestPermission.class.getName()));
        registerService(permissionProvider, props, ClassProvider.class);
    }
View Full Code Here

TOP

Related Classes of org.openengsb.labs.delegation.service.ClassProvider

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.