Package org.jboss.jca.common.api.metadata.ra

Examples of org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516


         {
            Connector c = mdr.getResourceAdapter(mdrId);
           
            if (c.getResourceadapter() != null && c.getResourceadapter() instanceof ResourceAdapter1516)
            {
               ResourceAdapter1516 ra1516 = (ResourceAdapter1516)c.getResourceadapter();
               String clz = ra1516.getResourceadapterClass();

               if (rar.getClass().getName().equals(clz))
                  md = c;
            }
         }
         catch (Throwable t)
         {
            throw new NotFoundException(bundle.unableLookupResourceAdapterInMDR(uniqueId), t);
         }
      }

      if (md == null)
         throw new NotFoundException(bundle.unableLookupResourceAdapterInMDR(uniqueId));

      if (md.getResourceadapter() != null && md.getResourceadapter() instanceof ResourceAdapter1516)
      {
         ResourceAdapter1516 ra1516 = (ResourceAdapter1516)md.getResourceadapter();

         if (ra1516.getInboundResourceadapter() != null &&
             ra1516.getInboundResourceadapter().getMessageadapter() != null &&
             ra1516.getInboundResourceadapter().getMessageadapter().getMessagelisteners() != null &&
             ra1516.getInboundResourceadapter().getMessageadapter().getMessagelisteners().size() > 0)
         {
            List<org.jboss.jca.common.api.metadata.ra.MessageListener> listeners =
               ra1516.getInboundResourceadapter().getMessageadapter().getMessagelisteners();

            List<org.jboss.jca.core.spi.rar.MessageListener> result =
               new ArrayList<org.jboss.jca.core.spi.rar.MessageListener>(listeners.size());

            for (org.jboss.jca.common.api.metadata.ra.MessageListener ml : listeners)
View Full Code Here


            Connector raXml = mdr.getResourceAdapter(id);
            if (raXml != null && raXml instanceof Connector15)
            {
               if (raXml.getResourceadapter() != null)
               {
                  ResourceAdapter1516 ra1516 = (ResourceAdapter1516)raXml.getResourceadapter();
                  if (ra1516.getResourceadapterClass() != null && !ra1516.getResourceadapterClass().equals(""))
                  {
                     if (ra.getClass().getName().equals(ra1516.getResourceadapterClass()))
                        return id;
                  }
               }
            }
         }
View Full Code Here

               version = "1.5";
            else if (connector.getVersion() == Version.V_16)
               version = "1.6";
            else
               version = "1.7";
            ResourceAdapter1516 ra1516 = (ResourceAdapter1516)connector.getResourceadapter();
            ra = ra1516;
            if (ra1516.getOutboundResourceadapter() != null)
            {
               reauth = ra1516.getOutboundResourceadapter().getReauthenticationSupport();
               if (ra1516.getInboundResourceadapter() != null &&
                   ra1516.getInboundResourceadapter().getMessageadapter() != null &&
                   ra1516.getInboundResourceadapter().getMessageadapter().getMessagelisteners() != null &&
                   ra1516.getInboundResourceadapter().getMessageadapter().getMessagelisteners().size() > 0)
                  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 mcfClassName = "";
         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())
               {
                  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);
                  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, mcfClassName, "java:jboss/eis/" + poolName,
                        poolName, Defaults.ENABLED, Defaults.USE_JAVA_CONTEXT, Defaults.USE_CCM, pool, null, null,
                        secImpl, recovery, Boolean.TRUE);
                  }
                  else
                  {
                     pool = poolImpl;
                     connImpl = new CommonConnDefImpl(configProperty, mcfClassName, "java:jboss/eis/" + poolName,
                        poolName, Defaults.ENABLED, Defaults.USE_JAVA_CONTEXT, Defaults.USE_CCM, pool, null, null,
                        secImpl, null, Boolean.FALSE);
                  }

                  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 &&
                ra1516.getInboundResourceadapter().getMessageadapter().getMessagelisteners() != null &&
                ra1516.getInboundResourceadapter().getMessageadapter().getMessagelisteners().size() > 0)
            {
               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);
View Full Code Here

                if (cmd.getVersion() == Version.V_10) {
                    ResourceAdapter10 ra10 = (ResourceAdapter10) cmd.getResourceadapter();
                    raMcfClasses.add(ra10.getManagedConnectionFactoryClass().getValue());
                } else {
                    ResourceAdapter1516 ra = (ResourceAdapter1516) cmd.getResourceadapter();
                    if (ra != null && ra.getOutboundResourceadapter() != null &&
                        ra.getOutboundResourceadapter().getConnectionDefinitions() != null) {
                        List<ConnectionDefinition> cdMetas = ra.getOutboundResourceadapter().getConnectionDefinitions();
                        if (cdMetas.size() > 0) {
                            for (ConnectionDefinition cdMeta : cdMetas) {
                                raMcfClasses.add(cdMeta.getManagedConnectionFactoryClass().getValue());
                            }
                        }
                    }

                    if (ra != null && ra.getAdminObjects() != null) {
                        List<AdminObject> aoMetas = ra.getAdminObjects();
                        if (aoMetas.size() > 0) {
                            for (AdminObject aoMeta : aoMetas) {
                                raAoClasses.add(aoMeta.getAdminobjectClass().getValue());
                            }
                        }
View Full Code Here

         }
         else
         {
            if (conn.getResourceadapter() != null)
            {
               ResourceAdapter1516 ra1516 = (ResourceAdapter1516) conn.getResourceadapter();
               if (ra1516.getOutboundResourceadapter() != null)
               {
                  ((OutboundResourceAdapterImpl) ra1516.getOutboundResourceadapter()).forceNewTrasactionSupport(ij
                     .getTransactionSupport());
               }
            }
         }
      }
