/** * Diese Methode erstellt eine Verbindung zum Datenverteiler anhand der Standard-Parameter her. * * @param application Applikation, die eine Verbindung zum Datenverteiler benötigt. * @param applicationTypePid Pid des Applikationstyps. Der Datenverteiler erzeugt für die * Appliaktion ein Objekt dieses Typs. Der Applikationstyp sollte "typ.applikation" sein oder * davon abgeleitet sein. * @param args Aufrufargumente der Applikation */ public static void run( StandardApplication application, String applicationTypePid, String[] args) { createApplicationLabel(args); final ArgumentList argumentList = new ArgumentList(args); initializeDebug(application, argumentList); Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler()); try { // ArgumentListe wird in ClientDavParameters konvertiert final ClientDavParameters parameters = new ClientDavParameters(argumentList); parameters.setApplicationTypePid(applicationTypePid); parameters.setApplicationName(_applicationName); // zuerst darf die Applikation die ArgumentListe durcharbeiten application.parseArguments(argumentList); argumentList.ensureAllArgumentsUsed(); final ClientDavInterface connection = new ClientDavConnection(parameters); // Fertigmeldung für Start/Stop wird eplizit selbst übernommen establishConnection(connection); _applicationLabel.append( connection.getLocalConfigurationAuthority().getPid()); // ApplikationsKennung MessageSender.getInstance().init(connection, _applicationName, _applicationLabel.toString()); application.initialize(connection); // Fertigmeldung wird gesendet connection.sendApplicationReadyMessage(); } catch (Exception ex) { _debug.error("Fehler", ex); System.exit(1); } }
/* * A few methods you might want to add to. * See StandardApplication for more details. */ public void startup(Config appConfig) throws ApplicationException { super.startup(appConfig); // Here is where you would read application-specific settings from // your config file. }