1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.mina.registry;
20
21 import java.io.IOException;
22 import java.util.Set;
23
24 import org.apache.mina.common.TransportType;
25 import org.apache.mina.io.IoAcceptor;
26 import org.apache.mina.io.IoHandler;
27 import org.apache.mina.protocol.ProtocolAcceptor;
28 import org.apache.mina.protocol.ProtocolProvider;
29
30 /***
31 * Interface for the internet service registry. The registry is used by MINA
32 * to associate services with ports and transport protocols.
33 *
34 * @author akarasulu@apache.org
35 * @author trustin@apache.org
36 * @version $Rev: 210062 $, $Date: 2005-07-11 12:52:38 +0900 $
37 */
38 public interface ServiceRegistry
39 {
40 /***
41 * Binds the specified I/O handler to the specified service.
42 */
43 void bind( Service service, IoHandler ioHandler ) throws IOException;
44
45 /***
46 * Binds the specified protocol provider to the specified service.
47 */
48 void bind( Service service, ProtocolProvider protocolProvider )
49 throws IOException;
50
51 /***
52 * Unbinds the specified service (and its aggregated I/O handler or
53 * protocol provider).
54 */
55 void unbind( Service service );
56
57 /***
58 * Unbinds all services (and their aggregated I/O handlers or
59 * protocol providers).
60 */
61 void unbindAll();
62
63 /***
64 * Returns {@link Set} of all services bound in this registry.
65 */
66 Set getAllServices();
67
68 /***
69 * Returns {@link Set} of services bound in this registry with the
70 * specified service(or protocol) name.
71 */
72 Set getServices(String name);
73
74 /***
75 * Returns {@link Set} of services bound in this registry with the
76 * specified transport type.
77 */
78 Set getServices(TransportType transportType);
79
80 /***
81 * Returns {@link Set} of services bound in this registry with the
82 * specified port number.
83 */
84 Set getServices(int port);
85
86 IoAcceptor getIoAcceptor( TransportType transportType );
87
88 ProtocolAcceptor getProtocolAcceptor( TransportType transportType );
89 }