sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/utils/JarClassLoader.java
changeset 2 b9ab3b238396
equal deleted inserted replaced
1:1050670c6980 2:b9ab3b238396
       
     1 /*
       
     2  * Copyright (c) 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 the License "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  *
       
    16  */
       
    17 
       
    18 package com.nokia.carbide.cpp.internal.pi.utils;
       
    19 
       
    20 import java.net.URL;
       
    21 import java.net.URLClassLoader;
       
    22 
       
    23 public class JarClassLoader extends URLClassLoader 
       
    24 {
       
    25 	public JarClassLoader(URL url) {
       
    26 		super(new URL[] { url });
       
    27 	}
       
    28 
       
    29 	public Object getInstace(String name)
       
    30 	{
       
    31 		Class c;
       
    32 		try {
       
    33 			c = loadClass(name);
       
    34 			try {
       
    35 				return c.newInstance();
       
    36 			} catch (InstantiationException e) {
       
    37 				e.printStackTrace();
       
    38 			} catch (IllegalAccessException e) {
       
    39 				e.printStackTrace();
       
    40 			}
       
    41 		} catch (ClassNotFoundException e) {
       
    42 			e.printStackTrace();
       
    43 		}
       
    44 		return null;
       
    45 	}
       
    46 
       
    47 }