backupandrestore/backupengine/inc/javamanagerinterface.inl
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 /*
       
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * JavaManagerInterface plugin interface.
       
    16 * Constructor.
       
    17 * 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 /**
       
    24  @file
       
    25  @publishedPartner
       
    26  @released
       
    27 */
       
    28 inline CJavaManagerInterface::CJavaManagerInterface()
       
    29 
       
    30 	{		
       
    31 	}
       
    32  
       
    33 /** 
       
    34  * Destructor.
       
    35  * 
       
    36  */ 
       
    37 inline CJavaManagerInterface::~CJavaManagerInterface()
       
    38 	{
       
    39 	REComSession::DestroyedImplementation(iDtor_ID_Key);
       
    40 	}
       
    41     
       
    42 /** 
       
    43  * static function to create and return the object.
       
    44  * 
       
    45  * @return CJavaManagerInterface* Pointer to newly instantiated object.
       
    46  */
       
    47 CJavaManagerInterface* CJavaManagerInterface::NewL( const TUid& aImplementationUid )
       
    48 	{
       
    49 	
       
    50 	RImplInfoPtrArray implementationsArray;
       
    51 	CleanupResetAndDestroyPushL(implementationsArray);
       
    52 
       
    53 	
       
    54 	REComSession::ListImplementationsL(KJavaManagerInterfaceUid,implementationsArray );
       
    55 	
       
    56 	TInt isImplementationFound = 0;
       
    57 	
       
    58 	for ( TInt a=0; a<implementationsArray.Count(); a++ )
       
    59 		{
       
    60 		if ( aImplementationUid ==( implementationsArray.operator[](a)->ImplementationUid() ) )
       
    61 			{
       
    62 			isImplementationFound = 1; 
       
    63 			break;
       
    64 			}
       
    65 		}
       
    66 	
       
    67 	if ( implementationsArray.Count() <= 0 || isImplementationFound == 0 )
       
    68 		{
       
    69 		CleanupStack::PopAndDestroy(&implementationsArray);
       
    70 		return NULL;
       
    71 		}	
       
    72 	
       
    73 	TAny* javaManagerInterface = REComSession::CreateImplementationL( implementationsArray.operator[](0)->ImplementationUid(), 
       
    74 								_FOFF(CJavaManagerInterface,iDtor_ID_Key) );   
       
    75 								
       
    76 	CleanupStack::PopAndDestroy(&implementationsArray);								
       
    77 
       
    78 	return reinterpret_cast<CJavaManagerInterface*>(javaManagerInterface);    		
       
    79 	}
       
    80 			
       
    81 		
       
    82 		
       
    83 // End of file