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

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

Release 1.1.0

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 *
13 * @param <INTYPE> the type of incoming messages. Incoming messages are
14 * received through Listener#not. Incoming messages are usually
15 * asynchronous.
16 * @param <OUTTYPE> the type of outgoing messages. Outgoing messages can be sent
17 * directly with #send.
18 */
19public interface ConnectionFactory<INTYPE, OUTTYPE> {
20 /**
21 *
22 * @param reference the {@link Reference} to a {@link Connectable}
23 * @return connection to provided reference
24 * @throws IOException if the connection can not be made because
25 * of a network or address related problem.
26 * This points to something non-trivially
27 * that may require user intervention to fix
28 * something.
29 * @throws NoResourcesNowException if the connection can not be made at this
30 * moment because of lack of resources on
31 * the server. This suggest to retry later.
32 */
33 ConnectionEnd<INTYPE, OUTTYPE> connect(Reference reference)
34 throws IOException, NoResourcesNowException;
35
36}
Note: See TracBrowser for help on using the repository browser.