• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2014 The gRPC Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package io.grpc.internal;
18 
19 /**
20  * A listener to a server for transport creation events. The listener need not be thread-safe, so
21  * notifications must be properly synchronized externally.
22  */
23 public interface ServerListener {
24 
25   /**
26    * Called upon the establishment of a new client connection.
27    *
28    * @param transport the new transport to be observed.
29    * @return a listener for stream creation events on the transport.
30    */
transportCreated(ServerTransport transport)31   ServerTransportListener transportCreated(ServerTransport transport);
32 
33   /**
34    * The server is shutting down. No new transports will be processed, but existing transports may
35    * continue. Shutdown is only caused by a call to {@link InternalServer#shutdown()}. All
36    * resources have been released.
37    */
serverShutdown()38   void serverShutdown();
39 }
40