String gtwClass = tokens.nextToken().trim();
Object[] args = new Object[] { gtwId, getProperties(), this };
Class<?>[] argsClass = new Class[] { String.class, Properties.class, SMSServer.class };
Class<?> c = Class.forName((gtwClass.indexOf('.') == -1 ? "org.smslib.smsserver.gateways." : "") + gtwClass);
Constructor<?> constructor = c.getConstructor(argsClass);
AGateway gtw = (AGateway) constructor.newInstance(args);
gtw.create();
Service.getInstance().addGateway(gtw.getGateway());
Logger.getInstance().logInfo("SMSServer: added gateway " + gtwId + " / " + gtw.getDescription(), null, null);
}
catch (Exception e)
{
Logger.getInstance().logError("SMSServer: Unknown Gateway in configuration file!", null, null);
}