Package net.timewalker.ffmq3

Examples of net.timewalker.ffmq3.FFMQException


        {
            queueTemplate.check();
        }
        catch (InvalidDescriptorException e)
        {
            throw new FFMQException("Cannot register queue template : "+queueTemplate,"INVALID_QUEUE_TEMPLATE",e);
        }
       
        if (queueTemplates.put(queueTemplate.getName(), queueTemplate) != null)
            throw new FFMQException("Queue template name already used : "+queueTemplate.getName(),"DUPLICATE_QUEUE_TEMPLATE");
    }
View Full Code Here


        {
            topicTemplate.check();
        }
        catch (InvalidDescriptorException e)
        {
            throw new FFMQException("Cannot register topic template : "+topicTemplate,"INVALID_TOPIC_TEMPLATE",e);
        }
       
        if (topicTemplates.put(topicTemplate.getName(), topicTemplate) != null)
            throw new FFMQException("Topic template name already used : "+topicTemplate.getName(),"DUPLICATE_TOPIC_TEMPLATE");
    }
View Full Code Here

    {
        if (!queueTemplateDescriptor.exists())
            return null;
       
        if (!queueTemplateDescriptor.canRead())
            throw new FFMQException("Cannot access queue template descriptor : "+queueTemplateDescriptor.getAbsolutePath(),"FS_ERROR");
       
        Settings queueSettings = new Settings();
        queueSettings.readFrom(queueTemplateDescriptor);
       
        return new QueueTemplate(queueSettings);
View Full Code Here

    {
        if (!topicTemplateDescriptor.exists())
            return null;
           
        if (!topicTemplateDescriptor.canRead())
            throw new FFMQException("Cannot access topic template descriptor : "+topicTemplateDescriptor.getAbsolutePath(),"FS_ERROR");
       
        Settings topicSettings = new Settings();
        topicSettings.readFrom(topicTemplateDescriptor);
       
        return new TopicTemplate(topicSettings);
View Full Code Here

    {
        if (!queueDescriptor.exists())
            return null;
       
        if (!queueDescriptor.canRead())
            throw new FFMQException("Cannot access queue definition descriptor : "+queueDescriptor.getAbsolutePath(),"FS_ERROR");
       
        Settings queueSettings = new Settings();
        queueSettings.readFrom(queueDescriptor);
       
        return new QueueDefinition(queueSettings);
View Full Code Here

    }
   
    public void addQueueDefinition( QueueDefinition queueDef ) throws JMSException
    {
        if (queueDefinitions.containsKey(queueDef.getName()))
            throw new FFMQException("Queue definition already exists : "+queueDef.getName(),"QUEUE_DEFINITION_ALREADY_EXIST");
       
        if (queueDef.hasDescriptor() && setup.getDestinationDefinitionsDir() != null)
        {
            // Check that the descriptor file does not exist
            File queueDescriptor = new File(setup.getDestinationDefinitionsDir(),"queue-"+queueDef.getName()+".properties");
            if (queueDescriptor.exists())
                throw new FFMQException("Queue descriptor already exists : "+queueDescriptor.getAbsolutePath(),"FS_ERROR");
           
            // Create the descriptor file
            log.debug("Persisting queue definition for "+queueDef.getName());
            Settings queueSettings = queueDef.asSettings();
            queueSettings.writeTo(queueDescriptor, "Queue definition descriptor for "+queueDef.getName());
View Full Code Here

    {
        if (!topicDescriptor.exists())
            return null;
           
        if (!topicDescriptor.canRead())
            throw new FFMQException("Cannot access topic definition descriptor : "+topicDescriptor.getAbsolutePath(),"FS_ERROR");
       
        Settings topicSettings = new Settings();
        topicSettings.readFrom(topicDescriptor);

        return new TopicDefinition(topicSettings);
View Full Code Here

    }
   
    public void addTopicDefinition( TopicDefinition topicDef ) throws JMSException
    {
        if (topicDefinitions.containsKey(topicDef.getName()))
            throw new FFMQException("Topic definition already exists : "+topicDef.getName(),"TOPIC_DEFINITION_ALREADY_EXIST");
       
        if (setup.getDestinationDefinitionsDir() != null)
        {
            // Check that the descriptor file does not exist
            File topicDescriptor = new File(setup.getDestinationDefinitionsDir(),"topic-"+topicDef.getName()+".properties");
            if (topicDescriptor.exists())
                throw new FFMQException("Topic descriptor already exists : "+topicDescriptor.getAbsolutePath(),"FS_ERROR");
           
            // Create the descriptor file
            Settings topicSettings = topicDef.asSettings();
            topicSettings.writeTo(topicDescriptor, "Topic definition descriptor for "+topicDef.getName());
        }
View Full Code Here

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

        String destinationDefinitionDirPath = settings.getStringProperty(FFMQCoreSettings.DESTINATION_DEFINITIONS_DIR, null);
        if (destinationDefinitionDirPath != null)
        {
            destinationDefinitionsDir = new File(destinationDefinitionDirPath);
            if (!destinationDefinitionsDir.isDirectory())
                throw new FFMQException("Destination definitions directory does not exist : "+destinationDefinitionsDir.getAbsolutePath(),"FS_ERROR");
        }
        else
            log.warn("Destination definitions directory is not set, running in memory only mode.");
       
        // Bridge definitions directory
        String bridgeDefinitionDirPath = settings.getStringProperty(FFMQCoreSettings.BRIDGE_DEFINITIONS_DIR, null);
        if (bridgeDefinitionDirPath != null)
        {
            bridgeDefinitionsDir = new File(bridgeDefinitionDirPath);
            if (!bridgeDefinitionsDir.isDirectory())
                throw new FFMQException("Bridge definitions directory does not exist : "+bridgeDefinitionsDir.getAbsolutePath(),"FS_ERROR");
        }
       
        // Templates directory
        String templatesDirPath = settings.getStringProperty(FFMQCoreSettings.TEMPLATES_DIR, null);
        if (templatesDirPath == null)
            throw new FFMQException("Templates directory not defined : "+FFMQCoreSettings.TEMPLATES_DIR,"MISSING_SETTING");
        templatesDir = new File(templatesDirPath);
        if (!templatesDir.isDirectory())
            throw new FFMQException("Templates directory does not exist : "+templatesDir.getAbsolutePath(),"FS_ERROR");
       
        // Templates mapping file
        String templatesMappingPath = settings.getStringProperty(FFMQCoreSettings.TEMPLATE_MAPPING_FILE, null);
        if (!StringTools.isEmpty(templatesMappingPath))
        {
            templateMappingFile = new File(templatesMappingPath);
            if (!templateMappingFile.canRead())
                throw new FFMQException("Template mapping file does not exist : "+templateMappingFile.getAbsolutePath(),"FS_ERROR");
        }

        // Default data directory
        String defaultDataDirPath = settings.getStringProperty(FFMQCoreSettings.DEFAULT_DATA_DIR, null);
        if (defaultDataDirPath == null)
            throw new FFMQException("Default data directory not defined : "+FFMQCoreSettings.DEFAULT_DATA_DIR,"MISSING_SETTING");
        defaultDataDir = new File(defaultDataDirPath);
        if (!defaultDataDir.isDirectory())
            throw new FFMQException("Default data directory does not exist : "+defaultDataDir.getAbsolutePath(),"FS_ERROR");
       
        // Auto-create
        autoCreateQueues = settings.getBooleanProperty(FFMQCoreSettings.AUTO_CREATE_QUEUES, false);
        autoCreateTopics = settings.getBooleanProperty(FFMQCoreSettings.AUTO_CREATE_TOPICS, false);
       
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.