Examples of ServicePermission


Examples of org.osgi.framework.ServicePermission

            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

Examples of org.osgi.framework.ServicePermission

        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

Examples of org.osgi.framework.ServicePermission

     */
    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

Examples of org.osgi.framework.ServicePermission

                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

Examples of org.osgi.framework.ServicePermission

     */
    public static BundleContext selectContextToRegisterServices(String[] itfs,
            BundleContext comp, BundleContext ipojo) {
        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 ipojo;
                }
            }
View Full Code Here

Examples of org.osgi.framework.ServicePermission

     * 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

Examples of org.osgi.framework.ServicePermission

     * 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

Examples of org.osgi.framework.ServicePermission

     * 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

Examples of org.osgi.framework.ServicePermission

     */
    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

Examples of org.osgi.framework.ServicePermission

     * 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
TOP
Copyright © 2018 www.massapi.com. 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.