/**
* Creates a resource adapter program based on the class.
*/
public ResourceAdapterAssociationProgram(Class cl)
{
ResourceArchive ra
= ResourceArchiveManager.findResourceArchive(cl.getName());
if (ra == null) {
throw new ConfigException(L.l("'{0}' does not have a defined resource-adapter. Check the rar or META-INF/resin-ra.xml files",
cl.getName()));
}
InjectManager webBeans = InjectManager.create();
_raController
= webBeans.getReference(ResourceAdapterController.class,
Names.create(ra.getResourceAdapterClass().getName()));
if (_raController == null) {
throw new ConfigException(L.l("'{0}' does not have a configured resource-adapter for '{1}'.",
ra.getResourceAdapterClass().getName(),
cl.getName()));
}
}