Package org.osgi.framework

Examples of org.osgi.framework.ServicePermission$Properties$Entry


     * to get the service, <code>false</code> otherwise.
     */
    public static boolean hasPermissionToGetService(String itf,
            BundleContext comp) {
        if (System.getSecurityManager() != null) {
            final Permission perm = new ServicePermission(itf,
                    ServicePermission.GET);
            return comp.getBundle().hasPermission(perm);
        }
        return true;
    }
View Full Code Here


     */
    public static boolean hasPermissionToGetServices(String[] itfs,
            BundleContext comp) {
        if (System.getSecurityManager() != null) {
            for (String itf : itfs) {
                final Permission perm = new ServicePermission(itf,
                        ServicePermission.GET);
                if (!comp.getBundle().hasPermission(perm)) {
                    return false;
                }
            }
View Full Code Here

     * to register the service, <code>false</code> otherwise.
     */
    public static boolean hasPermissionToRegisterService(String itf,
            BundleContext comp) {
        if (System.getSecurityManager() != null) {
            final Permission perm = new ServicePermission(itf,
                    ServicePermission.REGISTER);
            return comp.getBundle().hasPermission(perm);
        }
        return true;
    }
View Full Code Here

     */
    public static boolean hasPermissionToRegisterServices(String[] itfs,
            BundleContext comp) {
        if (System.getSecurityManager() != null) {
            for (String itf : itfs) {
                final Permission perm = new ServicePermission(itf,
                        ServicePermission.REGISTER);
                if (!comp.getBundle().hasPermission(perm)) {
                    return false;
                }
            }
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)
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

        SecurityManager sm = System.getSecurityManager();
        if (sm != null)
        {
            LOGGER.finest("Found security manager");

            sm.checkPermission(new ServicePermission(name, action));
        }

        LOGGER.exiting(CLASS_NAME, "checkServicePermission");
    }
View Full Code Here

        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

TOP

Related Classes of org.osgi.framework.ServicePermission$Properties$Entry

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.