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

Examples of org.jboss.jca.common.api.metadata.common.TransactionSupportEnum


            OutboundResourceAdapter outbound = createOutbound();
            InboundResourceAdapter inbound = createInbound();
            ResourceAdapter ra = createResourceAdapter15(properties, outbound, inbound);
            Connector cmd = createConnector15(ra);

            TransactionSupportEnum transactionSupport = getTransactionSupport(txSupport);
            ConnectionDefinition common = createConnDef(transactionSupport, bindInfo.getBindName(), minPoolSize, maxPoolSize);
            Activation activation = createActivation(common, transactionSupport);

            ResourceAdapterActivatorService activator = new ResourceAdapterActivatorService(cmd, activation,
                    PooledConnectionFactoryService.class.getClassLoader(), name);
View Full Code Here


            } else {
                pool = new PoolImpl(minPoolSize < 0 ? Defaults.MIN_POOL_SIZE : minPoolSize, Defaults.INITIAL_POOL_SIZE, maxPoolSize < 0 ? Defaults.MAX_POOL_SIZE : maxPoolSize,
                        Defaults.PREFILL, Defaults.USE_STRICT_MIN, Defaults.FLUSH_STRATEGY, null);
            }

            TransactionSupportEnum transactionSupportValue = TransactionSupportEnum.NoTransaction;
            if (transactionSupport == TransactionSupport.TransactionSupportLevel.XATransaction) {
                transactionSupportValue = TransactionSupportEnum.XATransaction;
            } else if (transactionSupport == TransactionSupport.TransactionSupportLevel.LocalTransaction) {
                transactionSupportValue = TransactionSupportEnum.LocalTransaction;
            }
