1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2015 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
package org.cybertaxonomy.utis.client;
|
11
|
|
12
|
import org.slf4j.Logger;
|
13
|
import org.slf4j.LoggerFactory;
|
14
|
|
15
|
/**
|
16
|
* @author a.kohlbecker
|
17
|
* @date Oct 29, 2015
|
18
|
*
|
19
|
*/
|
20
|
public class ClientFactory {
|
21
|
|
22
|
protected Logger logger = LoggerFactory.getLogger(ClientFactory.class);
|
23
|
|
24
|
public <T extends AbstractClient<?>> T newClient(Class<T> clientClass) {
|
25
|
|
26
|
T instance = null;
|
27
|
|
28
|
logger.debug("Creating new instance of " + clientClass.getName());
|
29
|
try {
|
30
|
instance = clientClass.newInstance();
|
31
|
} catch (InstantiationException e) {
|
32
|
// TODO Auto-generated catch block
|
33
|
e.printStackTrace();
|
34
|
} catch (IllegalAccessException e) {
|
35
|
// TODO Auto-generated catch block
|
36
|
e.printStackTrace();
|
37
|
}
|
38
|
|
39
|
return instance;
|
40
|
}
|
41
|
|
42
|
}
|