Package flex.messaging.config

Examples of flex.messaging.config.ConfigurationException


    {      
        // Do not allow multiple destinations with the same id across services
        if (destinationToService.containsKey(destId))
        {         
            // Cannot add destination with id ''{0}'' to service with id ''{1}'' because another service with id ''{2}'' already has a destination with the same id.
            ConfigurationException ex = new ConfigurationException();
            ex.setMessage(ConfigurationConstants.DUPLICATE_DEST_ID, new Object[]{destId, svcId, destinationToService.get(destId)});               
            throw ex;
        }             
        destinationToService.put(destId, svcId);       
    }
View Full Code Here


       
        synchronized (messageBrokers)
        {
            if (messageBrokers.get(mbid) != null)
            {
                ConfigurationException ce = new ConfigurationException();
                ce.setMessage(10137, new Object[] {getId() == null ? "(no value supplied)" : mbid});
                throw ce;
            }
            messageBrokers.put(mbid, this);
        }
    }
View Full Code Here

            }
            else
            {
                invalidate();
                // Destination '{id}' must specify at least one adapter.
                ConfigurationException ex = new ConfigurationException();
                ex.setMessage(ConfigurationConstants.DEST_NEEDS_ADAPTER, new Object[]{getId()});
                throw ex;             
            }
        }   
       
        if (channelIds != null)
        {
            List brokerChannelIds = getService().getMessageBroker().getChannelIds();
            for (Iterator iter = channelIds.iterator(); iter.hasNext();)
            {
                String id = (String) iter.next();
                if (brokerChannelIds == null || !brokerChannelIds.contains(id))
                {
                    iter.remove();
                    if (Log.isWarn())
                    {
                        Log.getLogger(getLogCategory()).warn("No channel with id '{0}' is known by the MessageBroker." +
                                " Removing the channel.",
                                new Object[]{id});
                    }
                }
            }
        }       
       
        // Set the default channels if needed
        if (channelIds == null)
        {
            List defaultChannelIds = getService().getDefaultChannels();
            if (defaultChannelIds != null && defaultChannelIds.size() > 0)
            {
                setChannels(defaultChannelIds);
            }
            else
            {               
                invalidate();
                // Destination '{id}' must specify at least one channel.
                ConfigurationException ex = new ConfigurationException();
                ex.setMessage(ConfigurationConstants.DEST_NEEDS_CHANNEL, new Object[]{getId()});
                throw ex;
            }
        } 

        MessageBroker broker = getService().getMessageBroker();
View Full Code Here

    public ServiceAdapter createAdapter(String id)
    {
        if (getService() == null)
        {
            // Destination cannot create adapter '{0}' without its Service set.
            ConfigurationException ex = new ConfigurationException();
            ex.setMessage(NO_SERVICE, new Object[]{id});
            throw ex;           
        }       
        Map adapterClasses = getService().getRegisteredAdapters();       
        if (!adapterClasses.containsKey(id))
        {
            // No adapter with id '{0}' is registered with the service '{1}'.
            ConfigurationException ex = new ConfigurationException();
            ex.setMessage(ConfigurationConstants.UNREGISTERED_ADAPTER, new Object[]{id, getService().getId()});
            throw ex;           
        }
       
        String adapterClassName = (String)adapterClasses.get(id);
        Class adapterClass = ClassUtil.createClass(adapterClassName,
View Full Code Here

            channelEndpoint = StringUtils.substitute(channelEndpoint, "{context-root}", ConfigurationConstants.CONTEXT_PATH_TOKEN);

            if ((contextPath == null) && (channelEndpoint.indexOf(ConfigurationConstants.CONTEXT_PATH_TOKEN) != -1))
            {
                // context root must be specified before it is used
                ConfigurationException e = new ConfigurationException();
                e.setMessage(ConfigurationConstants.UNDEFINED_CONTEXT_ROOT, new Object[]{getId()});
                throw e;
            }

            // simplify the number of combinations to test by ensuring our
            // context path always starts with a slash
View Full Code Here

    public void addExcludeMethod(RemotingMethod value)
    {
        String name = value.getName();
        if (name == null)
        {
            ConfigurationException ce = new ConfigurationException();
            ce.setMessage(REMOTING_METHOD_NULL_NAME_ERRMSG, new Object[] {getDestination().getId()});
            throw ce;
        }

        // Validate that a method with this name is defined on the source class.
        if (!isMethodDefinedBySource(name))
        {
            ConfigurationException ce = new ConfigurationException();
            ce.setMessage(REMOTING_METHOD_NOT_DEFINED_ERRMSG, new Object[] {name, getDestination().getId()});
            throw ce;
        }

        if (excludeMethods == null)
        {
View Full Code Here

    public void addIncludeMethod(RemotingMethod value)
    {
        String name = value.getName();
        if (name == null)
        {
            ConfigurationException ce = new ConfigurationException();
            ce.setMessage(REMOTING_METHOD_NULL_NAME_ERRMSG, new Object[] {getDestination().getId()});
            throw ce;
        }

        // Validate that a method with this name is defined on the source class.
        if (!isMethodDefinedBySource(name))
        {
            ConfigurationException ce = new ConfigurationException();
            ce.setMessage(REMOTING_METHOD_NOT_DEFINED_ERRMSG, new Object[] {name, getDestination().getId()});
            throw ce;
        }

        if (includeMethods == null)
        {
View Full Code Here

                            method.setSecurityConstraint(getDestination().getService().getMessageBroker().getSecurityConstraint(constraintRef));
                        }
                        catch (SecurityException se)
                        {
                            // Rethrow with a more descriptive message.
                            ConfigurationException ce = new ConfigurationException();
                            ce.setMessage(REMOTING_METHOD_REFS_UNDEFINED_CONSTRAINT_ERRMSG, new Object[] {name, getDestination().getId(), constraintRef});
                            throw ce;
                        }
                    }
                    addIncludeMethod(method);
                }
View Full Code Here

TOP

Related Classes of flex.messaging.config.ConfigurationException

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.