Package flex.messaging

Examples of flex.messaging.MessageDestination


    </destination>
    */
    private void createDestination1(Service service)
    {
        String destinationId = "MyTopic";
        MessageDestination destination = (MessageDestination)service.createDestination(destinationId);
       
        NetworkSettings ns = new NetworkSettings();
        ns.setSubscriptionTimeoutMinutes(0);
        ThrottleSettings ts = new ThrottleSettings();
        ts.setInboundPolicy(Policy.ERROR);
        ts.setIncomingDestinationFrequency(0);
        ts.setOutboundPolicy(Policy.IGNORE);
        ts.setOutgoingDestinationFrequency(0);
        ns.setThrottleSettings(ts);
        destination.setNetworkSettings(ns);
       
        ServerSettings ss = new ServerSettings();
        ss.setMessageTTL(0);
        ss.setBroadcastRoutingMode("server-to-server");
        destination.setServerSettings(ss);

        destination.addChannel("my-polling-amf");
    }
View Full Code Here


    </destination>
     */
    private void createDestination2(Service service)
    {
        String destinationId = "MyJMSTopic";
        MessageDestination destination = (MessageDestination)service.createDestination(destinationId);

        ServerSettings ss = new ServerSettings();
        ss.setDurable(false);
        destination.setServerSettings(ss);

        String adapterId = "jms";
        JMSAdapter adapter = (JMSAdapter)destination.createAdapter(adapterId);

        // JMS settings are set at the adapter level
        JMSSettings jms = new JMSSettings();
        jms.setDestinationType("Topic");
        jms.setMessageType("javax.jms.TextMessage");
        jms.setConnectionFactory("jms/flex/TopicConnectionFactory");
        jms.setDestinationJNDIName("jms/topic/flex/simpletopic");
        jms.setDeliveryMode("NON_PERSISTENT");
        //jms.setMessagePriority(javax.jms.Message.DEFAULT_PRIORITY);
        jms.setAcknowledgeMode("AUTO_ACKNOWLEDGE");
        jms.setMaxProducers(1);
        Hashtable envProps = new Hashtable();
        envProps.put("Context.SECURITY_PRINCIPAL", "anonymous");
        envProps.put("Context.SECURITY_CREDENTIALS", "anonymous");
        envProps.put("Context.PROVIDER_URL", "http://{server.name}:1856");
        envProps.put("Context.INITIAL_CONTEXT_FACTORY", "fiorano.jms.runtime.naming.FioranoInitialContextFactory");
        jms.setInitialContextEnvironment(envProps);
        adapter.setJMSSettings(jms);

        destination.setSecurityConstraint("sample-users");

        destination.addChannel("my-polling-amf");
    }
View Full Code Here

    {
        String serviceId = "message-service";
        String id = "MyTransientTopic2";
       
        MessageService msgService = (MessageService)msgBroker.getService(serviceId);
        MessageDestination msgDestination;
        msgDestination = (MessageDestination)msgService.createDestination(id);
               
        msgDestination.addChannel("qa-polling-amf");
             
        ServerSettings serverSettings = new ServerSettings();
        serverSettings.setMessageTTL(0);
        serverSettings.setDurable(false);
        msgDestination.setServerSettings(serverSettings);
       
        // we'll use the default adapter - so nothing else is needed       
       
        if (msgService.isStarted())
            msgDestination.start();
       
        return "Destination: "+id+" created for Service: "+serviceId;  
    }
View Full Code Here

    </destination>
    */

    private MessageDestination createDestination(String id, MessageService messageService)
    {
        MessageDestination msgDest;
        msgDest = (MessageDestination)messageService.createDestination(id);

        // <network>
        NetworkSettings ns = new NetworkSettings();
        ns.setSubscriptionTimeoutMinutes(0);
        ThrottleSettings ts = new ThrottleSettings();
        ts.setInboundPolicy(ThrottleSettings.Policy.ERROR);
        ts.setIncomingClientFrequency(0);
        ts.setOutboundPolicy(ThrottleSettings.Policy.IGNORE);
        ts.setOutgoingClientFrequency(0);
        ns.setThrottleSettings(ts)
       
        // <server>
        ServerSettings ss = new ServerSettings();
        ss.setMessageTTL(0);
        ss.setDurable(false);
        msgDest.setServerSettings(ss);
     
        // switch managed on / off
        msgDest.setManaged(false);
       
        msgDest.addChannel("qa-polling-amf");
       
        return msgDest;
    }
