out.println("Archive:\t" + archiveFile);
String version;
String type = "";
ResourceAdapter ra = connector.getResourceadapter();
boolean reauth = false;
if (connector.getVersion() == Version.V_10)
{
version = "1.0";
type = "OutBound";
reauth = ra.getOutboundResourceadapter().getReauthenticationSupport();
}
else
{
if (connector.getVersion() == Version.V_15)
version = "1.5";
else if (connector.getVersion() == Version.V_16)
version = "1.6";
else
version = "1.7";
if (ra.getOutboundResourceadapter() != null)
{
reauth = ra.getOutboundResourceadapter().getReauthenticationSupport();
if (ra.getInboundResourceadapter() != null &&
ra.getInboundResourceadapter().getMessageadapter() != null &&
ra.getInboundResourceadapter().getMessageadapter().getMessagelisteners() != null &&
ra.getInboundResourceadapter().getMessageadapter().getMessagelisteners().size() > 0)
type = "Bidirectional";
else
type = "OutBound";
}
else
{
if (ra.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 mcfClassName = "";
Map<String, String> raConfigProperties = null;
TransactionSupportEnum transSupport = TransactionSupportEnum.NoTransaction;
List<AdminObject> adminObjects = null;
List<ConnectionDefinition> connDefs = null;
SecurityImpl secImpl = new SecurityImpl("", "", true);
PoolImpl poolImpl = new PoolImpl(0, null, 10, Defaults.PREFILL, Defaults.USE_STRICT_MIN,
Defaults.FLUSH_STRATEGY, null);
XaPoolImpl xaPoolImpl = new XaPoolImpl(0, null, 10, Defaults.PREFILL, Defaults.USE_STRICT_MIN,
Defaults.FLUSH_STRATEGY, null, Defaults.IS_SAME_RM_OVERRIDE,
Defaults.INTERLEAVING,
Defaults.PAD_XID, Defaults.WRAP_XA_RESOURCE,
Defaults.NO_TX_SEPARATE_POOL);
Map<String, String> introspected;
if (ra.getResourceadapterClass() != null && !ra.getResourceadapterClass().equals(""))
{
out.println();
out.println("Resource-adapter:");
out.println("-----------------");
out.println("Class: " + ra.getResourceadapterClass());
introspected = getIntrospectedProperties(ra.getResourceadapterClass(), cl);
if (ra.getConfigProperties() != null)
{
raConfigProperties = new HashMap<String, String>();
for (ConfigProperty cp : ra.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 (ra.getOutboundResourceadapter() != null)
{
out.println();
out.println("Managed-connection-factory:");
out.println("---------------------------");
if (ra.getOutboundResourceadapter().getConnectionDefinitions() != null)
connDefs = new ArrayList<ConnectionDefinition>();
transSupport = ra.getOutboundResourceadapter().getTransactionSupport();
for (org.jboss.jca.common.api.metadata.spec.ConnectionDefinition mcf :
ra.getOutboundResourceadapter().getConnectionDefinitions())
{
mcfClassName = getValueString(mcf.getManagedConnectionFactoryClass());
if (!sameClassnameSet.contains(mcfClassName))
{
sameClassnameSet.add(mcfClassName);
if (line != 0)
{
out.println();
}
line++;
out.println("Class: " + mcfClassName);
needPrint = true;
}
else
{
needPrint = false;
}
if (needPrint)
{
//ValidatingManagedConnectionFactory
hasValidatingMcfInterface(out, mcfClassName, cl);
//DissociatableManagedConnection
hasDissociatableMcInterface(out, mcfClassName, cl, mcf.getConfigProperties());
//LazyEnlistableManagedConnection
hasEnlistableMcInterface(out, mcfClassName, cl, mcf.getConfigProperties());
//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(mcfClassName, 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);
Pool pool = null;
ConnectionDefinitionImpl connImpl;
if (transSupport.equals(TransactionSupportEnum.XATransaction))
{
pool = xaPoolImpl;
Recovery recovery = new Recovery(new CredentialImpl("user", "password", null), null, false);
connImpl = new ConnectionDefinitionImpl(configProperty, mcfClassName, "java:jboss/eis/" + poolName,
poolName, Defaults.ENABLED, Defaults.USE_JAVA_CONTEXT,
Defaults.USE_CCM, Defaults.SHARABLE, Defaults.ENLISTMENT,
Defaults.CONNECTABLE, Defaults.TRACKING, pool, null, null,
secImpl, recovery, Boolean.TRUE);
}
else
{
pool = poolImpl;
connImpl = new ConnectionDefinitionImpl(configProperty, mcfClassName, "java:jboss/eis/" + poolName,
poolName, Defaults.ENABLED, Defaults.USE_JAVA_CONTEXT,
Defaults.USE_CCM, Defaults.SHARABLE, Defaults.ENLISTMENT,
Defaults.CONNECTABLE, Defaults.TRACKING, pool, null, null,
secImpl, null, Boolean.FALSE);
}
connDefs.add(connImpl);
}
}
line = 0;
sameClassnameSet.clear();
if (ra.getAdminObjects() != null && ra.getAdminObjects().size() > 0)
{
out.println();
out.println("Admin-object:");
out.println("-------------");
adminObjects = new ArrayList<AdminObject>();
for (org.jboss.jca.common.api.metadata.spec.AdminObject ao : ra.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");
AdminObjectImpl aoImpl = new AdminObjectImpl(configProperty, aoClassname,
"java:jboss/eis/ao/" + poolName, poolName, Defaults.ENABLED, Defaults.USE_JAVA_CONTEXT);
adminObjects.add(aoImpl);
}
}
line = 0;
sameClassnameSet.clear();
if (ra.getInboundResourceadapter() != null &&
ra.getInboundResourceadapter().getMessageadapter() != null &&
ra.getInboundResourceadapter().getMessageadapter().getMessagelisteners() != null &&
ra.getInboundResourceadapter().getMessageadapter().getMessagelisteners().size() > 0)
{
out.println();
out.println("Activation-spec:");
out.println("----------------");
for (MessageListener ml :
ra.getInboundResourceadapter().getMessageadapter().getMessagelisteners())
{
String asClassname = getValueString(ml.getActivationspec().getActivationspecClass());
if (!sameClassnameSet.contains(asClassname))
{
sameClassnameSet.add(asClassname);