Package net.timewalker.ffmq3

Examples of net.timewalker.ffmq3.FFMQException


            if (c >= '0' && c <= '9')
                continue;
            if (c == '_' || c == '-')
                continue;
           
            throw new FFMQException("Destination name '"+destinationName+"' contains an invalid character : "+c,"INVALID_DESTINATION_NAME");
        }
    }
View Full Code Here


     * Check the validity of a queue name
     */
    public static void checkQueueName( String queueName ) throws JMSException
    {
        if (queueName == null)
            throw new FFMQException("Queue name is not set","INVALID_DESTINATION_NAME");           
        if (queueName.length() > FFMQConstants.MAX_QUEUE_NAME_SIZE)
            throw new FFMQException("Queue name '"+queueName+"' is too long ("+queueName.length()+" > "+FFMQConstants.MAX_QUEUE_NAME_SIZE+")","INVALID_DESTINATION_NAME");
        checkDestinationName(queueName);
    }
View Full Code Here

     * Check the validity of a topic name
     */
    public static void checkTopicName( String topicName ) throws JMSException
    {
        if (topicName == null)
            throw new FFMQException("Topic name is not set","INVALID_DESTINATION_NAME");     
        if (topicName.length() > FFMQConstants.MAX_TOPIC_NAME_SIZE)
            throw new FFMQException("Topic name '"+topicName+"' is too long ("+topicName.length()+" > "+FFMQConstants.MAX_TOPIC_NAME_SIZE+")","INVALID_DESTINATION_NAME");
        checkDestinationName(topicName);
    }
View Full Code Here

     * @see javax.jms.TemporaryQueue#delete()
     */
    public void delete() throws JMSException
    {
        if (connection == null)
            throw new FFMQException("Temporary queue already deleted","QUEUE_DOES_NOT_EXIST");
           
        connection.deleteTemporaryQueue(name);
        connection = null;
    }
View Full Code Here

     * Read and parse an XML descriptor file
     */
    public AbstractDescriptor read( File descriptorFile , Class handlerClass ) throws JMSException
    {
        if (!descriptorFile.canRead())
            throw new FFMQException("Can't read descriptor file : "+descriptorFile.getAbsolutePath(),"FS_ERROR");
       
        log.debug("Parsing descriptor : "+descriptorFile.getAbsolutePath());
       
        AbstractXMLDescriptorHandler handler;
        try
        {
            // Create an handler instance
            handler = (AbstractXMLDescriptorHandler)handlerClass.newInstance();
           
            // Parse the descriptor file
            SAXParserFactory factory = SAXParserFactory.newInstance();
            SAXParser parser = factory.newSAXParser();
            FileInputStream in = new FileInputStream(descriptorFile);
            parser.parse(in,handler);
            in.close();
        }
        catch (Exception e)
        {
            throw new FFMQException("Cannot parse descriptor file : "+descriptorFile.getAbsolutePath(),"PARSE_ERROR",e);
        }
       
        AbstractDescriptor descriptor = handler.getDescriptor();
        descriptor.setDescriptorFile(descriptorFile);

View Full Code Here

            settings.load(in);
            in.close();
        }
        catch (Exception e)
        {
            throw new FFMQException("Cannot load settings from "+settingsFile.getAbsolutePath()+" : "+e,"FS_ERROR");
        }
        finally
        {
            try
            {
                if (in != null)
                    in.close();
            }
            catch (Exception e)
            {
                throw new FFMQException("Cannot close settings file "+settingsFile.getAbsolutePath()+" : "+e,"FS_ERROR");
            }
        }
    }
View Full Code Here

            settings.store(out, title);
            out.close();
        }
        catch (Exception e)
        {
            throw new FFMQException("Cannot save settings to "+settingsFile.getAbsolutePath()+" : "+e,"FS_ERROR");
        }
        finally
        {
            try
            {
                if (out != null)
                    out.close();
            }
            catch (Exception e)
            {
                throw new FFMQException("Cannot close settings file "+settingsFile.getAbsolutePath()+" : "+e,"FS_ERROR");
            }
        }
    }
View Full Code Here

     * @see javax.jms.Session#unsubscribe(java.lang.String)
     */
    public void unsubscribe(String subscriptionName) throws JMSException
    {
      if (StringTools.isEmpty(subscriptionName))
            throw new FFMQException("Empty subscription name","INVALID_SUBSCRIPTION_NAME");
     
      synchronized (externalAccessLock)
    {
          checkNotClosed();
         
View Full Code Here

     
      synchronized (externalAccessLock)
    {
          checkNotClosed();
          if (deliveredMessageIDs.isEmpty())
            throw new FFMQException("No received message to acknowledge","INTERNAL_ERROR");
         
          if (sendAcksAsync)
          {
            // Copy message list
            List messageIDs = new ArrayList(deliveredMessageIDs.size());
View Full Code Here

            return null;
       
        if (value instanceof Boolean)
            return (Boolean)value;
       
        throw new FFMQException("Expected a boolean but got : "+value.toString(),"INVALID_SELECTOR_EXPRESSION");
    }
View Full Code Here

TOP

Related Classes of net.timewalker.ffmq3.FFMQException

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.