org.hibersap.execution.jca.cci
Class AbstractConnectionSpecFactory
java.lang.Object
org.hibersap.execution.jca.cci.AbstractConnectionSpecFactory
- All Implemented Interfaces:
- ConnectionSpecFactory
- Direct Known Subclasses:
- SapBapiJcaAdapterConnectionSpecFactory
public abstract class AbstractConnectionSpecFactory
- extends Object
- implements ConnectionSpecFactory
Offers methods to help accessing and instantiating the ConnectionSpec implementation. May be used
to implement a new ConnectionSpecFactory.
- Author:
- Carsten Erker
Method Summary |
protected Class<? extends javax.resource.cci.ConnectionSpec> |
getConnectionSpecClass(String connectionSpecClass)
Looks up and returns the specified class. |
protected javax.resource.cci.ConnectionSpec |
newConnectionSpecInstance(Class<?> connectionSpecClass,
Class<?>[] constructorParameterTypes,
Object[] constructorArguments)
Creates a new instance of the specified ConnectionSpec implementation class via reflection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractConnectionSpecFactory
public AbstractConnectionSpecFactory()
getConnectionSpecClass
protected Class<? extends javax.resource.cci.ConnectionSpec> getConnectionSpecClass(String connectionSpecClass)
throws ClassNotFoundException,
IllegalArgumentException
- Looks up and returns the specified class. First, it will try to get the class from the
context class loader, if not found, it will try to get it from the current class loader.
- Parameters:
connectionSpecClass
- The fully qualified class name of the ConnectionSpec
implementation.
- Returns:
- The Class object of the ConnectionSpec implementation
- Throws:
ClassNotFoundException
- - if the class could not be found.
IllegalArgumentException
- - if the class does not implement
javax.resource.cci.ConnectionSpec.
newConnectionSpecInstance
protected javax.resource.cci.ConnectionSpec newConnectionSpecInstance(Class<?> connectionSpecClass,
Class<?>[] constructorParameterTypes,
Object[] constructorArguments)
throws InternalHiberSapException
- Creates a new instance of the specified ConnectionSpec implementation class via reflection.
- Parameters:
connectionSpecClass
- The class to instantiate. Must implement
javax.resource.cci.ConnectionSpec.constructorParameterTypes
- The types of the constructor's parameters. Used to determine
which constructor should be used.constructorArguments
- The constructor's arguments used when creating a new instance of
the class. Must match the constructorParameterTypes.
- Returns:
- The instance of the ConnectionSpec implementation
- Throws:
InternalHiberSapException
- - if there the class could not be accessed or instantiated,
see cause for the actual reason.
Copyright © 2011 akquinet tech@spree GmbH. All Rights Reserved.