ee752c9564bd6866b0e693ab40572dd9335259ec
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / services / RequestContextUtil.java
1 /**
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.openflowplugin.impl.services;
9
10 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
11
12 import org.slf4j.Logger;
13
14 public final class RequestContextUtil {
15
16     private static final Logger LOG = org.slf4j.LoggerFactory.getLogger(RequestContextUtil.class);
17
18     private RequestContextUtil() {
19         throw new UnsupportedOperationException();
20     }
21
22
23     static void closeRequstContext(final RequestContext<?> requestContext) {
24         try {
25             requestContext.close();
26         } catch (Exception e) {
27             LOG.debug("Request context wasn't closed. Exception message: {}",e.getMessage());
28         }
29     }
30 }