Package flex.messaging

Examples of flex.messaging.MessageBroker


            return;

        super.setId(id);

        // Update the endpoint id in the broker
        MessageBroker broker = getMessageBroker();
        if (broker != null)
        {
            // broker must have the endpoint then
            broker.removeEndpoint(oldId);
            broker.addEndpoint(this);
        }
    }
View Full Code Here


     *
     * @param broker <code>MessageBroker</code> of the <code>AbstractEndpoint</code>.
     */
    public void setMessageBroker(MessageBroker broker)
    {
        MessageBroker oldBroker = getMessageBroker();

        setParent(broker);

        if (oldBroker != null)
            oldBroker.removeEndpoint(getId());

        // Add endpoint to the new broker if needed
        if (broker.getEndpoint(getId()) != this)
            broker.addEndpoint(this);
    }
View Full Code Here

        createServices(broker);
    }

    public MessageBroker createBroker(String id, ClassLoader loader)
    {
        return new MessageBroker(systemSettings.isManageable(), id, loader);
    }
View Full Code Here

            startDestinations();
            return;
        }

        // Check if the MessageBroker is started
        MessageBroker broker = getMessageBroker();
        if (!broker.isStarted())
        {
            if (Log.isWarn())
            {
                Log.getLogger(getLogCategory()).warn("Service with id '{0}' cannot be started" +
                        " when the MessageBroker is not started.",
                        new Object[]{getId()});
            }
            return;
        }

        // Set up management
        if (isManaged() && broker.isManaged())
        {
            setupServiceControl(broker);
            MessageBrokerControl controller = (MessageBrokerControl)broker.getControl();
            if (getControl() != null)
                controller.addService(getControl().getObjectName());
        }

        super.start();
View Full Code Here

        String oldId = getId();

        super.setId(id);

        // Update the service id in the broker
        MessageBroker broker = getMessageBroker();
        if (broker != null)
        {
            // broker must have the service then
            broker.removeService(oldId);
            broker.addService(this);
        }
    }
View Full Code Here

     *
     * @param broker <code>MessageBroker</code> of the <code>AbstractService</code>.
     */
    public void setMessageBroker(MessageBroker broker)
    {
        MessageBroker oldBroker = getMessageBroker();

        setParent(broker);

        if (oldBroker != null)
        {
            oldBroker.removeService(getId());
        }

        // Add service to the new broker if needed
        if (broker.getService(getId()) != this)
            broker.addService(this);
View Full Code Here

                    if (adapter.handlesSubscriptions())
                    {
                        List missedMessages = (List)adapter.manage(command);
                        if (missedMessages != null && !missedMessages.isEmpty())
                        {
                            MessageBroker broker = getMessageBroker();
                            for (Iterator iter = missedMessages.iterator(); iter.hasNext();)
                                broker.routeMessageToMessageClient((Message)iter.next(), client);
                        }
                    }
                    FlushResult flushResult = client.getFlexClient().poll(client);
                    List messagesToReturn = (flushResult != null) ? flushResult.getMessages() : null;
                    if (messagesToReturn != null && !messagesToReturn.isEmpty())
View Full Code Here

     * version of this method to retrieve a DataDestination if you are not in the
     * context of processing a current message when you need the RemotingDestination.
     */
    public static RemotingDestination getRemotingDestination(String serverId, String destinationName)
    {
        MessageBroker broker = MessageBroker.getMessageBroker(serverId);

        if (broker == null)
        {
            // Unable to locate a MessageBroker initialized with server id ''{0}''
            MessageException me = new MessageException();
            me.setMessage(NO_MESSAGE_BROKER, new Object[] { serverId });
            throw me;
        }

        RemotingService rs = (RemotingService) broker.getServiceByType(REMOTING_SERVICE_CLASS);
        if (rs == null)
        {
            // MessageBroker with server id ''{0}'' does not contain a service with class flex.messaging.remoting.RemotingService
            MessageException me = new MessageException();
            me.setMessage(NO_REMOTING_SERVICE, new Object[] { serverId });
View Full Code Here

                        }
                    }
                    instance.applicationInstance = inst;

                    // increment attribute-id reference count on MB
                    MessageBroker mb = FlexContext.getMessageBroker();
                    if (mb != null)
                    {
                        mb.incrementAttributeIdRefCount(instance.getAttributeId());
                    }
                }
            }
            catch (Throwable t)
            {
                ConfigurationException ex = new ConfigurationException();
                ex.setMessage(SINGLETON_ERROR, new Object[] { instance.getSource(), id });
                ex.setRootCause(t);

                if (Log.isError())
                    Log.getLogger(ConfigurationManager.LOG_CATEGORY).error(ex.getMessage() + StringUtils.NEWLINE + ExceptionUtil.toString(t));

                throw ex;
            }
        }
        else if(instance.getScope().equalsIgnoreCase(SCOPE_SESSION))
        {
            // increment attribute-id reference count on MB for Session scoped instances
            MessageBroker mb = FlexContext.getMessageBroker();
            if (mb != null)
            {
                mb.incrementAttributeIdRefCount(instance.getAttributeId());
            }
        }
        return instance;
    }
View Full Code Here

        }     
       
        this.id = id;
       
        // Update the service id in the broker
        MessageBroker broker = getMessageBroker();
        if (broker != null)
        {
            // broker must have the service then
            broker.removeService(oldId);
            broker.addService(this);
        }           
    }
View Full Code Here

TOP

Related Classes of flex.messaging.MessageBroker

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.