}
ZipFile zipFile = new ZipFile(rarFile);
boolean hasRaXml = false;
boolean exsitNativeFile = false;
Connector connector = null;
ArrayList<String> names = new ArrayList<String>();
ArrayList<String> xmls = new ArrayList<String>();
Enumeration<? extends ZipEntry> zipEntries = zipFile.entries();
while (zipEntries.hasMoreElements())
{
ZipEntry ze = (ZipEntry) zipEntries.nextElement();
String name = ze.getName();
names.add(name);
if (name.endsWith(".xml") && name.startsWith("META-INF") && !name.endsWith("pom.xml"))
xmls.add(name);
if (name.endsWith(".so") || name.endsWith(".a") || name.endsWith(".dll"))
exsitNativeFile = true;
if (name.equals(RAXML_FILE))
{
hasRaXml = true;
InputStream raIn = zipFile.getInputStream(ze);
RaParser parser = new RaParser();
connector = parser.parse(raIn);
raIn.close();
}
}
if (!hasRaXml)
{
System.out.println("JCA annotations aren't supported");
System.exit(OTHER);
}
if (connector == null)
{
System.out.println("can't parse ra.xml");
System.exit(OTHER);
}
URLClassLoader cl = loadClass(rarFile, cps);
if (stdout)
{
out = System.out;
}
else if (!reportFile.isEmpty())
{
out = new PrintStream(reportFile);
}
else
{
out = new PrintStream(rarFile.substring(0, rarFile.length() - 4) + REPORT_FILE);
}
String archiveFile;
int sep = rarFile.lastIndexOf(File.separator);
if (sep > 0)
archiveFile = rarFile.substring(sep + 1);
else
archiveFile = rarFile;
out.println("Archive:\t" + archiveFile);
String version;
String type = "";
ResourceAdapter ra;
boolean reauth = false;
if (connector.getVersion() == Version.V_10)
{
version = "1.0";
ra = connector.getResourceadapter();
type = "OutBound";
reauth = ((ResourceAdapter10)ra).getReauthenticationSupport();
}
else
{
if (connector.getVersion() == Version.V_15)
version = "1.5";
else
version = "1.6";
ResourceAdapter1516 ra1516 = (ResourceAdapter1516)connector.getResourceadapter();
ra = ra1516;
if (ra1516.getOutboundResourceadapter() != null)
{
reauth = ra1516.getOutboundResourceadapter().getReauthenticationSupport();
if (ra1516.getInboundResourceadapter() != null)
type = "Bidirectional";
else
type = "OutBound";
}
else
{
if (ra1516.getInboundResourceadapter() != null)
type = "InBound";
else
{
out.println("Rar file has problem");
System.exit(ERROR);
}
}
}
out.println("JCA version:\t" + version);
out.println("Type:\t\t" + type);
out.print("Reauth:\t\t");
if (reauth)
out.println("Yes");
else
out.println("No");
int systemExitCode = Validation.validate(new File(rarFile).toURI().toURL(), ".", cps);
String compliant;
if (systemExitCode == SUCCESS)
compliant = "Yes";
else
compliant = "No";
out.println("Compliant:\t" + compliant);
out.print("Native:\t\t");
if (exsitNativeFile)
out.println("Yes");
else
out.println("No");
Collections.sort(names);
out.println();
out.println("Structure:");
out.println("----------");
for (String name : names)
{
out.println(name);
}
String classname = "";
Map<String, String> raConfigProperties = null;
TransactionSupportEnum transSupport = TransactionSupportEnum.NoTransaction;
List<CommonAdminObject> adminObjects = null;
List<CommonConnDef> connDefs = null;
CommonSecurityImpl secImpl = new CommonSecurityImpl("", "", true);
CommonPoolImpl poolImpl = new CommonPoolImpl(0, 10, Defaults.PREFILL, Defaults.USE_STRICT_MIN,
Defaults.FLUSH_STRATEGY);
CommonXaPoolImpl xaPoolImpl = new CommonXaPoolImpl(0, 10, Defaults.PREFILL, Defaults.USE_STRICT_MIN,
Defaults.FLUSH_STRATEGY, Defaults.IS_SAME_RM_OVERRIDE, Defaults.INTERLEAVING,
Defaults.PAD_XID, Defaults.WRAP_XA_RESOURCE, Defaults.NO_TX_SEPARATE_POOL);
if (connector.getVersion() != Version.V_10)
{
ResourceAdapter1516 ra1516 = (ResourceAdapter1516)ra;
Map<String, String> introspected;
if (ra1516.getResourceadapterClass() != null && !ra1516.getResourceadapterClass().equals(""))