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

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


   @Override
   public void validate() throws ValidateException
   {
      if (this.name == null || this.name.trim().length() == 0)
         throw new ValidateException("name (xml attribute " + Attribute.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

   @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("xaDataSourceClass (xml tag " + Tag.XADATASOURCECLASS + ") is required");
      if (this.xaDataSourceProperty.isEmpty())
         throw new ValidateException("at least one xaDataSourceProperty (xml tag " + Tag.XADATASOURCEPROPERTY +
                                     ") is required ");

   }
View Full Code Here

   @Override
   public void validate() throws ValidateException
   {
      if (this.connectionUrl == null || this.connectionUrl.trim().length() == 0)
         throw new ValidateException("connectionUrl (xml tag " + Tag.CONNECTIONURL + ") is required in " +
                                     this.getClass().getCanonicalName());
      if ((this.driverClass == null || this.driverClass.trim().length() == 0) &&
          (this.driver == null || this.driver.trim().length() == 0))
         throw new ValidateException("driverClass (xml tag " + Tag.DRIVERCLASS + ") is required in " +
                                     this.getClass().getCanonicalName() + "if no driver (xml tag " + Tag.DRIVER +
                                     ") is not specified");

   }
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

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.