Class ConnectionFactory
java.lang.Object
org.serviceconnector.net.connection.ConnectionFactory
A factory for creating connection objects. Provides access to concrete client instances. Possible connection types are shown as constants below.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateConnection(String key) Creates a new Connection object.static voidinit()Initialize the connection factory.static voidShutdown connection factory.
This method shuts down every resource needed by connections.
-
Constructor Details
-
ConnectionFactory
public ConnectionFactory()
-
-
Method Details
-
createConnection
Creates a new Connection object.- Parameters:
key- the key- Returns:
- the i connection
-
shutdownConnectionFactory
public static void shutdownConnectionFactory()Shutdown connection factory.
This method shuts down every resource needed by connections. Should only be used if whole application shuts down. Be very careful if you use this method - every connection in relation to this channelFactory must be closed otherwise you end up in indefinitely loop. In most cases closing the connections is good enough NETTY will release other resources. http://docs.jboss.org/netty/3.2/api/org/jboss/netty/channel/socket/nio/NioClientSocketChannelFactory.html -
init
public static void init()Initialize the connection factory.
-