Framework Professional Edition Package


com.prosyst.mbs.framework.security
Class Security

java.lang.Object
  extended by com.prosyst.mbs.framework.security.Security

public abstract class Security
extends java.lang.Object

Defines the security module of the Framework.

Author:
Teodor Todorov, Svetozar Dimov

Field Summary
 java.lang.Object condPermsAdmin
          Reference to Conditional Permission Admin service, registered by Framework.
static java.lang.String PERMS_FILENAME
          name of the file where framework stores permissions
 java.lang.Object permsAdmin
          Reference to Permission Admin service, registered by Framework.
 
Constructor Summary
Security()
           
 
Method Summary
abstract  void checkAdminPermission(Bundle target, java.lang.String action)
          Checks if the caller has AdminPermission with the specified target and actions.
abstract  boolean checkAllPermission(java.lang.Object perms)
           
abstract  boolean checkBundlePermission(Bundle bundle, java.lang.String symbolicName, java.lang.String action)
          Checks whether the specified bundle has BundlePermission with the specified symbolicName and action.
abstract  boolean checkPackagePermission(java.lang.Object perms, java.lang.String packageName, java.lang.String action)
          Checks if the specified perms imply all of the specified PackagePermission-s.
abstract  boolean checkPermission(java.lang.Object perm, java.lang.Object perms)
          Checks if perms imply perm.
abstract  boolean checkServicePermissions(java.lang.Object perms, java.lang.String interfaceName, java.lang.String action)
          If perms is null checks if the caller is granted ServicePermission for the specified service with the specified action.
abstract  java.lang.Object doPrivileged(byte type, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
          Priviliged callback, that is called from the framework.
abstract  java.lang.Object getAdminPermission(Bundle target, java.lang.String action)
          Creates AdminPermission with the specified target and action.
abstract  void initProtectionDomain(Bundle b, boolean core)
          Initializes ProtectionDomain of the specified bundle.
abstract  void removeCachedAdminPermissions(long bid)
          Removes cached admin permissions in checkAdminPermission for a bundle, when it is updated or uninstalled.
abstract  void updatePermissions(java.lang.ClassLoader unloaded, java.lang.Object protectionDomain, boolean uninstall)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

permsAdmin

public java.lang.Object permsAdmin
Reference to Permission Admin service, registered by Framework.


condPermsAdmin

public java.lang.Object condPermsAdmin
Reference to Conditional Permission Admin service, registered by Framework.


PERMS_FILENAME

public static final java.lang.String PERMS_FILENAME
name of the file where framework stores permissions

See Also:
Constant Field Values
Constructor Detail

Security

public Security()
Method Detail

checkPackagePermission

public abstract boolean checkPackagePermission(java.lang.Object perms,
                                               java.lang.String packageName,
                                               java.lang.String action)
Checks if the specified perms imply all of the specified PackagePermission-s.

Parameters:
perms -
packages -
action -
Returns:

checkServicePermissions

public abstract boolean checkServicePermissions(java.lang.Object perms,
                                                java.lang.String interfaceName,
                                                java.lang.String action)
If perms is null checks if the caller is granted ServicePermission for the specified service with the specified action. Else checks only whether perms imply the specified ServicePermission.

Parameters:
perms - The java.security.PermissionCollection instance ti check, or null if the call stack muts be checked.
interfaceName - The interface, that the service wants to register under.
action - The action.
Returns:

checkAdminPermission

public abstract void checkAdminPermission(Bundle target,
                                          java.lang.String action)
Checks if the caller has AdminPermission with the specified target and actions.

Parameters:
target - - the target of the checked permission
action - - the action of the checked permission

checkBundlePermission

public abstract boolean checkBundlePermission(Bundle bundle,
                                              java.lang.String symbolicName,
                                              java.lang.String action)
Checks whether the specified bundle has BundlePermission with the specified symbolicName and action.

Parameters:
bundle -
symbolicName -
action -

checkPermission

public abstract boolean checkPermission(java.lang.Object perm,
                                        java.lang.Object perms)
Checks if perms imply perm.

Parameters:
perm -
perms -
Returns:

checkAllPermission

public abstract boolean checkAllPermission(java.lang.Object perms)

doPrivileged

public abstract java.lang.Object doPrivileged(byte type,
                                              java.lang.Object arg1,
                                              java.lang.Object arg2,
                                              java.lang.Object arg3,
                                              java.lang.Object arg4)
                                       throws java.lang.Exception
Priviliged callback, that is called from the framework.

Parameters:
type - specifies what callback is executed
  • 0: service event
  • 1: synch bundle event
  • 2: activator start
  • 3: activator stop
  • 4: ServiceFactory.getService
    arg1 -
    arg2 -
    arg3 -
    Returns:
    Throws:
    java.lang.Exception - is thrown, if the specified callback fails

  • initProtectionDomain

    public abstract void initProtectionDomain(Bundle b,
                                              boolean core)
    Initializes ProtectionDomain of the specified bundle.

    Parameters:
    b -

    updatePermissions

    public abstract void updatePermissions(java.lang.ClassLoader unloaded,
                                           java.lang.Object protectionDomain,
                                           boolean uninstall)

    getAdminPermission

    public abstract java.lang.Object getAdminPermission(Bundle target,
                                                        java.lang.String action)
    Creates AdminPermission with the specified target and action. Certain implementations may use cache for AdminPermission objects.

    Parameters:
    target -
    action -
    Returns:

    removeCachedAdminPermissions

    public abstract void removeCachedAdminPermissions(long bid)
    Removes cached admin permissions in checkAdminPermission for a bundle, when it is updated or uninstalled.

    Parameters:
    target - bundle that is about to be removed

    Framework Professional Edition Package


    Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved