| 1 | From 74c0cd039e6decca96c93891472988c964b4712c Mon Sep 17 00:00:00 2001
|
| 2 | From: Struan Robertson <[email protected]>
|
| 3 | Date: Fri, 24 Oct 2025 01:15:37 +0100
|
| 4 | Subject: [PATCH] Remove windows service code
|
| 5 |
|
| 6 | ---
|
| 7 | src/java/davmail/service/DavService.java | 85 ------------------------
|
| 8 | 1 file changed, 85 deletions(-)
|
| 9 | delete mode 100644 src/java/davmail/service/DavService.java
|
| 10 |
|
| 11 | diff --git a/src/java/davmail/service/DavService.java b/src/java/davmail/service/DavService.java
|
| 12 | deleted file mode 100644
|
| 13 | index 9efa9255..00000000
|
| 14 | |
| 15 | |
| 16 | @@ -1,85 +0,0 @@
|
| 17 | -/*
|
| 18 | - * DavMail POP/IMAP/SMTP/CalDav/LDAP Exchange Gateway
|
| 19 | - * Copyright (C) 2009 Mickael Guessant
|
| 20 | - *
|
| 21 | - * This program is free software; you can redistribute it and/or
|
| 22 | - * modify it under the terms of the GNU General Public License
|
| 23 | - * as published by the Free Software Foundation; either version 2
|
| 24 | - * of the License, or (at your option) any later version.
|
| 25 | - *
|
| 26 | - * This program is distributed in the hope that it will be useful,
|
| 27 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 28 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 29 | - * GNU General Public License for more details.
|
| 30 | - *
|
| 31 | - * You should have received a copy of the GNU General Public License
|
| 32 | - * along with this program; if not, write to the Free Software
|
| 33 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
| 34 | - */
|
| 35 | -package davmail.service;
|
| 36 | -
|
| 37 | -import davmail.BundleMessage;
|
| 38 | -import davmail.DavGateway;
|
| 39 | -import davmail.Settings;
|
| 40 | -import davmail.ui.tray.DavGatewayTray;
|
| 41 | -import org.boris.winrun4j.AbstractService;
|
| 42 | -
|
| 43 | -/**
|
| 44 | - * WinRun4J DavMail service.
|
| 45 | - */
|
| 46 | -public class DavService extends AbstractService {
|
| 47 | -
|
| 48 | - private final Object LOCK = new Object();
|
| 49 | -
|
| 50 | - /**
|
| 51 | - * Perform a service request.
|
| 52 | - *
|
| 53 | - * @param control service control.
|
| 54 | - * @return return code.
|
| 55 | - */
|
| 56 | - @Override
|
| 57 | - public int serviceRequest(int control) {
|
| 58 | - switch (control) {
|
| 59 | - case SERVICE_CONTROL_STOP:
|
| 60 | - case SERVICE_CONTROL_SHUTDOWN:
|
| 61 | - DavGatewayTray.debug(new BundleMessage("LOG_STOPPING_DAVMAIL"));
|
| 62 | - DavGateway.stop();
|
| 63 | - synchronized (LOCK) {
|
| 64 | - LOCK.notifyAll();
|
| 65 | - }
|
| 66 | - }
|
| 67 | - return 0;
|
| 68 | - }
|
| 69 | -
|
| 70 | - /**
|
| 71 | - * Run the service.
|
| 72 | - *
|
| 73 | - * @param args command line arguments
|
| 74 | - * @return return code
|
| 75 | - */
|
| 76 | - public int serviceMain(String[] args) {
|
| 77 | - if (args.length >= 1) {
|
| 78 | - Settings.setConfigFilePath(args[0]);
|
| 79 | - }
|
| 80 | -
|
| 81 | - Settings.load();
|
| 82 | - if (!Settings.getBooleanProperty("davmail.server")) {
|
| 83 | - Settings.setProperty("davmail.server", "true");
|
| 84 | - Settings.updateLoggingConfig();
|
| 85 | - }
|
| 86 | -
|
| 87 | - DavGateway.start();
|
| 88 | - DavGatewayTray.debug(new BundleMessage("LOG_DAVMAIL_STARTED"));
|
| 89 | -
|
| 90 | - synchronized (LOCK) {
|
| 91 | - try {
|
| 92 | - LOCK.wait();
|
| 93 | - } catch (InterruptedException e) {
|
| 94 | - DavGatewayTray.debug(new BundleMessage("LOG_GATEWAY_INTERRUPTED"));
|
| 95 | - Thread.currentThread().interrupt();
|
| 96 | - }
|
| 97 | - }
|
| 98 | -
|
| 99 | - return 0;
|
| 100 | - }
|
| 101 | -}
|
| 102 | --
|
| 103 | 2.51.0
|
| 104 |
|