View Full Code Here

            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);
                     if (line != 0)
                     {
                        out.println();
                     }
                     line++;
                     out.println("Class: " + asClassname);
                     out.println("  Message-listener: " + getValueString(ml.getMessagelistenerType()));

                     introspected = getIntrospectedProperties(asClassname, cl);

                     if (ml.getActivationspec() != null &&
                         ml.getActivationspec().getRequiredConfigProperties() != null)
                     {
                        for (RequiredConfigProperty cp :  ml.getActivationspec().getRequiredConfigProperties())
                        {
                           removeIntrospectedValue(introspected, getValueString(cp.getConfigPropertyName()));
                          
                           out.println("  Required-config-property: " + getValueString(cp.getConfigPropertyName()));
                        }
                     }

                     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");
                  }
               }
            }
         }
         else
         {
            out.println("Managed-connection-factory:");
            out.println("---------------------------");

            ResourceAdapter10 ra10 = (ResourceAdapter10)ra;
            out.println("Class: " + ra10.getManagedConnectionFactoryClass());
           
            classname = getValueString(ra10.getManagedConnectionFactoryClass());
            transSupport = ra10.getTransactionSupport();
           
            //ValidatingManagedConnectionFactory
            hasValidatingMcfInterface(out, classname, cl);
           
            Class<?> cfi = Class.forName(classname, true, cl);
            out.println("  ConnectionFactory (" + classname + "):");
            outputMethodInfo(out, cfi, cl);
           
            Class<?> ci = Class.forName(getValueString(ra10.getConnectionInterface()), true, cl);
            out.println("  Connection (" + getValueString(ra10.getConnectionInterface()) + "):");
            outputMethodInfo(out, ci, cl);
           
            Map<String, String> configProperty = null;
            if (ra10.getConfigProperties() != null)
               configProperty = new HashMap<String, String>();

            Map<String, String> introspected =
               getIntrospectedProperties(classname, cl);

            for (ConfigProperty cp : ra10.getConfigProperties())
            {
               configProperty.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");

            String poolName = classname.substring(classname.lastIndexOf('.') + 1);
            CommonPool pool = null;
            if (transSupport.equals(TransactionSupportEnum.XATransaction))
            {
               pool = xaPoolImpl;
            }
            else
            {
View Full Code Here

//            for (ModelNode property : operation.get(CONFIG_PROPERTIES.getName()).asList()) {
//                configProperties.put(property.asProperty().getName(), property.asProperty().getValue().asString());
//            }
//        }
        String archive = getResolvedStringIfSetOrGetDefault(context, operation, ARCHIVE.getName(), null);
        TransactionSupportEnum transactionSupport = operation.hasDefined(TRANSACTIONSUPPORT.getName()) ? TransactionSupportEnum
                .valueOf(operation.get(TRANSACTIONSUPPORT.getName()).asString()) : null;
        String bootstrapContext = getResolvedStringIfSetOrGetDefault(context, operation, BOOTSTRAPCONTEXT.getName(), null);
        List<String> beanValidationGroups = null;
        if (operation.hasDefined(BEANVALIDATIONGROUPS.getName())) {
            beanValidationGroups = new ArrayList<String>(operation.get(BEANVALIDATIONGROUPS.getName()).asList().size());
View Full Code Here

                streamWriter.writeEndElement();
            }

            TRANSACTIONSUPPORT.marshallAsElement(ra, streamWriter);
            writeNewConfigProperties(streamWriter, ra);
            TransactionSupportEnum transactionSupport = ra.hasDefined(TRANSACTIONSUPPORT.getName()) ? TransactionSupportEnum
                .valueOf(ra.get(TRANSACTIONSUPPORT.getName()).asString()) : null;
            boolean isXa = false;
            if (transactionSupport == TransactionSupportEnum.XATransaction) {
                isXa = true;
            }
View Full Code Here

                isIj.close();
        }
    }

    private static IronJacamarImpl createIron(CommonConnDef common, String txSupport) {
        TransactionSupportEnum transactionSupport;

        try {
            transactionSupport = TransactionSupportEnum.valueOf(txSupport);
        } catch (RuntimeException e) {
            transactionSupport = TransactionSupportEnum.LocalTransaction;
View Full Code Here

      XsdString eisType = null;
      LicenseType license = null;
      List<LocalizedXsdString> displayNames = null;
      List<Icon> icons = null;
      List<AdminObject> adminobjects = null;
      TransactionSupportEnum transactionSupport = null;

      if (connector.getVersion() == Version.V_10)
      {
         if (raConfigProperties != null)
         {
View Full Code Here

            }
            if (isNew)
               newConnDef.add(rcd);
         }

         TransactionSupportEnum newTransactionSupport = this.transactionSupport == null
            ? input.transactionSupport
            : this.transactionSupport;

         boolean newReauthenticationSupport = this.reauthenticationSupport || input.reauthenticationSupport;
         List<AuthenticationMechanism> newAuthenticationMechanism = MergeUtil.mergeList(this.authenticationMechanism,
View Full Code Here

         List<AuthenticationMechanism> newauthenticationMechanism = MergeUtil.mergeList(this.authenticationMechanism,
            inputMD.authenticationMechanism);
         Boolean newreauthenticationSupport = this.reauthenticationSupport == null
            ? inputMD.reauthenticationSupport
            : this.reauthenticationSupport;
         TransactionSupportEnum newtransactionSupport = this.transactionSupport == null
            ? inputMD.transactionSupport
            : this.transactionSupport;
         XsdString newconnectionImplClass = XsdString.isNull(this.connectionImplClass)
            ? inputMD.connectionImplClass
            : this.connectionImplClass;
View Full Code Here

      XsdString managedConnectionFactoryClass = NULL_XSDSTRING;
      XsdString connectionFactoryInterface = NULL_XSDSTRING;
      XsdString connectionFactoryImplClass = NULL_XSDSTRING;
      XsdString connectionInterface = NULL_XSDSTRING;
      XsdString connectionImplClass = NULL_XSDSTRING;
      TransactionSupportEnum transactionSupport = null;
      ArrayList<AuthenticationMechanism> authenticationMechanism = new ArrayList<AuthenticationMechanism>();
      ArrayList<ConfigProperty> configProperties = new ArrayList<ConfigProperty>();
      Boolean reauthenticationSupport = null;
      ArrayList<SecurityPermission> securityPermission = new ArrayList<SecurityPermission>();
      String id = reader.getAttributeValue(null, ResourceAdapter1516.Attribute.ID.getLocalName());
View Full Code Here

TOP

Related Classes of org.jboss.jca.common.api.metadata.common.TransactionSupportEnum

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.