Package org.jboss.jca.common.api.validator

Examples of org.jboss.jca.common.api.validator.ValidateException


   @Override
   public void validate() throws ValidateException
   {
      if (this.className == null || className.trim().length() == 0)
         throw new ValidateException("className (xml attribute " + Attribute.CLASS_NAME + ") is required in " +
                                     this.getClass().getCanonicalName());
   }
View Full Code Here


   public Connector process(AnnotationRepository annotationRepository, String xmlResourceAdapterClass,
                            ClassLoader classLoader)
      throws Exception
   {
      if (annotationRepository == null)
         throw new ValidateException(bundle.annotationRepositoryNull());
      /* Process
         -------
         javax.resource.spi.Activation
         javax.resource.spi.AdministeredObject
         javax.resource.spi.AuthenticationMechanism
View Full Code Here

         {
            // JBJCA-240
            if (xmlResourceAdapterClass == null || xmlResourceAdapterClass.equals(""))
            {
               log.noConnector();
               throw new ValidateException(bundle.noConnectorDefined());
            }
         }
         else
         {
            // JBJCA-240
            if (xmlResourceAdapterClass == null || xmlResourceAdapterClass.equals(""))
            {
               log.moreThanOneConnector();
               throw new ValidateException(bundle.moreThanOneConnectorDefined());
            }
         }
      }
      else
      {
View Full Code Here

            return attachConnectionDefinitions(connectionDefinitionsAnnotation, annotation.getClassName(),
                                               classLoader,
                                               configProperties, plainConfigProperties);
         }
         else
            throw new ValidateException(bundle.moreThanOneConnectionDefinitionsDefined());
      }
      return null;

   }
View Full Code Here

               {
                  return field.getType().getName();
               }
               else
               {
                  throw new ValidateException(bundle.wrongAnnotationType(annotation));
               }
            }
            catch (NoSuchFieldException nsfe)
            {
               clz = clz.getSuperclass();
            }
         }
      }
      else if (annotation.isOnMethod())
      {
         Class clz = Class.forName(annotation.getClassName(), true, classLoader);

         Class[] parameters = null;

         if (annotation.getParameterTypes() != null)
         {
            parameters = new Class[annotation.getParameterTypes().size()];

            for (int i = 0; i < annotation.getParameterTypes().size(); i++)
            {
               String parameter = annotation.getParameterTypes().get(i);
               parameters[i] = Class.forName(parameter, true, classLoader);
            }
         }

         while (!Object.class.equals(clz))
         {
            try
            {
               Method method = clz.getDeclaredMethod(annotation.getMemberName(), parameters);

               if (void.class.equals(method.getReturnType()))
               {
                  if (parameters != null && parameters.length > 0)
                  {
                     if (type == null || type.equals(Object.class) || type.equals(parameters[0]))
                     {
                        return parameters[0].getName();
                     }
                     else
                     {
                        throw new ValidateException(bundle.wrongAnnotationType(annotation));
                     }
                  }
               }
               else
               {
                  if (type == null || type.equals(Object.class) || type.equals(method.getReturnType()))
                  {
                     return method.getReturnType().getName();
                  }
                  else
                  {
                     throw new ValidateException(bundle.wrongAnnotationType(annotation));
                  }
               }
            }
            catch (NoSuchMethodException nsme)
            {
View Full Code Here

   {
      ResourceAdapter ra = this.getResourceadapter();

      //make sure all need metadata parsered and processed after annotation handle
      if (ra == null)
         throw new ValidateException(bundle.noMetadataForResourceAdapter());

      //make sure ra metadata contains inbound or outbound at least
      ra.validate();
   }
View Full Code Here

            && this.getResourceadapterClass() != null)
         inboundOrOutbound = true;

      if (!inboundOrOutbound
            && (XsdString.isNull(this.resourceadapterClass) || this.resourceadapterClass.getValue().trim().equals("")))
         throw new ValidateException(bundle.invalidMetadataForResourceAdapter());
   }
View Full Code Here

   {
      if (this.getManagedConnectionFactoryClass() == null || this.getManagedConnectionFactoryClass().getValue() == null
            || this.getManagedConnectionFactoryClass().getValue().trim().equals(""))
      {

         throw new ValidateException(bundle.missingValue("managed-connection-factory-class"));
      }

   }
View Full Code Here

   {
      if (userName != null)
      {
         if (securityDomain != null)
         {
            throw new ValidateException(bundle.invalidSecurityConfiguration());
         }
      }
   }
View Full Code Here

   @Override
   public void validate() throws ValidateException
   {
      if ((this.xaDataSourceClass == null || this.xaDataSourceClass.trim().length() == 0) &&
          (this.driver == null || this.driver.trim().length() == 0))
         throw new ValidateException(bundle.requiredElementMissing(Tag.XA_DATASOURCE_CLASS.getLocalName(),
                                                                   this.getClass().getCanonicalName()));

      if (this.xaDataSourceProperty.isEmpty())
         throw new ValidateException(bundle.requiredElementMissing(Tag.XA_DATASOURCE_PROPERTY.getLocalName(),
                                                                   this.getClass().getCanonicalName()));
   }
View Full Code Here

TOP

Related Classes of org.jboss.jca.common.api.validator.ValidateException

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.