Skip to content

Package: OnClose

OnClose

Coverage

1: /*
2: * Copyright (c) 2018, 2019 Oracle and/or its affiliates and others.
3: * All rights reserved.
4: *
5: * This program and the accompanying materials are made available under the
6: * terms of the Eclipse Public License v. 2.0, which is available at
7: * http://www.eclipse.org/legal/epl-2.0.
8: *
9: * This Source Code may also be made available under the following Secondary
10: * Licenses when the conditions for such availability set forth in the
11: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12: * version 2 with the GNU Classpath Exception, which is available at
13: * https://www.gnu.org/software/classpath/license.html.
14: *
15: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16: */
17:
18: package jakarta.websocket;
19:
20: import java.lang.annotation.ElementType;
21: import java.lang.annotation.Retention;
22: import java.lang.annotation.RetentionPolicy;
23: import java.lang.annotation.Target;
24:
25: /**
26: * This method level annotation can be used to decorate a Java method that wishes to be called when a web socket session
27: * is closing.
28: *
29: * <p>
30: * The method may only take the following parameters:-
31: * <ul>
32: * <li>optional {@link Session} parameter</li>
33: * <li>optional {@link CloseReason} parameter</li>
34: * <li>Zero to n String parameters annotated with the {@code jakarta.websocket.server.PathParam} annotation.</li>
35: * </ul>
36: *
37: * <p>
38: * The parameters may appear in any order. See {@link Endpoint#onClose} for more details on how the session parameter
39: * may be used during method calls annotated with this annotation.
40: *
41: * @author dannycoward
42: */
43: @Retention(RetentionPolicy.RUNTIME)
44: @Target(ElementType.METHOD)
45: public @interface OnClose {
46:
47: }