Package org.osgi.framework

Examples of org.osgi.framework.ServicePermission


        for (BundleController bundle : installedbundles.values())
        {
            for (String clazz : classes)
            {
                if (!bundle.hasPermission(new ServicePermission(clazz, ServicePermission.GET))) continue;

                if (bundle.getAllServiceListeners() != null) fireServiceEvent(event, bundle.getAllServiceListeners(), bundle);

                if (!reference.isAssignableTo(bundle, clazz)) continue;
View Full Code Here


                if ( services != null && services.length > 0 )
                {
                    final Bundle bundle = getBundle();
                    for ( String service : services )
                    {
                        final Permission perm = new ServicePermission( service, ServicePermission.REGISTER );
                        if ( !bundle.hasPermission( perm ) )
                        {
                            log( LogService.LOG_DEBUG, "Permission to register service {0} is denied", new Object[]
                                    {service}, null );
                            allowed = false;
View Full Code Here

     */
    public boolean hasGetPermission()
    {
        if ( System.getSecurityManager() != null )
        {
            Permission perm = new ServicePermission( getServiceName(), ServicePermission.GET );
            return m_componentManager.getBundle().hasPermission( perm );
        }

        // no security manager, hence permission given
        return true;
View Full Code Here

            for (int i = 0; i < refs.length; i++)
            {
                try
                {
                    ((SecurityManager) sm).checkPermission(new ServicePermission(
                        refs[i], ServicePermission.GET));

                    result.add(refs[i]);
                }
                catch (Exception ex)
View Full Code Here

            for (int i = 0; i < refs.length; i++)
            {
                try
                {
                    ((SecurityManager) sm).checkPermission(
                        new ServicePermission(refs[i], ServicePermission.GET));

                    result.add(refs[i]);
                }
                catch (Exception ex)
                {
View Full Code Here

        Object sm = System.getSecurityManager();
        if ((acc != null) && (sm != null))
        {
            try
            {
                ServicePermission perm =
                    new ServicePermission(
                        ref, ServicePermission.GET);
                ((SecurityManager) sm).checkPermission(perm, acc);
            }
            catch (Exception ex)
            {
View Full Code Here

        for (int i = 0; i < refs.length; i++)
        {
            try
            {
                ((SecurityManager) sm).checkPermission(new ServicePermission(refs[i], ServicePermission.GET));
                result.add(refs[i]);
            }
            catch (Exception ex)
            {
                // Ignore, since we are just testing permission.
View Full Code Here

    perms.add(new PackagePermission("*", PackagePermission.EXPORT));
    perms.add(new PackagePermission("*", PackagePermission.IMPORT));
    perms.add(new BundlePermission("*", BundlePermission.HOST));
    perms.add(new BundlePermission("*", BundlePermission.PROVIDE));
    perms.add(new BundlePermission("*", BundlePermission.REQUIRE));
    perms.add(new ServicePermission("*", ServicePermission.REGISTER));
    perms.add(new ServicePermission("*", ServicePermission.GET));
    perms.add(new PropertyPermission("org.springframework.osgi.*", "read"));
    perms.add(new PropertyPermission("org.springframework.osgi.iandt.*", "write"));
    // required by Spring
    perms.add(new RuntimePermission("*", "accessDeclaredMembers"));
    perms.add(new ReflectPermission("*", "suppressAccessChecks"));
View Full Code Here

    // export package
    perms.add(new PackagePermission("*", PackagePermission.EXPORT));
    perms.add(new PackagePermission("*", PackagePermission.IMPORT));
    perms.add(new BundlePermission("*", BundlePermission.FRAGMENT));
    perms.add(new BundlePermission("*", BundlePermission.PROVIDE));
    perms.add(new ServicePermission("*", ServicePermission.REGISTER));
    perms.add(new ServicePermission("*", ServicePermission.GET));
    perms.add(new PropertyPermission("*", "read,write"));

    // required by Spring
    perms.add(new RuntimePermission("*", "accessDeclaredMembers"));
    perms.add(new ReflectPermission("*", "suppressAccessChecks"));
View Full Code Here

TOP

Related Classes of org.osgi.framework.ServicePermission

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.