{
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(""))
{
out.println();
out.println("Resource-adapter:");
out.println("-----------------");
out.println("Class: " + ra1516.getResourceadapterClass());
introspected = getIntrospectedProperties(ra1516.getResourceadapterClass(), cl);
if (ra1516.getConfigProperties() != null)
{
raConfigProperties = new HashMap<String, String>();
for (ConfigProperty cp : ra1516.getConfigProperties())
{
raConfigProperties.put(getValueString(cp.getConfigPropertyName()),
getValueString(cp.getConfigPropertyValue()));
removeIntrospectedValue(introspected, getValueString(cp.getConfigPropertyName()));
out.println(" Config-property: " + getValueString(cp.getConfigPropertyName()) + " ("
+ getValueString(cp.getConfigPropertyType()) + ")");
}
}
if (introspected != null && !introspected.isEmpty())
{
for (Map.Entry<String, String> entry : introspected.entrySet())
{
out.println(" Introspected Config-property: " + entry.getKey() + " (" + entry.getValue() + ")");
}
}
if (introspected == null)
out.println(" Unable to resolve introspected config-property's");
}
int line = 0;
Set<String> sameClassnameSet = new HashSet<String>();
boolean needPrint = true;
if (ra1516.getOutboundResourceadapter() != null)
{
out.println();
out.println("Managed-connection-factory:");
out.println("---------------------------");
if (ra1516.getOutboundResourceadapter().getConnectionDefinitions() != null)
connDefs = new ArrayList<CommonConnDef>();
transSupport = ra1516.getOutboundResourceadapter().getTransactionSupport();
for (ConnectionDefinition mcf : ra1516.getOutboundResourceadapter().getConnectionDefinitions())
{
classname = getValueString(mcf.getManagedConnectionFactoryClass());
if (!sameClassnameSet.contains(classname))
{
sameClassnameSet.add(classname);
if (line != 0)
{
out.println();
}
line++;
out.println("Class: " + classname);
needPrint = true;
}
else
{
needPrint = false;
}
if (needPrint)
{
//ValidatingManagedConnectionFactory
hasValidatingMcfInterface(out, classname, cl);
//CCI
String cfi = getValueString(mcf.getConnectionFactoryInterface());
try
{
out.print(" CCI: ");
Class<?> clazz = Class.forName(cfi, true, cl);
if (hasInterface(clazz, "javax.resource.cci.ConnectionFactory"))
{
out.println("Yes");
}
else
{
out.println("No");
out.println(" ConnectionFactory (" + cfi + "):");
outputMethodInfo(out, clazz, cl);
Class<?> ci = Class.forName(getValueString(mcf.getConnectionInterface()), true, cl);
out.println(" Connection (" + getValueString(mcf.getConnectionInterface()) + "):");
outputMethodInfo(out, ci, cl);
}
}
catch (Throwable t)
{
// Nothing we can do
t.printStackTrace(System.err);
out.println("Unknown");
}
}
Map<String, String> configProperty = null;
if (mcf.getConfigProperties() != null)
configProperty = new HashMap<String, String>();
introspected = getIntrospectedProperties(classname, cl);
for (ConfigProperty cp : mcf.getConfigProperties())
{
configProperty.put(getValueString(cp.getConfigPropertyName()),
getValueString(cp.getConfigPropertyValue()));
removeIntrospectedValue(introspected, getValueString(cp.getConfigPropertyName()));
if (needPrint)
out.println(" Config-property: " + getValueString(cp.getConfigPropertyName()) + " (" +
getValueString(cp.getConfigPropertyType()) + ")");
}
if (introspected != null && !introspected.isEmpty())
{
for (Map.Entry<String, String> entry : introspected.entrySet())
{
if (needPrint)
out.println(" Introspected Config-property: " + entry.getKey() + " (" +
entry.getValue() + ")");
}
}
if (introspected == null)
out.println(" Unable to resolve introspected config-property's");
String poolName = getValueString(mcf.getConnectionInterface()).substring(
getValueString(mcf.getConnectionInterface()).lastIndexOf('.') + 1);
CommonPool pool = null;
CommonConnDefImpl connImpl;
if (transSupport.equals(TransactionSupportEnum.XATransaction))
{
pool = xaPoolImpl;
Recovery recovery = new Recovery(new CredentialImpl("user", "password", null), null, false);
connImpl = new CommonConnDefImpl(configProperty, classname, "java:jboss/eis/" + poolName,
poolName, Defaults.ENABLED, Defaults.USE_JAVA_CONTEXT, Defaults.USE_CCM, pool, null, null,
secImpl, recovery);
}
else
{
pool = poolImpl;
connImpl = new CommonConnDefImpl(configProperty, classname, "java:jboss/eis/" + poolName,
poolName, Defaults.ENABLED, Defaults.USE_JAVA_CONTEXT, Defaults.USE_CCM, pool, null, null,
secImpl, null);
}
connDefs.add(connImpl);
}
}
line = 0;
sameClassnameSet.clear();
if (ra1516.getAdminObjects() != null && ra1516.getAdminObjects().size() > 0)
{
out.println();
out.println("Admin-object:");
out.println("-------------");
adminObjects = new ArrayList<CommonAdminObject>();
}
for (AdminObject ao : ra1516.getAdminObjects())
{
String aoClassname = getValueString(ao.getAdminobjectClass());
if (!sameClassnameSet.contains(aoClassname))
{
sameClassnameSet.add(aoClassname);
if (line != 0)
{
out.println();
}
line++;
out.println("Class: " + aoClassname);
out.println(" Interface: " + getValueString(ao.getAdminobjectInterface()));
needPrint = true;
}
else
{
needPrint = false;
}
String poolName = aoClassname.substring(aoClassname.lastIndexOf('.') + 1);
Map<String, String> configProperty = null;
if (ao.getConfigProperties() != null)
configProperty = new HashMap<String, String>();
introspected = getIntrospectedProperties(aoClassname, cl);
for (ConfigProperty cp : ao.getConfigProperties())
{
configProperty.put(getValueString(cp.getConfigPropertyName()),
getValueString(cp.getConfigPropertyValue()));
removeIntrospectedValue(introspected, getValueString(cp.getConfigPropertyName()));
if (needPrint)
out.println(" Config-property: " + getValueString(cp.getConfigPropertyName()) + " (" +
getValueString(cp.getConfigPropertyType()) + ")");
}
if (introspected != null && !introspected.isEmpty())
{
for (Map.Entry<String, String> entry : introspected.entrySet())
{
if (needPrint)
out.println(" Introspected Config-property: " + entry.getKey() + " (" +
entry.getValue() + ")");
}
}
if (introspected == null)
out.println(" Unable to resolve introspected config-property's");
CommonAdminObjectImpl aoImpl = new CommonAdminObjectImpl(configProperty, aoClassname,
"java:jboss/eis/ao/" + poolName, poolName, Defaults.ENABLED, Defaults.USE_JAVA_CONTEXT);
adminObjects.add(aoImpl);
}
line = 0;
sameClassnameSet.clear();
if (ra1516.getInboundResourceadapter() != null &&
ra1516.getInboundResourceadapter().getMessageadapter() != null)
{
out.println();
out.println("Activation-spec:");
out.println("----------------");
for (MessageListener ml :
ra1516.getInboundResourceadapter().getMessageadapter().getMessagelisteners())
{
String asClassname = getValueString(ml.getActivationspec().getActivationspecClass());
if (!sameClassnameSet.contains(asClassname))
{
sameClassnameSet.add(asClassname);