View Full Code Here

                                                                                           authenticationMechanism,
                                                                                           reauthenticationSupport,
                                                                                           id);
         String resourceadapterClass = null;
         InboundResourceAdapter inboundResourceadapter = null;
         ResourceAdapter1516 resourceadapter = new ResourceAdapter1516Impl(resourceadapterClass, raConfigProperties,
                                                                           outboundResourceadapter,
                                                                           inboundResourceadapter, adminobjects,
                                                                           securityPermissions, id);

         if (connector.getVersion() == Version.V_16)
View Full Code Here

      else
      {

         if (connector.getResourceadapter() != null && connector.getResourceadapter() instanceof ResourceAdapter1516)
         {
            ResourceAdapter1516 ra1516 = ((ResourceAdapter1516) connector.getResourceadapter());
            if (ra1516.getOutboundResourceadapter() != null &&
                ra1516.getOutboundResourceadapter().getConnectionDefinitions() != null)
            {
               originalProperties = ra1516.getOutboundResourceadapter().getConnectionDefinitions().get(0)
                  .getConfigProperties();
            }
         }
      }
      return originalProperties;
View Full Code Here

         {
            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);
View Full Code Here

            properties.add(simpleProperty("TransactionManagerLocatorClass", STRING_TYPE, TransactionManagerLocator.class.getName()));
            properties.add(simpleProperty("TransactionManagerLocatorMethod", STRING_TYPE, "getTransactionManager"));

            OutboundResourceAdapter outbound = createOutbound();
            InboundResourceAdapter inbound = createInbound();
            ResourceAdapter1516 ra = createResourceAdapter(properties, outbound, inbound);
            Connector16 cmd = createConnector(ra);

            CommonConnDef common = createConnDef(jndiName);
            IronJacamar ijmd = createIron(common, txSupport);
View Full Code Here

         {
            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;
            if (ra1516.getResourceadapterClass() != null && !ra1516.getResourceadapterClass().equals(""))
            {
               out.println();
               out.println("Resource-adapter:");
               out.println("-----------------");
               out.println("Class: " + ra1516.getResourceadapterClass());
            }
           
            Map<String, String> introspected =
               getIntrospectedProperties(ra1516.getResourceadapterClass(), cl);

            if (ra1516.getConfigProperties() != null)
            {
               raConfigProperties = new HashMap<String, String>();
               for (ConfigProperty cp : ra1516.getConfigProperties())
               {
                  raConfigProperties.put(cp.getConfigPropertyName().toString(),
                                         getValueString(cp.getConfigPropertyValue()));
                 
                  removeIntrospectedValue(introspected, cp.getConfigPropertyName().toString());

                  out.println("  Config-property: " + cp.getConfigPropertyName() + " (" +
                              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 = mcf.getManagedConnectionFactoryClass().toString();
                  if (!sameClassnameSet.contains(classname))
                  {
                     sameClassnameSet.add(classname);
                     if (line != 0)
                     {
                        out.println();
                     }
                     line++;
                     out.println("Class: " + classname);
                     needPrint = true;
                  }
                  else
                  {
                     needPrint = false;
                  }
                 
                  //ValidatingManagedConnectionFactory
                  if (needPrint)
                  {
                     try
                     {
                        out.print("  Validating: ");
                        Class<?> clazz = Class.forName(classname, true, cl);

                        if (hasInterface(clazz, "javax.resource.spi.ValidatingManagedConnectionFactory"))
                        {
                           out.println("Yes");
                        }
                        else
                        {
                           out.println("No");
                        }
                     }
                     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(cp.getConfigPropertyName().toString(),
                                        getValueString(cp.getConfigPropertyValue()));

                     removeIntrospectedValue(introspected, cp.getConfigPropertyName().toString());
                    
                     if (needPrint)
                        out.println("  Config-property: " + cp.getConfigPropertyName() + " (" +
                                    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 = mcf.getConnectionInterface().toString().substring(
                        mcf.getConnectionInterface().toString().lastIndexOf('.') + 1);
                  CommonPool pool = null;
                  if (transSupport.equals(TransactionSupportEnum.XATransaction))
                  {
                     pool = xaPoolImpl;
                  }
                  else
                  {
                     pool = poolImpl;
                  }
                  CommonConnDefImpl 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 = ao.getAdminobjectClass().toString();
               if (!sameClassnameSet.contains(aoClassname))
               {
                  sameClassnameSet.add(aoClassname);
                  if (line != 0)
                  {
                     out.println();
                  }
                  line++;
                  out.println("Class: " + aoClassname);
                  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(cp.getConfigPropertyName().toString(),
                                     getValueString(cp.getConfigPropertyValue()));
                    
                  removeIntrospectedValue(introspected, cp.getConfigPropertyName().toString());
                 
                  if (needPrint)
                     out.println("  Config-property: " + cp.getConfigPropertyName() + " (" +
                                 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 = ml.getActivationspec().getActivationspecClass().toString();
                  if (!sameClassnameSet.contains(asClassname))
                  {
                     sameClassnameSet.add(asClassname);
View Full Code Here

TOP

Related Classes of org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.