From 586c2dee754a9433d833252adef4c07760a62146 Mon Sep 17 00:00:00 2001 From: Will Yates Date: Wed, 16 Oct 2019 12:04:38 +0200 Subject: [PATCH] add purge queue to explorer example --- .../src/demo/SimpleServletFilter.java | 11 ++++++++++- maven/demo-war/demo-maven-war.launch | 6 ++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/explorer/demo-explorer-war/src/demo/SimpleServletFilter.java b/explorer/demo-explorer-war/src/demo/SimpleServletFilter.java index 489b756..9c8189f 100644 --- a/explorer/demo-explorer-war/src/demo/SimpleServletFilter.java +++ b/explorer/demo-explorer-war/src/demo/SimpleServletFilter.java @@ -32,7 +32,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha tsq = new TSQ(); tsq.setName(SimpleServlet.TSQ_NAME); tsq.setType(TSQType.MAIN); - this.destroy(); + purgeQueue(tsq); Faker faker = new Faker(); @@ -66,4 +66,13 @@ public void destroy() { } } + private void purgeQueue(TSQ tsq){ + try{ + tsq.delete(); + }catch(CicsConditionException cce){ + //purging the queue will fail if the queue doesn't exist + //so ignore this exception + } + } + } diff --git a/maven/demo-war/demo-maven-war.launch b/maven/demo-war/demo-maven-war.launch index 17a6b13..2f148a6 100644 --- a/maven/demo-war/demo-maven-war.launch +++ b/maven/demo-war/demo-maven-war.launch @@ -6,8 +6,10 @@ - - + + +