Package org.mule.api.lifecycle

Examples of org.mule.api.lifecycle.InitialisationException


            try
            {
                moduleObject = muleContext.getRegistry().lookupObject(AssertModule.class);
                if (moduleObject == null)
                {
                    throw new InitialisationException(MessageFactory.createStaticMessage("Cannot find object"), this);
                }
            }
            catch (RegistrationException e)
            {
                throw new InitialisationException(CoreMessages.initialisationFailure("org.mule.munit.AssertModule"), e, this);
            }
        }

    }
View Full Code Here


    @Override
    public void initialise() throws InitialisationException
    {
        if (bean == null)
        {
            throw new InitialisationException(MessageFactory.createStaticMessage("Bean name has not been set."), this);
        }
        if (applicationContext == null)
        {
            throw new InitialisationException(
                MessageFactory.createStaticMessage("ApplicationContext has not been injected."), this);
        }
    }
View Full Code Here

        {
            if (endpoint.getMuleContext().getSecurityManager() == null)
            {
                if (strategy == null)
                {
                    throw new InitialisationException(CoreMessages.authSecurityManagerNotSet(), this);
                }
            }
            else
            {
                strategy = endpoint.getMuleContext().getSecurityManager().getEncryptionStrategy(strategyName);
            }
        }
        if (strategy == null)
        {
            throw new InitialisationException(CoreMessages.encryptionStrategyNotSet(), this);
        }
    }
View Full Code Here

        {
            applyInitialisationPolicy();
        }
        catch (Exception e)
        {
            throw new InitialisationException(e, this);
        }
    }
View Full Code Here

        {
            return pool.borrowObject();
        }
        else
        {
            throw new InitialisationException(
                MessageFactory.createStaticMessage("Object pool has not been initialized."), this);
        }
    }
View Full Code Here

            {
                data = IOUtils.getResourceAsString(dataFile, getClass());
            }
            catch (IOException e)
            {
                throw new InitialisationException(e, this);
            }
        }
    }
View Full Code Here

                p.load(url.openStream());
                bootstraps.add(p);
            }
            catch (Exception e1)
            {
                throw new InitialisationException(e1, this);
            }
        }

        // ... and only then merge and process them
        int objectCounter = 1;
        int transformerCounter = 1;
        Properties transformers = new Properties();
        Properties namedObjects = new Properties();
        Properties unnamedObjects = new Properties();

        for (Properties bootstrap : bootstraps)
        {
            for (Map.Entry entry : bootstrap.entrySet())
            {
                final String key = (String) entry.getKey();
                if (key.contains(OBJECT_KEY))
                {
                    String newKey = key.substring(0, key.lastIndexOf(".")) + objectCounter++;
                    unnamedObjects.put(newKey, entry.getValue());
                }
                else if (key.contains(TRANSFORMER_KEY))
                {
                    String newKey = key.substring(0, key.lastIndexOf(".")) + transformerCounter++;
                    transformers.put(newKey, entry.getValue());
                }
                else
                {
                    // we allow arbitrary keys in the registry-bootstrap.properties but since we're
                    // aggregating multiple files here we must make sure that the keys are unique
//                    if (accumulatedProps.getProperty(key) != null)
//                    {
//                        throw new IllegalStateException(
//                                "more than one registry-bootstrap.properties file contains a key " + key);
//                    }
//                    else
                    {
                        namedObjects.put(key, entry.getValue());
                    }
                }
            }
        }

        try
        {
            registerUnnamedObjects(unnamedObjects, context.getRegistry());
            registerTransformers(transformers, context.getRegistry());
            registerObjects(namedObjects, context.getRegistry());
        }
        catch (Exception e1)
        {
            throw new InitialisationException(e1, this);
        }
    }
View Full Code Here

    public void initialise() throws InitialisationException
    {
        if (serviceClass == null && serviceBean == null)
        {
            throw new InitialisationException(CoreMessages.propertiesNotSet("serviceClass or serviceBean"),
                this);
        }
        if (serviceInterface == null)
        {
            throw new InitialisationException(CoreMessages.propertiesNotSet("serviceInterface"), this);
        }

        if (serviceClass != null)
        {
            Object service = null;
            try
            {
                service = ClassUtils.instanciateClass(serviceClass, (Object[]) null);
            }
            catch (Exception e)
            {
                throw new InitialisationException(e, this);
            }
            delegate.setService(service);
        }
        else if (serviceBean != null)
        {
View Full Code Here

            EndpointURI built = builder.build(this.uri, muleContext);
            initialise(built);
        }
        catch (Exception e)
        {
            throw new InitialisationException(e, this);
        }
    }
View Full Code Here

        super.initialise();
        if (jaxbContext == null)
        {
            if(Object.class.equals(getReturnDataType().getType()))
            {
                throw new InitialisationException(CoreMessages.objectIsNull("jaxbContext"), this);
            }
            else
            {
                try
                {
                    jaxbContext = JAXBContext.newInstance(getReturnDataType().getType());
                }
                catch (JAXBException e)
                {
                    throw new InitialisationException(e, this);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.mule.api.lifecycle.InitialisationException

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.