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

Examples of org.jboss.jca.common.api.metadata.spec.XsdString


                                     InboundResourceAdapter inboundResourceadapter,
                                     ArrayList<AdminObject> adminObjs)
      throws Exception
   {
      // Vendor name
      XsdString vendorName = null;
      if (conAnnotation != null)
         vendorName = new XsdString(conAnnotation.vendorName(), null);

      // Description
      ArrayList<LocalizedXsdString> descriptions = null;
      if (conAnnotation != null && conAnnotation.description() != null && conAnnotation.description().length != 0)
      {
         descriptions = new ArrayList<LocalizedXsdString>(conAnnotation.description().length);
         for (String descriptionAnnoptation : conAnnotation.description())
         {
            descriptions.add(new LocalizedXsdString(descriptionAnnoptation, null));
         }
      }

      // Display name
      ArrayList<LocalizedXsdString> displayNames = null;
      if (conAnnotation != null && conAnnotation.displayName() != null && conAnnotation.displayName().length != 0)
      {
         displayNames = new ArrayList<LocalizedXsdString>(conAnnotation.displayName().length);
         for (String displayNameAnnotation : conAnnotation.displayName())
         {
            displayNames.add(new LocalizedXsdString(displayNameAnnotation, null));
         }
      }

      // EIS type
      XsdString eisType = null;
      if (conAnnotation != null)
         eisType = new XsdString(conAnnotation.eisType(), null);

      // License description
      // License required
      ArrayList<LocalizedXsdString> licenseDescriptions = null;

      if (conAnnotation != null && conAnnotation.licenseDescription() != null &&
          conAnnotation.licenseDescription().length != 0)
      {
         licenseDescriptions = new ArrayList<LocalizedXsdString>(conAnnotation.licenseDescription().length);
         for (String licenseDescriptionAnnotation : conAnnotation.licenseDescription())
         {
            licenseDescriptions.add(new LocalizedXsdString(licenseDescriptionAnnotation, null));
         }
      }
      LicenseType license = null;
      if (conAnnotation != null)
         license = new LicenseTypeImpl(licenseDescriptions, conAnnotation.licenseRequired(), null, null);

      // RequiredWorkContext
      ArrayList<XsdString> requiredWorkContexts = null;
      Class<? extends WorkContext>[] requiredWorkContextAnnotations = null;

      if (conAnnotation != null)
         requiredWorkContextAnnotations = conAnnotation.requiredWorkContexts();

      if (requiredWorkContextAnnotations != null)
      {
         requiredWorkContexts = new ArrayList<XsdString>(requiredWorkContextAnnotations.length);
         for (Class<? extends WorkContext> requiredWorkContext : requiredWorkContextAnnotations)
         {

            if (!requiredWorkContexts.contains(requiredWorkContext.getName()))
            {
               if (trace)
                  log.trace("RequiredWorkContext=" + requiredWorkContext.getName());

               requiredWorkContexts.add(new XsdString(requiredWorkContext.getName(), null));
            }
         }
      }

      // Large icon
      // Small icon
      ArrayList<Icon> icons = null;
      if (conAnnotation != null && ((conAnnotation.smallIcon() != null && conAnnotation.smallIcon().length != 0) ||
                                    (conAnnotation.largeIcon() != null && conAnnotation.largeIcon().length != 0)))
      {
         icons = new ArrayList<Icon>(
                                     (conAnnotation.smallIcon() == null ? 0 : conAnnotation.smallIcon().length) +
                                        (conAnnotation.largeIcon() == null ? 0 : conAnnotation.largeIcon().length));

         if (conAnnotation.smallIcon() != null && conAnnotation.smallIcon().length > 0)
         {
            for (String smallIconAnnotation : conAnnotation.smallIcon())
            {
               if (smallIconAnnotation != null && !smallIconAnnotation.trim().equals(""))
                  icons.add(new IconImpl(new XsdString(smallIconAnnotation, null), null, null, null));
            }
         }
         if (conAnnotation.largeIcon() != null && conAnnotation.largeIcon().length > 0)
         {
            for (String largeIconAnnotation : conAnnotation.largeIcon())
            {
               if (largeIconAnnotation != null && !largeIconAnnotation.trim().equals(""))
                  icons.add(new IconImpl(null, new XsdString(largeIconAnnotation, null), null, null));
            }
         }
      }

      // Transaction support
      TransactionSupport.TransactionSupportLevel transactionSupportAnnotation = null;
      TransactionSupportEnum transactionSupport = null;

      if (conAnnotation != null)
         transactionSupportAnnotation = conAnnotation.transactionSupport();

      if (transactionSupportAnnotation != null)
         transactionSupport = TransactionSupportEnum.valueOf(transactionSupportAnnotation.name());

      // Reauthentication support
      boolean reauthenticationSupport = false;
      if (conAnnotation != null)
         reauthenticationSupport = conAnnotation.reauthenticationSupport();

      // AuthenticationMechanism
      ArrayList<AuthenticationMechanism> authenticationMechanisms = null;
      if (conAnnotation != null)
         authenticationMechanisms = processAuthenticationMechanism(conAnnotation.authMechanisms());

      OutboundResourceAdapter outboundResourceadapter = new OutboundResourceAdapterImpl(connectionDefinitions,
                                                                                        transactionSupport,
                                                                                        authenticationMechanisms,
                                                                                        reauthenticationSupport, null,
                                                                                        null, null);

      // Security permission
      ArrayList<SecurityPermission> securityPermissions = null;
      if (conAnnotation != null)
         securityPermissions = processSecurityPermissions(conAnnotation.securityPermissions());

      ArrayList<ConfigProperty> validProperties = new ArrayList<ConfigProperty>();

      if (configProperties != null)
      {
         validProperties.addAll(configProperties);
      }
      if (plainConfigProperties != null && raClass != null)
      {
         Set<String> raClasses = getClasses(raClass, classLoader);

         for (ConfigProperty configProperty : plainConfigProperties)
         {
            if (raClasses.contains(((ConfigPropertyImpl) configProperty).getAttachedClassName()))
            {
               if (trace)
                  log.tracef("Attaching: %s (%s)", configProperty, raClass);
                 
               validProperties.add(configProperty);
            }
         }
      }

      validProperties.trimToSize();

      ResourceAdapterImpl resourceAdapter = new ResourceAdapterImpl(new XsdString(raClass, null), validProperties,
                                                                    outboundResourceadapter,
                                                                    inboundResourceadapter, adminObjs,
                                                                    securityPermissions, null);

      XsdString resourceadapterVersion = null;
      if (conAnnotation != null && conAnnotation.version() != null && !conAnnotation.version().trim().equals(""))
         resourceadapterVersion = new XsdString(conAnnotation.version(), null);

      return new ConnectorImpl(Version.V_17, new XsdString("", null), vendorName, eisType, resourceadapterVersion,
                               license, resourceAdapter,
                               requiredWorkContexts, false, descriptions, displayNames, icons, null);
   }
