Package javax.resource.spi

Examples of javax.resource.spi.InvalidPropertyException


    public void setCronExpression(String s) {
        try {
            trigger.setCronExpression(s);
        } catch (ParseException e) {
            invalidProperty = new InvalidPropertyException("Invalid cron expression " + s, e);
        }
    }
View Full Code Here


        for (String format : formats) {
            SimpleDateFormat dateFormat = new SimpleDateFormat(format);
            try {
                return dateFormat.parse(value);
            } catch (ParseException e) {
                invalidProperty = new InvalidPropertyException("Invalid time format " + value, e);
            }

        }

        return null;
View Full Code Here

        try {
            detail.validate();
            trigger.validate();
        } catch (SchedulerException e) {
            throw new InvalidPropertyException(e);
        }
    }
View Full Code Here

    */
   public void validate() throws InvalidPropertyException
   {
      /** An int between 1-10 */
      if( anInt <= 0 || anInt > 10 )
         throw new InvalidPropertyException("anInt is not between 1-10");
      /** An int between 50-100 */
      if( anInteger.intValue() <= 49 || anInteger.intValue() > 100 )
         throw new InvalidPropertyException("anInt is not between 50-100");
      /** The 127.0.0.1 address */
      if( localhost.getHostAddress().equals("127.0.0.1") == false )
         throw new InvalidPropertyException("localhost is not 127.0.0.1");        
      /** Properties of the key1=*;key2=*;... */
      if( props.size() == 0 )
         throw new InvalidPropertyException("props has no values");        
   }
View Full Code Here

        {
            this.endpointURI = new MuleEndpointURI(endpoint, resourceAdapter.muleContext);
        }
        catch (EndpointException e)
        {
            throw new InvalidPropertyException(e);
        }

        if (propertiesMap != null)
        {
            propertiesMap.putAll(this.endpointURI.getParams());
        }
        else
        {
            propertiesMap = this.endpointURI.getParams();
        }
        if (endpoint == null)
        {
            throw new InvalidPropertyException("endpoint is null");
        }

        if (endpointURI == null)
        {
            throw new InvalidPropertyException("endpointURI is null");
        }
    }
View Full Code Here

            b.append("Invalid settings:");
            for (Iterator iter = errorMessages.iterator(); iter.hasNext();) {
                b.append(" ");
                b.append(iter.next());
            }
            InvalidPropertyException e = new InvalidPropertyException(b.toString());
            final PropertyDescriptor[] descriptors = (PropertyDescriptor[]) propsNotSet.toArray(new PropertyDescriptor[propsNotSet.size()]);
            e.setInvalidPropertyDescriptors(descriptors);
            throw e;
        }
    }
View Full Code Here

            b.append("Invalid settings:");
            for (Iterator<String> iter = errorMessages.iterator(); iter.hasNext();) {
                b.append(" ");
                b.append(iter.next());
            }
            InvalidPropertyException e = new InvalidPropertyException(b.toString());
            final PropertyDescriptor[] descriptors = propsNotSet.toArray(new PropertyDescriptor[propsNotSet.size()]);
            e.setInvalidPropertyDescriptors(descriptors);
            throw e;
        }
    }
View Full Code Here

    }

    @Override
    public void validate() throws InvalidPropertyException {
        if (beanClassName == null)
            throw new InvalidPropertyException("beanClass is null");

        final Class<?> beanClass = beanClass();
        // Set Prompt
        final Prompt prompt = (Prompt) beanClass.getAnnotation(Prompt.class);
        if (prompt != null) {
            this.prompt = prompt.value();
        }

        // Get Commands
        final Method[] methods = beanClass.getMethods();
        for (Method method : methods) {
            if (method.isAnnotationPresent(Command.class)) {
                final Command command = method.getAnnotation(Command.class);
                cmds.add(new Cmd(command.value(), method));
            }
        }

        // Validate
        if (this.prompt == null || this.prompt.length() == 0) {
            this.prompt = "prompt>";
        }
        if (this.cmds.size() == 0) {
            throw new InvalidPropertyException("No @Command methods");
        }
    }
View Full Code Here

            b.append("Invalid settings:");
            for (Iterator<String> iter = errorMessages.iterator(); iter.hasNext();) {
                b.append(" ");
                b.append(iter.next());
            }
            InvalidPropertyException e = new InvalidPropertyException(b.toString());
            final PropertyDescriptor[] descriptors = propsNotSet.toArray(new PropertyDescriptor[propsNotSet.size()]);
            e.setInvalidPropertyDescriptors(descriptors);
            throw e;
        }
    }
View Full Code Here

        for (final String format : formats) {
            final SimpleDateFormat dateFormat = new SimpleDateFormat(format);
            try {
                return dateFormat.parse(value);
            } catch (final ParseException e) {
                invalidProperty = new InvalidPropertyException("Invalid time format " + value, e);
            }

        }

        return null;
View Full Code Here

TOP

Related Classes of javax.resource.spi.InvalidPropertyException

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.