View Full Code Here

    </destination>
    */

    private MessageDestination createDestination(String id, MessageService messageService)
    {
        MessageDestination msgDest;
        msgDest = (MessageDestination)messageService.createDestination(id);

        // <network>
        NetworkSettings ns = new NetworkSettings();
        ns.setSubscriptionTimeoutMinutes(0);
        ThrottleSettings ts = new ThrottleSettings();
        ts.setInboundPolicy(ThrottleSettings.Policy.ERROR);
        ts.setIncomingClientFrequency(0);
        ts.setOutboundPolicy(ThrottleSettings.Policy.IGNORE);
        ts.setOutgoingClientFrequency(0);
        ns.setThrottleSettings(ts)
       
        // <server>
        ServerSettings ss = new ServerSettings();
        ss.setMessageTTL(0);
        ss.setDurable(false);
        msgDest.setServerSettings(ss);
       
        msgDest.addChannel("qa-polling-amf");
       
        return msgDest;
    }
View Full Code Here

    public void start()
    {
        //Create destination and add to the Service
        MessageService service = (MessageService) broker.getService("message-service");
        String id = "MessageDest_runtime";
        MessageDestination dest = createDestination(id, service);
        dest.start();
    }
View Full Code Here

    {
        String serviceId = "message-service";
        String id = "messaging_AMF_Poll_Runtime";

        MessageService msgService = (MessageService)msgBroker.getService(serviceId);
        MessageDestination msgDestination = (MessageDestination)msgService.createDestination(id);
        msgDestination.addChannel("my-amf-poll");

        if (msgService.isStarted())
            msgDestination.start();

        return "Destination: " + id + " created for Service: " + serviceId;
    }
View Full Code Here

    {
        String serviceId = "message-service";
        String id = "messaging_AMF_Poll_JMS_Topic_Runtime";

        MessageService msgService = (MessageService)msgBroker.getService(serviceId);
        MessageDestination msgDestination = (MessageDestination)msgService.createDestination(id);
        msgDestination.addChannel("my-amf-poll");

        // Use JMSSettings object for the <jms> properties above
        JMSSettings js = new JMSSettings();
        js.setConnectionFactory("java:comp/env/jms/flex/TopicConnectionFactory");
        js.setDestinationType("Topic");       
        js.setMessageType("javax.jms.TextMessage");       
        js.setDestinationJNDIName("java:comp/env/jms/topic/flex/simpletopic");

        JMSAdapter adapter = new JMSAdapter();
        adapter.setId("jms");
        adapter.setJMSSettings(js);
        adapter.setDestination(msgDestination);

        if (msgService.isStarted())
            msgDestination.start();

        return "Destination: " + id + " created for Service: " + serviceId;
    }
View Full Code Here

    {       
        Destination d = new Destination();
       
        MessageBroker mb = MessageBroker.getMessageBroker(null);
        MessageService service = (MessageService) mb.getService("message-service");
        MessageDestination destination = (MessageDestination)service.getDestination(dest_runtime);
       
        Log.getLogger("QE.CODE_COVERAGE").debug("Destination " + dest_runtime + " isCluster=" + destination.isClustered() +" isBackendShared=" + destination.isBackendShared());
       
        destination.removeChannel("qa-polling-amf");
        destination.addChannel("non-existing-channel");
       
        ArrayList ids = new ArrayList();
        ids.add("qa-polling-amf");
        ids.add("non-existing-channel2");
        destination.setChannels(ids);
       
        ConfigMap cm = destination.describeDestination().getPropertyAsMap("channels", null);       
        if (cm != null)
            Log.getLogger("QE.CODE_COVERAGE").debug("Destination " + dest_runtime + " has " + cm.size() + " channels." );
       
        ServiceAdapter adapter = destination.getAdapter();
        if (adapter != null)
        {
            destination.setAdapter(null);
            destination.setAdapter(adapter);
            destination.start();   
        }
       
        destination.setSecurityConstraint("no-existing-constraint");
    }
View Full Code Here

        service.removeDestination(id);
    }  
    
    public void createDestination(String id)
    {
        MessageDestination msgDest = (MessageDestination)service.createDestination(id);
       
        // <network>
        NetworkSettings ns = new NetworkSettings();
        ns.setSubscriptionTimeoutMinutes(30);
        ns.setSharedBackend(true);
        ns.setClusterId(null);
        ThrottleSettings ts = new ThrottleSettings();
        ts.setInboundPolicy(ThrottleSettings.Policy.ERROR);
        ts.setIncomingClientFrequency(0);
        ts.setOutboundPolicy(ThrottleSettings.Policy.NONE);
        ts.setOutgoingClientFrequency(0);
        ns.setThrottleSettings(ts);  
        msgDest.setNetworkSettings(ns);
       
        // <server>
        ServerSettings ss = new ServerSettings();
        ss.setMessageTTL(100);
        ss.setDurable(false);
        ss.setAllowSubtopics(true);
        msgDest.setServerSettings(ss);
       
        // <channels>
        msgDest.addChannel("qa-http-polling");
       
        msgDest.start()
    }
View Full Code Here

TOP

Related Classes of flex.messaging.MessageDestination

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.