View Full Code Here


                        desc.add(new LocalizedXsdString(d, null));
                  }
               }

               SecurityPermission spmd = new SecurityPermissionImpl(desc,
                                                                    new XsdString(securityPermission.permissionSpec(),
                                                                                  null), null);
               securityPermissions.add(spmd);
            }
            securityPermissions.trimToSize();
         }
View Full Code Here

               for (String descriptionAnnoptation : authMechanismAnnotation.description())
               {
                  descriptions.add(new LocalizedXsdString(descriptionAnnoptation, null));
               }
            }
            XsdString authenticationMechanismType = new XsdString(authMechanismAnnotation
                  .authMechanism(), null);

            authenticationMechanisms.add(new AuthenticationMechanismImpl(descriptions, authenticationMechanismType,
                                                                         CredentialInterfaceEnum
                                                                            .valueOf(authMechanismAnnotation
View Full Code Here

         }
      }

      validProperties.trimToSize();

      XsdString connectionfactoryInterface = new XsdString(cd.connectionFactory().getName(), null);
      XsdString managedconnectionfactoryClass = new XsdString(mcf, null);
      XsdString connectionImplClass = new XsdString(cd.connectionImpl().getName(), null);
      XsdString connectionfactoryImplClass = new XsdString(cd.connectionFactoryImpl().getName(), null);
      XsdString connectionInterface = new XsdString(cd.connection().getName(), null);
      return new ConnectionDefinitionImpl(managedconnectionfactoryClass, validProperties,
                                          connectionfactoryInterface,
                                          connectionfactoryImplClass, connectionInterface, connectionImplClass, null);
   }
View Full Code Here

                  .getAnnotation();

            if (trace)
               log.trace("Processing: " + configPropertyAnnotation);

            XsdString configPropertyValue = XsdString.NULL_XSDSTRING;
            if (configPropertyAnnotation.defaultValue() != null && !configPropertyAnnotation.defaultValue().equals(""))
               configPropertyValue = new XsdString(configPropertyAnnotation.defaultValue(), null);

            XsdString configPropertyName = new XsdString(getConfigPropertyName(annotation), null);

            XsdString configPropertyType =
               new XsdString(getConfigPropertyType(annotation, configPropertyAnnotation.type(), classLoader), null);

            Boolean configPropertySupportsDynamicUpdates = configPropertyAnnotation.supportsDynamicUpdates();
            Boolean configPropertyConfidential = configPropertyAnnotation.confidential();
            // Description
            ArrayList<LocalizedXsdString> descriptions = null;
