javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authorization/AccessControllerFactoryImpl.java
branchRCL_3
changeset 19 71c436fe3ce0
parent 14 04becd199f91
equal deleted inserted replaced
18:9ac0a0a7da70 19:71c436fe3ce0
    59      *                        instance is retrieved
    59      *                        instance is retrieved
    60      * @param aAppName        The name of the application on behalf of
    60      * @param aAppName        The name of the application on behalf of
    61      *                        which the AccessControllerImpl instance
    61      *                        which the AccessControllerImpl instance
    62      *                        is retrieved
    62      *                        is retrieved
    63      */
    63      */
    64     public static AccessControllerImpl getAccessController(StorageSession aStorageSession,
    64     public synchronized static AccessControllerImpl getAccessController(StorageSession aStorageSession,
    65             Uid aAppSuiteUid,
    65             Uid aAppSuiteUid,
    66             String aAppName)
    66             String aAppName)
    67     {
    67     {
    68         if (aAppSuiteUid == null)
    68         if (aAppSuiteUid == null)
    69         {
    69         {
    70             return null;
    70             return null;
    71         }
    71         }
    72         // Synchronization missing
       
    73         AccessControllerImpl instance = (AccessControllerImpl)instances.get(
    72         AccessControllerImpl instance = (AccessControllerImpl)instances.get(
    74                                             aAppSuiteUid);
    73                                             aAppSuiteUid);
    75 
    74 
    76         if (instance == null)
    75         if (instance == null)
    77         {
    76         {
    80             instances.put(aAppSuiteUid, instance);
    79             instances.put(aAppSuiteUid, instance);
    81         }
    80         }
    82         return instance;
    81         return instance;
    83     }
    82     }
    84 
    83 
    85     public static void destroyAccessController(Uid appUID)
    84     public synchronized static void destroyAccessController(Uid appUID)
    86     {
    85     {
    87         if (appUID == null)
    86         if (appUID == null)
    88         {
    87         {
    89             return;
    88             return;
    90         }
    89         }
    91         // This is to be called when a MIDlet suite is stoped
    90         // This is to be called when a MIDlet suite is stoped
    92         // Synchronization missing
       
    93         // Remove the instance or mark it as inactive?
    91         // Remove the instance or mark it as inactive?
    94         AccessControllerImpl ac = (AccessControllerImpl)instances
    92         AccessControllerImpl ac = (AccessControllerImpl)instances
    95                                   .remove(appUID);
    93                                   .remove(appUID);
    96         if (ac != null)
    94         if (ac != null)
    97         {
    95         {