org.mc4j.ems.connection
Class ConnectionFactory

java.lang.Object
  extended by org.mc4j.ems.connection.ConnectionFactory

public class ConnectionFactory
extends java.lang.Object

Version:
$Revision: 585 $($Author: ghinkl $ / $Date: 2007-08-31 13:32:02 -0400 (Fri, 31 Aug 2007) $)
Author:
Greg Hinkle (ghinkle@users.sourceforge.net), Apr 5, 2005

Field Summary
static ConnectionTypeDescriptor[] CONNECTION_DESCRIPTORS
           
static java.lang.String COPY_JARS_TO_TEMP
           
static java.lang.String JAR_TEMP_DIR
           
 
Constructor Summary
ConnectionFactory()
           
 
Method Summary
 EmsConnection connect(ConnectionSettings connectionSettings)
          Deprecated. Use getConnectionProvider.connect... hold on to the connection provider to reopen the connection
 void discoverServerClasses(ConnectionSettings connectionSettings)
          This will find server classes for a ConnectionSettings by using the supplied LibraryURI of the ConnectionSettings and searching for the ConnectClassPathEntries of the ConnectionType supplied with the settings.
 java.io.File getChild(java.io.File directory, java.lang.String childName)
           
 ConnectionProvider getConnectionProvider(ConnectionSettings connectionSettings)
          Build a connection provider given the settings.
static java.util.List<ConnectionTypeDescriptor> getConnectionTypes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPY_JARS_TO_TEMP

public static final java.lang.String COPY_JARS_TO_TEMP
See Also:
Constant Field Values

JAR_TEMP_DIR

public static final java.lang.String JAR_TEMP_DIR
See Also:
Constant Field Values

CONNECTION_DESCRIPTORS

public static final ConnectionTypeDescriptor[] CONNECTION_DESCRIPTORS
Constructor Detail

ConnectionFactory

public ConnectionFactory()
Method Detail

getConnectionTypes

public static java.util.List<ConnectionTypeDescriptor> getConnectionTypes()

getConnectionProvider

public ConnectionProvider getConnectionProvider(ConnectionSettings connectionSettings)
Build a connection provider given the settings. This should be the prefrence over connect. Each request to connect will reuse the same classloader and provider rather than rebuilding from scratch.

Parameters:
connectionSettings - the connection settings for the connection
Returns:
a ConnectionProvider that you can get live connection from.

connect

public EmsConnection connect(ConnectionSettings connectionSettings)
Deprecated. Use getConnectionProvider.connect... hold on to the connection provider to reopen the connection

Parameters:
connectionSettings - the settings to build the connection on
Returns:
a live connection

discoverServerClasses

public void discoverServerClasses(ConnectionSettings connectionSettings)
This will find server classes for a ConnectionSettings by using the supplied LibraryURI of the ConnectionSettings and searching for the ConnectClassPathEntries of the ConnectionType supplied with the settings.

This method should only be called once. If the entries need to be reset, you should first clear the settings' classpath entries. This method appends class path entries to the existing list.

Parameters:
connectionSettings - the ConnectionSettings to update with recommeneded class path entries

getChild

public java.io.File getChild(java.io.File directory,
                             java.lang.String childName)