View Full Code Here

               }
            }

            validProperties.trimToSize();

            XsdString adminobjectInterface = new XsdString(aoName, null);
            XsdString adminobjectClass = new XsdString(aoClassName, null);

            adminObjs.add(new AdminObjectImpl(adminobjectInterface, adminobjectClass, validProperties, null));
         }
      }
View Full Code Here

      if (activation.messageListeners() != null)
      {
         messageListeners = new ArrayList<MessageListener>(activation.messageListeners().length);
         for (Class asClass : activation.messageListeners())
         {
            Activationspec asMeta = new ActivationSpecImpl(new XsdString(annotation.getClassName(), null),
                                                           requiredConfigProperties,
                                                           validProperties,
                                                           null);
            MessageListener mlMeta = new MessageListenerImpl(new XsdString(asClass.getName(), null), asMeta, null);
            messageListeners.add(mlMeta);

         }
      }
      return messageListeners;
View Full Code Here

        AuthenticationMechanism basicPassword = new AuthenticationMechanismImpl(Collections.<LocalizedXsdString>emptyList(), str(BASIC_PASS), CredentialInterfaceEnum.PasswordCredential, null, null);
        return new OutboundResourceAdapterImpl(definitions, TransactionSupportEnum.XATransaction, Collections.singletonList(basicPassword), false, null, null, null);
    }

    private static XsdString str(String str) {
        return new XsdString(str, null);
    }
