Package org.projectodd.polyglot.messaging.destinations

Examples of org.projectodd.polyglot.messaging.destinations.QueueMetaData


    protected void deploy(DeploymentPhaseContext phaseContext, DeploymentUnit unit, RubyAppMetaData appMetaData, TaskMetaData task) throws DeploymentUnitProcessingException {
        String queueName = "/queues/torquebox/" + appMetaData.getApplicationName() + "/tasks/" + task.getQueueSuffix();
               
        if (task.getConcurrency() > 0) {
            QueueMetaData queue = new QueueMetaData();
            queue.setName( queueName );
            queue.setDurable( task.isDurable() );
            unit.addToAttachmentList( QueueMetaData.ATTACHMENTS_KEY, queue );

            MessageProcessorMetaData processorMetaData = new MessageProcessorMetaData();
            processorMetaData.setDestinationName( queueName );
            processorMetaData.setRubyClassName( task.getRubyClassName(), task.getLocation() );
View Full Code Here


        List<QueueMetaData> allMetaData = unit.getAttachmentList( QueueMetaData.ATTACHMENTS_KEY );

        assertEquals( 2, allMetaData.size() );

        QueueMetaData queueFoo = getMetaData( allMetaData, "/queues/foo" );
        assertNotNull( queueFoo );

        QueueMetaData queueBar = getMetaData( allMetaData, "/queues/bar" );
        assertNotNull( queueBar );
    }
View Full Code Here

        MockDeploymentUnit unit = deployResourceAs( "rootless-queues-knob.yml", "rootless-queues-knob.yml" );
        List<QueueMetaData> allMetaData = unit.getAttachmentList( QueueMetaData.ATTACHMENTS_KEY );

        assertEquals( 3, allMetaData.size() );

        QueueMetaData queueItchy = getMetaData( allMetaData, "/queues/itchy" );
        assertNotNull( queueItchy );
        assertTrue( queueItchy.isDurable() );

        QueueMetaData queueScratchy = getMetaData( allMetaData, "/queues/scratchy" );
        assertNotNull( queueScratchy );
        assertFalse( queueScratchy.isDurable() );
       
        QueueMetaData queuePoochie = getMetaData( allMetaData, "/queues/poochie" );
        assertNotNull( queuePoochie );
        assertTrue( queuePoochie.isDurable() );
       
    }
View Full Code Here

        List<QueueMetaData> allMetaData = unit.getAttachmentList( QueueMetaData.ATTACHMENTS_KEY );

        assertEquals( 3, allMetaData.size() );

        QueueMetaData queueFoo = getMetaData( allMetaData, "/queues/tbyaml/foo" );
        assertNotNull( queueFoo );

        QueueMetaData queueBar = getMetaData( allMetaData, "/queues/tbyaml/bar" );
        assertNotNull( queueBar );

        QueueMetaData queueFooBar = getMetaData( allMetaData, "/queues/tbyaml/foobar" );
        assertNotNull( queueFooBar );
    }
View Full Code Here

        assertEquals( 3, allMetaData.size() );

        // /queues/tbyaml/foo has no durability flag set, we should default to
        // durable
        QueueMetaData queueFoo = getMetaData( allMetaData, "/queues/tbyaml/foo" );
        assertNotNull( queueFoo );
        assertTrue( queueFoo.isDurable() );

        // /queues/tbyaml/bar has durability set to true, we should reflect that
        QueueMetaData queueBar = getMetaData( allMetaData, "/queues/tbyaml/bar" );
        assertNotNull( queueBar );
        assertFalse( queueBar.isDurable() );

        // /queues/tbyaml/bar has durability set to false, we should reflect
        // that
        QueueMetaData queueFooBar = getMetaData( allMetaData, "/queues/tbyaml/foobar" );
        assertNotNull( queueFooBar );
        assertTrue( queueFooBar.isDurable() );

    }
View Full Code Here

    public void parse(DeploymentUnit unit, Object dataObject) throws DeploymentUnitProcessingException {

        Map<String, Map<String, Object>> data = (Map<String, Map<String, Object>>) dataObject;

        for (String queueName : data.keySet()) {
            QueueMetaData queueMetaData = new QueueMetaData(queueName);
            Map<String, Object> queueOptions = data.get(queueName);

            // Default value for durability
            queueMetaData.setDurable(true);

            if (queueOptions != null) {
                if (queueOptions.containsKey("durable")) {
                    queueMetaData.setDurable((Boolean) queueOptions.get("durable"));
                }

                if (queueOptions.containsKey("exported")) {
                    queueMetaData.setExported((Boolean) queueOptions.get("exported"));
                }

                parseRemote(queueMetaData, queueOptions.get("remote"));
            }
View Full Code Here

TOP

Related Classes of org.projectodd.polyglot.messaging.destinations.QueueMetaData

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.