PageRenderTime 40ms CodeModel.GetById 32ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/protocols/jain-megaco/megaco-api/src/main/java/javax/megaco/MegacoFactory.java

http://mobicents.googlecode.com/
Java | 26 lines | 21 code | 4 blank | 1 comment | 0 complexity | 5e9fe2dcf46acace30bb37f005a1f78b MD5 | raw file
 1package javax.megaco;
 2
 3public class MegacoFactory extends ClassLoader {
 4
 5	
 6	public java.lang.Object createMegacoObject(java.lang.String objectClassName)
 7			throws MegacoPeerUnvbleException {
 8		//TODO : implemet the ClassLoader
 9		String className = objectClassName + ".javax.megaco.MegacoStackImpl";
10		Class impl;
11		try {
12			impl = MegacoFactory.class.getClassLoader().loadClass(className);
13			return (MegacoStack) impl.newInstance();
14		} catch (ClassNotFoundException e) {
15			e.printStackTrace();
16			throw new MegacoPeerUnvbleException(e.getMessage());
17		} catch (InstantiationException e) {
18			e.printStackTrace();
19			throw new MegacoPeerUnvbleException(e.getMessage());
20		} catch (IllegalAccessException e) {
21			e.printStackTrace();
22			throw new MegacoPeerUnvbleException(e.getMessage());
23		}
24
25	}
26}