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 (int i = 0; i < itfs.length; i++) {
                final Permission perm = new ServicePermission(itfs[i],
                        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 (int i = 0; i < itfs.length; i++) {
                final Permission perm = new ServicePermission(itfs[i],
                        ServicePermission.REGISTER);
                if (!comp.getBundle().hasPermission(perm)) {
                    return false;
                }
            }
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

            if (clazzes != null)
            {
                for (int i = 0;i < clazzes.length;i++)
                {
                    ((SecurityManager) sm).checkPermission(
                        new ServicePermission(clazzes[i], ServicePermission.REGISTER));
                }
            }
        }

        return m_felix.registerService(this, clazzes, svcObj, dict);
View Full Code Here

        Object sm = System.getSecurityManager();

        if (sm != null)
        {
           ((SecurityManager) sm).checkPermission(new ServicePermission(ref, ServicePermission.GET));
        }

        return m_felix.getService(m_bundle, ref);
    }
View Full Code Here

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

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

     * to get the service, <code>ipojo</code> otherwise.
     */
    public static BundleContext selectContextToGetService(String itf,
            BundleContext comp, BundleContext ipojo) {
        if (System.getSecurityManager() != null) {
            final Permission perm = new ServicePermission(itf,
                    ServicePermission.GET);
            if (!comp.getBundle().hasPermission(perm)) {
                return ipojo;
            }
        }
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.