Package java.security

Examples of java.security.Permission


                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


        if ((pc = (PermissionCollection)loaderPC.get(codeUrl)) == null) {
            pc = super.getPermissions(codeSource);
            if (pc != null) {
                Iterator perms = permissionList.iterator();
                while (perms.hasNext()) {
                    Permission p = (Permission)perms.next();
                    pc.add(p);
                }
                loaderPC.put(codeUrl,pc);
            }
        }
View Full Code Here

        if (path == null) {
            return;
        }

        if (securityManager != null) {
            Permission permission = null;
            if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                if (!path.endsWith("/")) {
                    path = path + "/";
                }
                permission = new JndiPermission(path + "*");
 
View Full Code Here

        if ((pc = (PermissionCollection)loaderPC.get(codeUrl)) == null) {
            pc = super.getPermissions(codeSource);
            if (pc != null) {
                Iterator perms = permissionList.iterator();
                while (perms.hasNext()) {
                    Permission p = (Permission)perms.next();
                    pc.add(p);
                }
                loaderPC.put(codeUrl,pc);
            }
        }
View Full Code Here

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

     * 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

     * 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

TOP

Related Classes of java.security.Permission

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.