Update contrib.
1 // Copyright (c) 1997-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Implements the FLogger server process startup and stubs all functionality.
23 #include "comsdbgstub.h"
27 /********************************************************************************/
28 // Stub Functionality from Flogsvr.cpp
32 CFileLoggerServer* CFileLoggerServer::NewL()
35 CFileLoggerServer* r=new(ELeave) CFileLoggerServer();
36 CleanupStack::PushL(r);
38 r->StartL(KFLoggerServerName);
43 CFileLoggerServer::CFileLoggerServer()
44 : CServer2(EPriorityNormal,ESharableSessions)
47 void CFileLoggerServer::ConstructL()
50 @note Constructs the secondary thread, passing through a pointer to the log queue.
51 Constructs the file parser object and parses the file, attempting to copy the
52 file from the ROM if it is not found on C drive.
53 Constructs the time beat.
54 Performs the first UpdateMedia to ensure a media is set.
55 Stubbed version does very little.
61 CFileLoggerServer::~CFileLoggerServer()
66 CSession2* CFileLoggerServer::NewSessionL(const TVersion &aVersion ,const RMessage2& /*aMessage*/) const
68 * Create a new server session. Check that client is using current or older interface and make a new session.
69 * @note Called by kernel after RFileLogger::DoConnect().
72 if (aVersion.iMajor == 1) {}
73 return CFileLogSession::NewL();
78 TInt CFileLoggerServer::RunError(TInt aError)
80 * Leave has occured in CFileLogSession::ServiceL.
81 * Usually this is because the appending of the message to the queue has failed
82 * due to the queue being filled.
85 return CServer2::RunError(aError);
89 // CFileLogSession class definition
92 CFileLogSession* CFileLogSession::NewL()
94 * Construct new server end of session.
95 * @note Only called from CFileLoggerServer::NewSessionL()
99 CFileLogSession* self = new(ELeave) CFileLogSession();
103 CFileLogSession::CFileLogSession()
107 CFileLogSession::~CFileLogSession()
111 void CFileLogSession::ServiceL(const RMessage2& aMessage)
113 Processes message from client-side (RFileLogger)
114 @note Most messages result in logs being added to the queue. If
115 synchronous logging is on, this function will wait until the queue is then emptied.
116 Slimline Stub version
119 aMessage.Complete(KErrNone);
124 /////////////////////////////////////////////////////////////////
127 /********************************************************************************/
128 // Stub Functionality from Flogthrd.cpp
132 const TInt KFLoggerServerUid=0x10004ee0;
134 _LIT(KFLoggerServerExecutable,"COMSDBGSVR"); ///< Filename of flogger server executable
137 // only needed for EKA1:
142 EXPORT_C TInt FLogger::Start()
144 * Start the FLOGGER server - called by a hopeful client when they first connect.
145 * @return TInt of (KErrorNone) if the server startup was successful, otherwise
154 // Different approaches for EKA1/EKA2:
156 // Target and EKA2 is easy, we just create a new server process. Simultaneous
157 // launching of two such processes should be detected when the second one
158 // attempts to create the server object, failing with KErrAlreadyExists.
161 ret = server.Create(KFLoggerServerExecutable,KNullDesC,TUidType(KNullUid,KNullUid,TUid::Uid(KFLoggerServerUid)));
169 server.SetPriority(EPriorityHigh);
171 server.Rendezvous(stat);
175 // setting the server process priority is really just a formality since
176 // we set the server's thread priorities to absolute values later anyway.
180 User::WaitForRequest(stat);
185 EXPORT_C TInt FLogger::Run()
187 * Start the active scheduler and create the server. This is called from the DLL entry code.
188 * @return TInt of (KErrorNone) if the server startup was successful, otherwise
197 self.SetPriority(EPriorityAbsoluteHigh); // was EPriorityMore
202 CTrapCleanup* cleanup=CTrapCleanup::New();
206 CActiveScheduler* scheduler = NULL;
207 CFileLoggerServer* server = NULL;
210 scheduler = new CActiveScheduler;
211 if (scheduler == NULL)
215 CActiveScheduler::Install(scheduler);
216 TRAP(ret, server = CFileLoggerServer::NewL());
220 RProcess::Rendezvous(ret);
223 CActiveScheduler::Start();