Initial framework migration to netty.
[bgpcep.git] / framework / src / main / java / org / opendaylight / protocol / framework / SessionParent.java
1 /*
2  * Copyright (c) 2013 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.protocol.framework;
9
10 import java.io.Closeable;
11
12 /**
13  * Interface that groups together the classes that can create a session (Dispatcher and Server). When a session is
14  * closing, it has to notify its parent about closing. Each parent keeps a Map of its sessions. When some session
15  * closes, it fires onSessionClosed event with its own instance as parameter and the parent of this session will remove
16  * it from his map.
17  */
18 public interface SessionParent extends Closeable {
19
20         /**
21          * This listener method is called when a session that was created by a class implementing this interface, is
22          * closing. Implementation should remove corresponding session from its list of sessions.
23          * 
24          * @param session a session that is closing
25          */
26         public void onSessionClosed(final ProtocolSession session);
27 }