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

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


         {
            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(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;
                  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 = 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 (conn.getVersion() != Version.V_10)
      {
         //merge adminObjects;

         ResourceAdapter1516 ra1516 = (ResourceAdapter1516) conn.getResourceadapter();
         if (ra1516 != null && ra1516.getAdminObjects() != null)
         {
            List<AdminObject> newAdminObjects = new ArrayList<AdminObject>(ra1516.getAdminObjects().size());
            for (AdminObject adminObj : ra1516.getAdminObjects())
            {


               AdminObject newAdminObj = adminObj;

               newAdminObjects.add(newAdminObj);

            }
            ((ResourceAdapter1516Impl) ra1516).forceAdminObjectsContent(newAdminObjects);
         }
         //merge connectionDefinitions;
         if (ra1516 != null && ra1516.getOutboundResourceadapter() != null &&
             ra1516.getOutboundResourceadapter().getConnectionDefinitions() != null)
         {
            List<ConnectionDefinition> newConDefs = new ArrayList<ConnectionDefinition>(ra1516
               .getOutboundResourceadapter().getConnectionDefinitions().size());
            for (ConnectionDefinition conDef : ra1516.getOutboundResourceadapter().getConnectionDefinitions())
            {

               ConnectionDefinition newConDef = conDef;

               newConDefs.add(newConDef);

            }
            ((OutboundResourceAdapterImpl) ra1516.getOutboundResourceadapter())
               .forceConnectionDefinitionsContent(newConDefs);
         }

      }
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

   private Connector parseConnector15(XMLStreamReader reader) throws XMLStreamException, ParserException
   {
      LicenseType license = null;
      String id = reader.getAttributeValue(null, Connector15.Attribute.ID.getLocalName());;
      XsdString eisType = NULL_XSDSTRING;
      ResourceAdapter1516 resourceadapter = null;
      XsdString vendorName = NULL_XSDSTRING;
      XsdString resourceadapterVersion = NULL_XSDSTRING;
      ArrayList<Icon> icon = new ArrayList<Icon>();
      ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
      ArrayList<LocalizedXsdString> displayName = new ArrayList<LocalizedXsdString>();
View Full Code Here

      String id = reader.getAttributeValue(null, Connector16.Attribute.ID.getLocalName());;
      ArrayList<Icon> icon = new ArrayList<Icon>();
      ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
      ArrayList<LocalizedXsdString> displayName = new ArrayList<LocalizedXsdString>();
      XsdString eisType = NULL_XSDSTRING;
      ResourceAdapter1516 resourceadapter = null;
      XsdString vendorName = NULL_XSDSTRING;
      XsdString moduleName = null;
      ArrayList<XsdString> requiredWorkContext = new ArrayList<XsdString>();
      XsdString resourceadapterVersion = NULL_XSDSTRING;
      while (reader.hasNext())
View Full Code Here

      String id = reader.getAttributeValue(null, Connector17.Attribute.ID.getLocalName());;
      ArrayList<Icon> icon = new ArrayList<Icon>();
      ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
      ArrayList<LocalizedXsdString> displayName = new ArrayList<LocalizedXsdString>();
      XsdString eisType = NULL_XSDSTRING;
      ResourceAdapter1516 resourceadapter = null;
      XsdString vendorName = NULL_XSDSTRING;
      XsdString moduleName = null;
      ArrayList<XsdString> requiredWorkContext = new ArrayList<XsdString>();
      XsdString resourceadapterVersion = NULL_XSDSTRING;
      while (reader.hasNext())
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

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.