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 The Apache Directory Project (dev@directory.apache.org)
35 * @version $Rev: 332218 $, $Date: 2005-11-10 12:52:42 +0900 $
36 */
37 public interface ServiceRegistry
38 {
39 /***
40 * Binds the specified I/O handler to the specified service.
41 */
42 void bind( Service service, IoHandler ioHandler ) throws IOException;
43
44 /***
45 * Binds the specified protocol provider to the specified service.
46 */
47 void bind( Service service, ProtocolProvider protocolProvider )
48 throws IOException;
49
50 /***
51 * Unbinds the specified service (and its aggregated I/O handler or
52 * protocol provider).
53 */
54 void unbind( Service service );
55
56 /***
57 * Unbinds all services (and their aggregated I/O handlers or
58 * protocol providers).
59 */
60 void unbindAll();
61
62 /***
63 * Returns {@link Set} of all services bound in this registry.
64 */
65 Set getAllServices();
66
67 /***
68 * Returns {@link Set} of services bound in this registry with the
69 * specified service(or protocol) name.
70 */
71 Set getServices(String name);
72
73 /***
74 * Returns {@link Set} of services bound in this registry with the
75 * specified transport type.
76 */
77 Set getServices(TransportType transportType);
78
79 /***
80 * Returns {@link Set} of services bound in this registry with the
81 * specified port number.
82 */
83 Set getServices(int port);
84
85 IoAcceptor getIoAcceptor( TransportType transportType );
86
87 ProtocolAcceptor getProtocolAcceptor( TransportType transportType );
88 }