InboundResourceAdapter inboundResourceadapter,
ArrayList<AdminObject> adminObjs)
throws Exception
{
// Vendor name
XsdString vendorName = null;
if (conAnnotation != null)
vendorName = new XsdString(conAnnotation.vendorName(), null);
// Description
ArrayList<LocalizedXsdString> descriptions = null;
if (conAnnotation != null && conAnnotation.description() != null && conAnnotation.description().length != 0)
{
descriptions = new ArrayList<LocalizedXsdString>(conAnnotation.description().length);
for (String descriptionAnnoptation : conAnnotation.description())
{
descriptions.add(new LocalizedXsdString(descriptionAnnoptation, null));
}
}
// Display name
ArrayList<LocalizedXsdString> displayNames = null;
if (conAnnotation != null && conAnnotation.description() != null && conAnnotation.displayName().length != 0)
{
displayNames = new ArrayList<LocalizedXsdString>(conAnnotation.displayName().length);
for (String displayNameAnnotation : conAnnotation.displayName())
{
displayNames.add(new LocalizedXsdString(displayNameAnnotation, null));
}
}
// EIS type
XsdString eisType = null;
if (conAnnotation != null)
eisType = new XsdString(conAnnotation.eisType(), null);
// License description
// License required
ArrayList<LocalizedXsdString> licenseDescriptions = null;
if (conAnnotation != null && conAnnotation.licenseDescription() != null &&
conAnnotation.licenseDescription().length != 0)
{
licenseDescriptions = new ArrayList<LocalizedXsdString>(conAnnotation.licenseDescription().length);
for (String licenseDescriptionAnnotation : conAnnotation.licenseDescription())
{
licenseDescriptions.add(new LocalizedXsdString(licenseDescriptionAnnotation, null));
}
}
LicenseType license = null;
if (conAnnotation != null)
license = new LicenseType(licenseDescriptions, conAnnotation.licenseRequired(), null);
// RequiredWorkContext
ArrayList<String> requiredWorkContexts = null;
Class<? extends WorkContext>[] requiredWorkContextAnnotations = null;
if (conAnnotation != null)
requiredWorkContextAnnotations = conAnnotation.requiredWorkContexts();
if (requiredWorkContextAnnotations != null)
{
requiredWorkContexts = new ArrayList<String>(requiredWorkContextAnnotations.length);
for (Class<? extends WorkContext> requiredWorkContext : requiredWorkContextAnnotations)
{
if (!requiredWorkContexts.contains(requiredWorkContext.getName()))
{
if (trace)
log.trace("RequiredWorkContext=" + requiredWorkContext.getName());
requiredWorkContexts.add(requiredWorkContext.getName());
}
}
}
// Large icon
// Small icon
ArrayList<Icon> icons = null;
if (conAnnotation != null && ((conAnnotation.smallIcon() != null && conAnnotation.smallIcon().length != 0) ||
(conAnnotation.largeIcon() != null && conAnnotation.largeIcon().length != 0)))
{
icons = new ArrayList<Icon>(
(conAnnotation.smallIcon() == null ? 0 : conAnnotation.smallIcon().length) +
(conAnnotation.largeIcon() == null ? 0 : conAnnotation.largeIcon().length));
if (conAnnotation.smallIcon() != null && conAnnotation.smallIcon().length > 0)
{
for (String smallIconAnnotation : conAnnotation.smallIcon())
{
if (smallIconAnnotation != null && !smallIconAnnotation.trim().equals(""))
icons.add(new Icon(new XsdString(smallIconAnnotation, null), null, null));
}
}
if (conAnnotation.largeIcon() != null && conAnnotation.largeIcon().length > 0)
{
for (String largeIconAnnotation : conAnnotation.largeIcon())
{
if (largeIconAnnotation != null && !largeIconAnnotation.trim().equals(""))
icons.add(new Icon(null, new XsdString(largeIconAnnotation, null), null));
}
}
}
// Transaction support
TransactionSupport.TransactionSupportLevel transactionSupportAnnotation = null;
TransactionSupportEnum transactionSupport = null;
if (conAnnotation != null)
transactionSupportAnnotation = conAnnotation.transactionSupport();
if (transactionSupportAnnotation != null)
transactionSupport = TransactionSupportEnum.valueOf(transactionSupportAnnotation.name());
// Reauthentication support
boolean reauthenticationSupport = false;
if (conAnnotation != null)
reauthenticationSupport = conAnnotation.reauthenticationSupport();
// AuthenticationMechanism
ArrayList<AuthenticationMechanism> authenticationMechanisms = null;
if (conAnnotation != null)
authenticationMechanisms = processAuthenticationMechanism(conAnnotation.authMechanisms());
OutboundResourceAdapter outboundResourceadapter = new OutboundResourceAdapterImpl(connectionDefinitions,
transactionSupport,
authenticationMechanisms,
reauthenticationSupport, null);
// Security permission
ArrayList<SecurityPermission> securityPermissions = null;
if (conAnnotation != null)
securityPermissions = processSecurityPermissions(conAnnotation.securityPermissions());
ArrayList<ConfigProperty> validProperties = new ArrayList<ConfigProperty>();
if (configProperties != null)
{
validProperties.addAll(configProperties);
}
if (plainConfigProperties != null && raClass != null)
{
Set<String> raClasses = getClasses(raClass, classLoader);
for (ConfigProperty configProperty16 : plainConfigProperties)
{
if (raClasses.contains(((ConfigProperty16Impl) configProperty16).getAttachedClassName()))
{
if (trace)
log.tracef("Attaching: %s (%s)", configProperty16, raClass);
validProperties.add(configProperty16);
}
}
}
validProperties.trimToSize();
ResourceAdapter1516Impl resourceAdapter = new ResourceAdapter1516Impl(raClass, validProperties,
outboundResourceadapter,
inboundResourceadapter, adminObjs,
securityPermissions, null);
XsdString resourceadapterVersion = null;
if (conAnnotation != null && conAnnotation.version() != null && !conAnnotation.version().trim().equals(""))
resourceadapterVersion = new XsdString(conAnnotation.version(), null);
return new Connector16Impl("", vendorName, eisType, resourceadapterVersion, license, resourceAdapter,
requiredWorkContexts, false, descriptions, displayNames, icons, null);
}