if (envRef.getResUrl() != null)
{
try
{
container.getEncInjectors().put(encName,
new ValueEncInjector(encName, new URL(envRef.getResUrl().trim()), "<resource-ref>"));
}
catch (MalformedURLException e)
{
throw new RuntimeException(e);
}
}
else if (UserTransaction.class.getName().equals(envRef.getType()))
{
final InjectionContainer ic = container;
InjectorFactory<?> factory = new InjectorFactory<UserTransactionPropertyInjector>()
{
public UserTransactionPropertyInjector create(BeanProperty property)
{
return new UserTransactionPropertyInjector(property, ic);
}
};
if (envRef.getInjectionTargets() != null)
{
TomcatInjectionUtils.createInjectors(container.getEncInjections(), container.getClassloader(),
factory, envRef.getInjectionTargets());
continue;
}
else
{
encName = "java:comp/UserTransaction";
}
}
else if (ORB.class.getName().equals(envRef.getType()))
{
encName = "java:comp/ORB";
}
else
{
throw new RuntimeException("mapped-name is required for " + envRef.getResourceRefName()
+ " of deployment " + container.getIdentifier());
}
}
else if (URL.class.getName().equals(envRef.getType()) && !mappedName.startsWith("java:"))
{
createURLInjector(encName, mappedName, container);
InjectionUtil.injectionTarget(encName, envRef, container, container.getEncInjections());
continue;
}
else if (envRef.getResUrl() != null)
{
try
{
container.getEncInjectors().put(encName,
new ValueEncInjector(encName, new URL(envRef.getResUrl().trim()), "<resource-ref>"));
}
catch (MalformedURLException e)
{
throw new RuntimeException(e);
}