View Full Code Here

                                     InboundResourceAdapter inboundResourceadapter,
                                     ArrayList<AdminObject> adminObjs)
      throws Exception
   {
      // Vendor name
      XsdString vendorName = null;
      if (conAnnotation != null)
         vendorName = new XsdString(conAnnotation.vendorName(), null);

      // Description
      ArrayList<LocalizedXsdString> descriptions = null;
      if (conAnnotation != null && conAnnotation.description() != null && conAnnotation.description().length != 0)
      {
         descriptions = new ArrayList<LocalizedXsdString>(conAnnotation.description().length);
         for (String descriptionAnnoptation : conAnnotation.description())
         {
            descriptions.add(new LocalizedXsdString(descriptionAnnoptation, null));
         }
      }

      // Display name
      ArrayList<LocalizedXsdString> displayNames = null;
      if (conAnnotation != null && conAnnotation.displayName() != null && conAnnotation.displayName().length != 0)
      {
         displayNames = new ArrayList<LocalizedXsdString>(conAnnotation.displayName().length);
         for (String displayNameAnnotation : conAnnotation.displayName())
         {
            displayNames.add(new LocalizedXsdString(displayNameAnnotation, null));
         }
      }

      // EIS type
      XsdString eisType = null;
      if (conAnnotation != null)
         eisType = new XsdString(conAnnotation.eisType(), null);

      // License description
      // License required
      ArrayList<LocalizedXsdString> licenseDescriptions = null;

      if (conAnnotation != null && conAnnotation.licenseDescription() != null &&
          conAnnotation.licenseDescription().length != 0)
      {
         licenseDescriptions = new ArrayList<LocalizedXsdString>(conAnnotation.licenseDescription().length);
         for (String licenseDescriptionAnnotation : conAnnotation.licenseDescription())
         {
            licenseDescriptions.add(new LocalizedXsdString(licenseDescriptionAnnotation, null));
         }
      }
      LicenseType license = null;
      if (conAnnotation != null)
         license = new LicenseTypeImpl(licenseDescriptions, conAnnotation.licenseRequired(), null, null);

      // RequiredWorkContext
      ArrayList<XsdString> requiredWorkContexts = null;
      Class<? extends WorkContext>[] requiredWorkContextAnnotations = null;

      if (conAnnotation != null)
         requiredWorkContextAnnotations = conAnnotation.requiredWorkContexts();

      if (requiredWorkContextAnnotations != null)
      {
         requiredWorkContexts = new ArrayList<XsdString>(requiredWorkContextAnnotations.length);
         for (Class<? extends WorkContext> requiredWorkContext : requiredWorkContextAnnotations)
         {
            XsdString xs = new XsdString(requiredWorkContext.getName(), null);
            if (!requiredWorkContexts.contains(xs))
            {
               if (trace)
                  log.trace("RequiredWorkContext=" + requiredWorkContext.getName());

               requiredWorkContexts.add(xs);
            }
         }
      }

      // Large icon
      // Small icon
      ArrayList<Icon> icons = null;
      if (conAnnotation != null && ((conAnnotation.smallIcon() != null && conAnnotation.smallIcon().length != 0) ||
                                    (conAnnotation.largeIcon() != null && conAnnotation.largeIcon().length != 0)))
      {
         icons = new ArrayList<Icon>(
                                     (conAnnotation.smallIcon() == null ? 0 : conAnnotation.smallIcon().length) +
                                        (conAnnotation.largeIcon() == null ? 0 : conAnnotation.largeIcon().length));

         if (conAnnotation.smallIcon() != null && conAnnotation.smallIcon().length > 0)
         {
            for (String smallIconAnnotation : conAnnotation.smallIcon())
            {
               if (smallIconAnnotation != null && !smallIconAnnotation.trim().equals(""))
                  icons.add(new IconImpl(new XsdString(smallIconAnnotation, null), null, null, null));
            }
         }
         if (conAnnotation.largeIcon() != null && conAnnotation.largeIcon().length > 0)
         {
            for (String largeIconAnnotation : conAnnotation.largeIcon())
            {
               if (largeIconAnnotation != null && !largeIconAnnotation.trim().equals(""))
                  icons.add(new IconImpl(null, new XsdString(largeIconAnnotation, null), null, null));
            }
         }
      }

      // Transaction support
      TransactionSupport.TransactionSupportLevel transactionSupportAnnotation = null;
      TransactionSupportEnum transactionSupport = null;

      if (conAnnotation != null)
         transactionSupportAnnotation = conAnnotation.transactionSupport();

      if (transactionSupportAnnotation != null)
         transactionSupport = TransactionSupportEnum.valueOf(transactionSupportAnnotation.name());

      // Reauthentication support
      boolean reauthenticationSupport = false;
      if (conAnnotation != null)
         reauthenticationSupport = conAnnotation.reauthenticationSupport();

      // AuthenticationMechanism
      ArrayList<AuthenticationMechanism> authenticationMechanisms = null;
      if (conAnnotation != null)
         authenticationMechanisms = processAuthenticationMechanism(conAnnotation.authMechanisms());

      OutboundResourceAdapter outboundResourceadapter = new OutboundResourceAdapterImpl(connectionDefinitions,
                                                                                        transactionSupport,
                                                                                        authenticationMechanisms,
                                                                                        reauthenticationSupport, null,
                                                                                        null, null);

      // Security permission
      ArrayList<SecurityPermission> securityPermissions = null;
      if (conAnnotation != null)
         securityPermissions = processSecurityPermissions(conAnnotation.securityPermissions());

      ArrayList<ConfigProperty> validProperties = new ArrayList<ConfigProperty>();

      if (configProperties != null)
      {
         validProperties.addAll(configProperties);
      }
      if (plainConfigProperties != null && raClass != null)
      {
         Set<String> raClasses = getClasses(raClass, classLoader);

         for (ConfigProperty configProperty : plainConfigProperties)
         {
            if (raClasses.contains(((ConfigPropertyImpl) configProperty).getAttachedClassName()))
            {
               if (trace)
                  log.tracef("Attaching: %s (%s)", configProperty, raClass);
                 
               validProperties.add(configProperty);
            }
         }
      }

      validProperties.trimToSize();

      ResourceAdapterImpl resourceAdapter = new ResourceAdapterImpl(new XsdString(raClass, null), validProperties,
                                                                    outboundResourceadapter,
                                                                    inboundResourceadapter, adminObjs,
                                                                    securityPermissions, null);

      XsdString resourceadapterVersion = null;
      if (conAnnotation != null && conAnnotation.version() != null && !conAnnotation.version().trim().equals(""))
         resourceadapterVersion = new XsdString(conAnnotation.version(), null);

      return new ConnectorImpl(Version.V_17, new XsdString("", null), vendorName, eisType, resourceadapterVersion,
                               license, resourceAdapter,
                               requiredWorkContexts, false, descriptions, displayNames, icons, null);
   }
View Full Code Here

                        desc.add(new LocalizedXsdString(d, null));
                  }
               }

               SecurityPermission spmd = new SecurityPermissionImpl(desc,
                                                                    new XsdString(securityPermission.permissionSpec(),
                                                                                  null), null);
               securityPermissions.add(spmd);
            }
            securityPermissions.trimToSize();
         }
View Full Code Here

TOP

Related Classes of org.jboss.jca.common.api.metadata.spec.XsdString

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.