messagingfw/sendas/server/src/csendasservertimer.cpp
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "csendasservertimer.h"
       
    17 
       
    18 /** Utility AO factory function.
       
    19 
       
    20 This AO is used by the server to implement its shutdown timers.
       
    21 
       
    22 If the timer expires the active scheduler will be stopped, killing the server.
       
    23 */
       
    24 CSendAsServerTimer* CSendAsServerTimer::NewL()
       
    25 	{
       
    26 	CSendAsServerTimer *self = new (ELeave) CSendAsServerTimer();
       
    27 	CleanupStack::PushL(self);
       
    28 	self->ConstructL();	// from CTimer
       
    29 	CleanupStack::Pop(self);
       
    30 	return self;
       
    31 	}
       
    32 	
       
    33 void CSendAsServerTimer::RunL()
       
    34 	{
       
    35 	// stopping the scheduler stops the server.
       
    36 	CActiveScheduler::Stop(); 
       
    37 	}
       
    38 	
       
    39 CSendAsServerTimer::CSendAsServerTimer()
       
    40 : CTimer(CActive::EPriorityLow)
       
    41 	{
       
    42 	CActiveScheduler::Add(this);
       
    43 	}