Package flex.messaging.config

Examples of flex.messaging.config.ConfigurationException


    public void addService(Service service)
    {
        if (service == null)
        {
            // Cannot add null ''{0}'' to the ''{1}''
            ConfigurationException ex = new ConfigurationException();
            ex.setMessage(ConfigurationConstants.NULL_COMPONENT, new Object[]{"Service", "MessageBroker"});
            throw ex;
        }

        String id = service.getId();

        if (id == null)
        {
            // Cannot add ''{0}'' with null id to the ''{1}''
            ConfigurationException ex = new ConfigurationException();
            ex.setMessage(ConfigurationConstants.NULL_COMPONENT_ID, new Object[]{"Service", "MessageBroker"});
            throw ex;
        }
        // No need to add if service is already added
        if (getService(id) == service)
        {
            return;
        }
        // Do not allow multiple services with the same id
        if (getService(id) != null)
        {
            // Cannot add a ''{0}'' with the id ''{1}'' that is already registered with the ''{2}''
            ConfigurationException ex = new ConfigurationException();
            ex.setMessage(ConfigurationConstants.DUPLICATE_COMPONENT_ID, new Object[]{"Service", id, "MessageBroker"});
            throw ex;
        }
        // Do not allow multiple services of the same type
        String type = service.getClass().getName();
        if (getServiceByType(type) != null)
        {
            ConfigurationException ce = new ConfigurationException();
            ce.setMessage(SERVICE_TYPE_EXISTS, new Object[] {type});
            throw ce;
        }

        services.put(id, service);
View Full Code Here


    {
        // 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

            }
            MessageBroker broker = getService().getMessageBroker();
            FlexFactory f = broker.getFactory(factoryId);
            if (f == null)
            {
                ConfigurationException ex = new ConfigurationException();
                ex.setMessage(INVALID_FACTORY, new Object[] {getId(), factoryId});
                throw ex;
            }
            factory = f;
        }
       
View Full Code Here

                factoryId = DEFAULT_FACTORY;
            }
            if (getService() == null)
            {
                // Factory cannot be returned without ''{0}'' set.
                ConfigurationException ex = new ConfigurationException();
                ex.setMessage(FACTORY_CANNOT_BE_RETURNED, new Object[] {"Service"});
                throw ex;
            }
            if (getService().getMessageBroker() == null)
            {
                // Factory cannot be returned without ''{0}'' set.
                ConfigurationException ex = new ConfigurationException();
                ex.setMessage(FACTORY_CANNOT_BE_RETURNED, new Object[] {"MessageBroker"});
                throw ex;
            }
            MessageBroker broker = getService().getMessageBroker();
            FlexFactory f = broker.getFactory(factoryId);
            if (f == null)
            {
                ConfigurationException ex = new ConfigurationException();
                ex.setMessage(INVALID_FACTORY, new Object[] {getId(), factoryId});
                throw ex;
            }
            factory = f;
        }
        return factory;
View Full Code Here

        {
            MessageBroker broker = getService().getMessageBroker();
            FlexFactory factory = broker.getFactory(id);
            if (factory == null)
            {
                ConfigurationException ex = new ConfigurationException();
                ex.setMessage(INVALID_FACTORY, new Object[] {getId(), factory});
                throw ex;
            }
            setFactory(factory);
        }
        factoryId = id;
View Full Code Here

            InitialContext ic = new InitialContext();
            workManager = (WorkManager)ic.lookup(workManagerJNDIName);
        }
        catch(NamingException ne)
        {
            ConfigurationException ce = new ConfigurationException();
            ce.setMessage(13600, new Object[] {workManagerJNDIName});
            ce.setRootCause(ne);
            throw ce;
        }
       
        workListener = new WorkListener() {
            public void workAccepted(WorkEvent event) { /* No-op */ }
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.