source: references/src/main/java/geniusweb/connection/ConnectionFactory.java@ 1

Last change on this file since 1 was 1, checked in by bart, 5 years ago

Initial Release

File size: 1.4 KB
Line 
1package geniusweb.connection;
2
3import java.io.IOException;
4
5import geniusweb.references.Reference;
6import tudelft.utilities.repository.NoResourcesNowException;
7
8/**
9 * factory that can turn a {@link Reference} into a connection to that
10 * reference.
11 *
12 * @param <INTYPE> the type of incoming messages. Incoming messages are
13 * received through Listener#not. Incoming messages are usually
14 * asynchronous.
15 * @param <OUTTYPE> the type of outgoing messages. Outgoing messages can be sent
16 * directly with #send.
17 */
18public interface ConnectionFactory<INTYPE, OUTTYPE> {
19 /**
20 *
21 * @param reference the {@link Reference} to a {@link Connectable}
22 * @return connection to provided reference
23 * @throws IOException if the connection can not be made because
24 * of a network or address related problem.
25 * This points to something non-trivially
26 * that may require user intervention to fix
27 * something.
28 * @throws NoResourcesNowException if the connection can not be made at this
29 * moment because of lack of resources on
30 * the server. This suggest to retry later.
31 */
32 Connection<INTYPE, OUTTYPE> connect(Reference reference)
33 throws IOException, NoResourcesNowException;
34
35}
Note: See TracBrowser for help on using the repository browser.