Skip to content

Package: OnError

OnError

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 in order to handle
27: * errors. See {@link Endpoint#onError} for a description of the different categories of error.
28: *
29: * <p>
30: * The method may only take the following parameters:-
31: * <ul>
32: * <li>optional {@link Session} parameter</li>
33: * <li>a {@link java.lang.Throwable} 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.
39: *
40: * @author dannycoward
41: */
42: @Retention(RetentionPolicy.RUNTIME)
43: @Target(ElementType.METHOD)
44: public @interface OnError {
45:
46: }