[+/-]
ClusterJHelper provides helper methods to bridge between the API and the implementation.
public class com.mysql.clusterj.ClusterJHelper {
// Public Constructorspublic ClusterJHelper();
// Public Static Methodspublic static T getServiceInstance(java.lang.Class<T> cls);
public static T getServiceInstance(java.lang.Class<T> cls,
java.lang.ClassLoader loader);public static T getServiceInstance(java.lang.Class<T> cls,
java.lang.String implementationClassName);public static java.util.List<T> getServiceInstances(java.lang.Class<T> cls,
java.lang.ClassLoader loader,
java.lang.StringBuffer errorMessages);public static com.mysql.clusterj.SessionFactory getSessionFactory(java.util.Map props);
public static com.mysql.clusterj.SessionFactory getSessionFactory(java.util.Map props,
java.lang.ClassLoader loader);
}
Methods inherited from
java.lang.Object:
equals
, getClass
, hashCode
, notify
, notifyAll
, toString
, wait
public static T getServiceInstance(java.lang.Class<T> cls);
Locate a service implementation by services lookup of the context class loader.
Parameters | |
cls |
the class of the factory |
return |
the service instance |
public static T getServiceInstance(java.lang.Class<T> cls,
java.lang.ClassLoader loader);
Locate a service implementation for a service by services lookup of a specific class loader. The first service instance found is returned.
Parameters | |
cls |
the class of the factory |
loader |
the class loader for the factory implementation |
return |
the service instance |
public static T getServiceInstance(java.lang.Class<T> cls,
java.lang.String implementationClassName);
Locate a service implementation for a service. If the implementation name is not null, use it instead of looking up. If the implementation class is not loadable or does not implement the interface, throw an exception.
Parameters | |
cls |
|
implementationClassName |
|
return |
the implementation instance for a service |
public static java.util.List<T> getServiceInstances(java.lang.Class<T> cls,
java.lang.ClassLoader loader,
java.lang.StringBuffer errorMessages);
Locate all service implementations by services lookup of a specific class loader. Implementations in the services file are instantiated and returned. Failed instantiations are remembered in the errorMessages buffer.
Parameters | |
cls |
the class of the factory |
loader |
the class loader for the factory implementation |
errorMessages |
a buffer used to hold the error messages |
return |
the service instance |
public static com.mysql.clusterj.SessionFactory getSessionFactory(java.util.Map props);
Locate a SessionFactory implementation by services lookup. The class loader used is the thread's context class loader.
Parameters | |
props |
properties of the session factory |
return |
the session factory |
Exceptions
ClusterFatalUserException
if the connection to the cluster cannot be made
public static com.mysql.clusterj.SessionFactory getSessionFactory(java.util.Map props,
java.lang.ClassLoader loader);
Locate a SessionFactory implementation by services lookup of a specific class loader. The properties are a Map that might contain implementation-specific properties plus standard properties.
Parameters | |
props |
the properties for the factory |
loader |
the class loader for the factory implementation |
return |
the session factory |
Exceptions
ClusterFatalUserException
if the connection to the cluster cannot be made