Package org.mule.api.lifecycle

Examples of org.mule.api.lifecycle.InitialisationException


                    moveTo, moveToPattern, new Long(polling)});

        }
        catch (Exception e)
        {
            throw new InitialisationException(
                    CoreMessages.failedToCreateObjectWith("Message Receiver",
                            serviceDescriptor), e, this);
        }
    }
View Full Code Here


            //TODO RM* this currently does nothing!!!
            registry.unregisterAgent(name);
        }
        catch (MuleException e)
        {
            throw new InitialisationException(e, this);
        }
    }
View Full Code Here

        try
        {
            List<?> servers = MBeanServerFactory.findMBeanServer(null);
            if (servers.isEmpty())
            {
                throw new InitialisationException(ManagementMessages.noMBeanServerAvailable(), this);
            }

            mBeanServer = (MBeanServer) servers.get(0);

            /*
              Perform an extra check ourselves. If 'wrapper.native_library' property has
              not been set, which is the case for embedded scenarios, don't even try to
              construct the wrapper manager bean, as it performs a number of checks internally
              and outputs a very verbose warning.
            */
            boolean launchedByWrapper;
            if (System.getProperty(WRAPPER_SYSTEM_PROPERTY_NAME) == null)
            {
                launchedByWrapper = false;
            }
            // Check if an external process registered a wrapper MBean under default name.
            else if (mBeanServer.isRegistered(jmxSupport.getObjectName(DEFAULT_WRAPPER_MBEAN_NAME)))
            {
                logger.info("Mule is embedded in a container already launched by a wrapper." +
                            "Duplicates will not be registered. Use the " + DEFAULT_WRAPPER_MBEAN_NAME + " MBean " +
                            "instead for control.");
                unregisterMeQuietly();
                return;
            }
            else
            {
                lazyInitWrapperManager();
                launchedByWrapper = ((WrapperManagerMBean) wrapperManagerRef.get()).isControlledByNativeWrapper();
            }

            if (!launchedByWrapper)
            {
                logger.info("This JVM hasn't been launched by the wrapper, the agent will not run.");
                unregisterMeQuietly();
                return;
            }

            final boolean containerMode = muleContext.getConfiguration().isContainerMode();
            if (containerMode)
            {
                // container mode, register mbean under Mule domain, no duplicates under each app's domain
                wrapperName = jmxSupport.getObjectName(JmxSupport.DEFAULT_JMX_DOMAIN_PREFIX + ":" + WRAPPER_JMX_NAME);
                if (mBeanServer.isRegistered(wrapperName))
                {
                    // ignore duplicate invocations when running in Mule container mode
                    return;
                }
            }
            else
            {
                // embedded case, use Mule's single domain
                wrapperName = jmxSupport.getObjectName(jmxSupport.getDomainName(muleContext) + ":" + WRAPPER_JMX_NAME);
            }

            unregisterMBeansIfNecessary();
            mBeanServer.registerMBean(wrapperManagerRef.get(), wrapperName);
        }
        catch (InitialisationException iex)
        {
            // rethrow
            throw iex;
        }
        catch (Exception e)
        {
            throw new InitialisationException(CoreMessages.failedToStart("wrapper agent"), e, this);
        }
    }
View Full Code Here

                mBeanServer.registerMBean(mbean, listenerObjectName);
            }
        }
        catch (Exception e)
        {
            throw new InitialisationException(CoreMessages.failedToStart("JMX Server Notification Agent"), e, this);
        }
    }
View Full Code Here

    @Override
    protected void doInitialise() throws InitialisationException
    {
        if (!isSupportJms102bSpec() && getSpecification().equals(JmsConstants.JMS_SPECIFICATION_102B))
        {
            throw new InitialisationException(JmsMessages.errorMuleMqJmsSpecification(), this);
        }
        super.doInitialise();
    }
View Full Code Here

                }
            });
        }
        catch (Throwable t)
        {
            throw new InitialisationException(t, this);
        }
    }
View Full Code Here

     */
    public void initialise() throws InitialisationException
    {
        if (txManager == null && StringUtils.isEmpty(StringUtils.trim(jndiName)))
        {
            throw new InitialisationException(CoreMessages.propertiesNotSet("jndiName"), this);
        }

        try
        {
            if (context == null)
            {
                context = JndiContextHelper.initialise(getEnvironment());
            }
        }
        catch (NamingException e)
        {
            throw new InitialisationException(CoreMessages.failedToCreate("Jndi context"),
                    e, this);
        }
    }
View Full Code Here

            }
            muleContext.registerListener(this);
        }
        catch (Exception e)
        {
            throw new InitialisationException(e, this);
        }
        // TODO DO: call registerSupportedProtocol if axisTransportProtocols are set from external?

        if (clientProvider == null)
        {
            clientProvider = createAxisProvider(clientConfig);
        }
        else
        {
            if (!DEFAULT_MULE_AXIS_CLIENT_CONFIG.equals(clientConfig))
            {
                logger.warn(AxisMessages.clientProviderAndClientConfigConfigured());
            }
        }

        if (axis == null)
        {
            if (serverProvider == null)
            {
                serverProvider = this.createAxisProvider(serverConfig);
            }
            else
            {
                if (!DEFAULT_MULE_AXIS_SERVER_CONFIG.equals(serverConfig))
                {
                    logger.warn(AxisMessages.serverProviderAndServerConfigConfigured());
                }
            }

            // Create the AxisServer
            axis = new AxisServer(serverProvider);
            // principle of least surprise: doAutoTypes only has effect on our self-configured AxisServer
            axis.setOption("axis.doAutoTypes", Boolean.valueOf(doAutoTypes));
        }

        // Register the Mule service serverProvider
        WSDDProvider.registerProvider(QNAME_MULE_PROVIDER, new WSDDJavaMuleProvider(this));

        try
        {
            registerTransportTypes();
        }
        catch (ClassNotFoundException e)
        {
            throw new InitialisationException(
                    CoreMessages.cannotLoadFromClasspath(e.getMessage()), e, this);
        }

        // Register all our UrlStreamHandlers here so they can be resolved. This is necessary
        // to make Mule work in situations where modification of system properties at runtime
        // is not reliable, e.g. when running in maven's surefire test executor.
        MuleUrlStreamHandlerFactory.registerHandler("jms", new org.mule.transport.soap.axis.transport.jms.Handler());
        MuleUrlStreamHandlerFactory.registerHandler("pop3", new org.mule.transport.soap.axis.transport.pop3.Handler());
        MuleUrlStreamHandlerFactory.registerHandler("smtp", new org.mule.transport.soap.axis.transport.smtp.Handler());
        MuleUrlStreamHandlerFactory.registerHandler("vm", new org.mule.transport.soap.axis.transport.vm.Handler());

        try
        {
            registerTypes((TypeMappingRegistryImpl) axis.getTypeMappingRegistry(), beanTypes);
        }
        catch (ClassNotFoundException e)
        {
            throw new InitialisationException(e, this);
        }
    }
View Full Code Here

            unregisterMBeansIfNecessary();
            mBeanServer.registerMBean(adaptor, adaptorName);
        }
        catch (Exception e)
        {
            throw new InitialisationException(CoreMessages.failedToStart("mx4j agent"), e, this);
        }
    }
View Full Code Here

    public void start() throws MuleException
    {
        if (mBeanServer == null)
        {
            throw new InitialisationException(MessageFactory.createStaticMessage("mBeanServer has not yet been created"), this);
        }
       
        try
        {
            mBeanServer.invoke(adaptorName, "start", null, null);
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.