Package org.mule.api.lifecycle

Examples of org.mule.api.lifecycle.InitialisationException


            adaptorName = new ObjectName("Adaptor:class=" + adaptor.getClass().getName());
            mBeanServer.registerMBean(adaptor, adaptorName);
        }
        catch (Exception e)
        {
            throw new InitialisationException(CoreMessages.failedToStart("Jdmk Agent"), e, this);
        }
    }
View Full Code Here


            logger.debug("Salt is not set. Using default salt");
        }

        if (password == null)
        {
            throw new InitialisationException(CoreMessages.objectIsNull("Password"), this);
        }
        super.initialise();
    }
View Full Code Here

        {
            chain = chainBuilder.build();
        }
        catch (MuleException e)
        {
            throw new InitialisationException(e, this);
        }
    }
View Full Code Here

        {
            throw e;
        }
        catch (LifecycleException e)
        {
            throw new InitialisationException(e, (Initialisable) object);
        }
    }
View Full Code Here

                    singletonComponentLifecycleAdapter = createLifecycleAdaptor();
                }
            }
            catch (Exception e)
            {
                throw new InitialisationException(
                    MessageFactory.createStaticMessage("Unable to create instance of POJO service"), e, this);

            }
            // On all calls, start if not started.
            if (!singletonComponentLifecycleAdapter.isStarted())
View Full Code Here

        if (argumentTypes != null)
        {
            method = ClassUtils.getMethod(object.getClass(), methodName, argumentTypes);
            if (method == null)
            {
                throw new InitialisationException(CoreMessages.methodWithParamsNotFoundOnObject(methodName,
                    argumentTypes, object.getClass()), this);
            }
        }
        else
        {
            List<Method> matchingMethods = new ArrayList<Method>();
            int argSize = arguments != null ? arguments.size() : 0;
            for (Method methodCandidate : object.getClass().getMethods())
            {
                if (methodCandidate.getName().equals(methodName)
                    && methodCandidate.getParameterTypes().length == argSize)
                    matchingMethods.add(methodCandidate);
            }
            if (matchingMethods.size() == 1)
            {
                method = matchingMethods.get(0);
                argumentTypes = method.getParameterTypes();
            }
            else
            {
                throw new InitialisationException(CoreMessages.methodWithNumParamsNotFoundOnObject(
                    methodName, arguments.size(), object), this);
            }
        }

        if (logger.isDebugEnabled())
View Full Code Here

        {
            object = muleContext.getRegistry().lookupObject(objectType);
        }
        catch (RegistrationException e)
        {
            throw new InitialisationException(
                CoreMessages.initialisationFailure(String.format(
                    "Muliple instances of '%s' were found in the registry so you need to configure a specific instance",
                    objectType)), this);
        }
        if (object == null)
        {
            throw new InitialisationException(CoreMessages.initialisationFailure(String.format(
                "No instance of '%s' was found in the registry", objectType)), this);

        }
    }
View Full Code Here

        {
            throw e;
        }
        catch (LifecycleException e)
        {
            throw new InitialisationException(e, (Initialisable) object);
        }
    }
View Full Code Here

    @Override
    public void initialise() throws InitialisationException
    {
        if (routes.isEmpty())
        {
            throw new InitialisationException(
                MessageFactory.createStaticMessage("One message processor must be configured within UntilSuccessful."),
                this);
        }

        if (routes.size() > 1)
        {
            throw new InitialisationException(
                MessageFactory.createStaticMessage("Only one message processor is allowed within UntilSuccessful."
                                                   + " Use a Processor Chain to group several message processors into one."),
                this);
        }

        if (objectStore == null)
        {
            throw new InitialisationException(
                MessageFactory.createStaticMessage("A ListableObjectStore must be configured on UntilSuccessful."),
                this);
        }

        super.initialise();

        if (dlqEndpointBuilder != null)
        {
            try
            {
                dlqEndpoint = dlqEndpointBuilder.buildOutboundEndpoint();
            }
            catch (EndpointException ee)
            {
                throw new InitialisationException(
                    MessageFactory.createStaticMessage("Invalid DQL endpoint builder: " + dlqEndpointBuilder),
                    ee, this);
            }
        }

        if (failureExpression != null)
        {
            failureExpressionFilter = new ExpressionFilter(failureExpression);
        }
        else
        {
            failureExpressionFilter = new ExpressionFilter("exception-type:");
        }
        failureExpressionFilter.setMuleContext(muleContext);

        if ((ackExpression != null) && (!muleContext.getExpressionManager().isExpression(ackExpression)))
        {
            throw new InitialisationException(MessageFactory.createStaticMessage("Invalid ackExpression: "
                                                                                 + ackExpression), this);
        }

        eventKeyPrefix = flowConstruct.getName() + "@" + muleContext.getConfiguration().getClusterId() + ":";
    }
View Full Code Here

    public final void initialise() throws InitialisationException
    {
        if (flowConstruct == null)
        {
            throw new InitialisationException(
                MessageFactory.createStaticMessage("Component has not been initialized properly, no flow constuct."),
                this);
        }

        lifecycleManager.fireInitialisePhase(new LifecycleCallback<Component>()
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.