X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fserver%2FTestKill.java;fp=auth%2Fauth-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fserver%2FTestKill.java;h=0000000000000000000000000000000000000000;hb=3505a52ac853c134ecaf40f2977667de8770ec59;hp=78172a22f78c0856e5464d48b4038c7d1ff96d4a;hpb=168005a073b1ae83cb3415bcc74db925915e9b3d;p=aaf%2Fauthz.git diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/server/TestKill.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/server/TestKill.java deleted file mode 100644 index 78172a22..00000000 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/server/TestKill.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * ============LICENSE_START==================================================== - * org.onap.aaf - * =========================================================================== - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * =========================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END==================================================== - */ - -package org.onap.aaf.auth.server; - -import java.io.IOException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -public class TestKill implements Runnable { - - public static void main(String[] args) { - ExecutorService es = Executors.newSingleThreadExecutor(); - TestKill tk = new TestKill(); - Future app = es.submit(tk); - Runtime.getRuntime().addShutdownHook(new Thread() { - @Override - public void run() { - System.out.println("Shutdown Hook, thread: setting interrupt"); - app.cancel(true); - tk.longProcess(); - es.shutdown(); - } - }); - System.out.println("Service Start"); - System.out.print("Hit to end:"); - try { - System.in.read(); - System.exit(0); - } catch (IOException e) { - } - } - - @Override - public void run() { - } - - private void longProcess() { - System.out.println("Starting long cleanup process"); - try { - Thread.sleep(10000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - System.out.println("Ending long cleanup process"); - } -}