metadataengine/server/src/mdsserversession.cpp
branchRCL_3
changeset 19 82c0024438c8
parent 17 50de4d668bb6
child 27 4a4892eec172
equal deleted inserted replaced
17:50de4d668bb6 19:82c0024438c8
    67 // ConstructL
    67 // ConstructL
    68 // ---------------------------------------------------------------------------
    68 // ---------------------------------------------------------------------------
    69 //
    69 //
    70 void CMdSServerSession::ConstructL()
    70 void CMdSServerSession::ConstructL()
    71     {
    71     {
    72     iServer.IncrementSessions();
       
    73     }
    72     }
    74 
    73 
    75 // ---------------------------------------------------------------------------
    74 // ---------------------------------------------------------------------------
    76 // Default constructor
    75 // Default constructor
    77 // ---------------------------------------------------------------------------
    76 // ---------------------------------------------------------------------------
    90     iFindEngines.ResetAndDestroy();
    89     iFindEngines.ResetAndDestroy();
    91     iFindEngines.Close();
    90     iFindEngines.Close();
    92 
    91 
    93 	iServer.LockList().UnlockBySession( *this );
    92 	iServer.LockList().UnlockBySession( *this );
    94 	iServer.Notifier().RemoveEntriesBySession( *this );
    93 	iServer.Notifier().RemoveEntriesBySession( *this );
    95     iServer.DecrementSessions();
       
    96     
    94     
    97     // purge any pending notifications
    95     // purge any pending notifications
    98 	iNotificationCache.ResetAndDestroy();
    96 	iNotificationCache.ResetAndDestroy();
    99     iNotificationCache.Close();
    97     iNotificationCache.Close();
   100     }
    98     }
   103 // Service the server message 
   101 // Service the server message 
   104 // ---------------------------------------------------------------------------
   102 // ---------------------------------------------------------------------------
   105 //
   103 //
   106 void CMdSServerSession::ServiceL( const RMessage2& aMessage )
   104 void CMdSServerSession::ServiceL( const RMessage2& aMessage )
   107     {
   105     {
   108     __LOG2( ELogServer, "ServiceL message: %d uid: %.8x", 
   106     __LOG2( ELogServer, "ServiceL message: %d uid: %d", 
   109     		aMessage.Function(),
   107     		aMessage.Function(),
   110     		aMessage.Identity());
   108     		aMessage.Identity().iUid);
   111 
   109     
   112 	if( iServer.BackupOrRestoreRunning() )
   110 	if( iServer.BackupOrRestoreRunning() )
   113 		{
   111 		{
       
   112         // Open client applications are closed during backup/restore,
       
   113         // thus registered observers that would be removed during
       
   114         // shutdown on clients, must be allowed to be removed even
       
   115         // if backup/restore is running
       
   116 	    if( aMessage.Function() == EUnregister )
       
   117 	        {
       
   118             TRAPD( err, ServiceFunctionL( aMessage ) );
       
   119             if( err != KErrNone )
       
   120                 {
       
   121                 aMessage.Complete( err );
       
   122                 }
       
   123             return;
       
   124 	        }
   114 		aMessage.Complete( KErrServerBusy );
   125 		aMessage.Complete( KErrServerBusy );
   115 		return;
   126 		return;
   116 		}
   127 		}
   117 
   128 
   118     if( iServer.ShutdownInProgress() )
   129     if( iServer.ShutdownInProgress() )