Package org.mule.api.lifecycle

Examples of org.mule.api.lifecycle.InitialisationException


    public void initialise() throws InitialisationException
    {
        super.initialise();
        if (jaxbContext == null)
        {
            throw new InitialisationException(CoreMessages.objectIsNull("jaxbContext"), this);
        }
    }
View Full Code Here


            XStream xStreamInstance = getXStream();
            xStreamInstance.setClassLoader(Thread.currentThread().getContextClassLoader());
        }
        catch (TransformerException e)
        {
            throw new InitialisationException(e, this);
        }
    }
View Full Code Here

            {
               muleContext.registerListener(l);
            }
            catch (NotificationException e)
            {
                throw new InitialisationException(e, this);
            }
            listeners.add(l);
        }
        if (!ignoreModelNotifications)
        {
            ServerNotificationListener<ModelNotification> l
                = new ModelNotificationListener<ModelNotification>()
            {
                public void onNotification(ModelNotification notification)
                {
                    logEvent(notification);
                }
            };
            try
            {
               muleContext.registerListener(l);
            }
            catch (NotificationException e)
            {
                throw new InitialisationException(e, this);
            }
            listeners.add(l);
        }
        if (!ignoreComponentNotifications)
        {
            ServerNotificationListener<ServiceNotification> l
                = new ServiceNotificationListener<ServiceNotification>()
            {
                public void onNotification(ServiceNotification notification)
                {
                    logEvent(notification);
                }
            };
            try
            {
               muleContext.registerListener(l);
            }
            catch (NotificationException e)
            {
                throw new InitialisationException(e, this);
            }
            listeners.add(l);
        }
        if (!ignoreSecurityNotifications)
        {
            ServerNotificationListener<SecurityNotification> l
                = new SecurityNotificationListener<SecurityNotification>()
            {
                public void onNotification(SecurityNotification notification)
                {
                    logEvent(notification);
                }
            };
            try
            {
               muleContext.registerListener(l);
            }
            catch (NotificationException e)
            {
                throw new InitialisationException(e, this);
            }
            listeners.add(l);
        }

        if (!ignoreManagementNotifications)
        {
            ServerNotificationListener<ManagementNotification> l
                = new ManagementNotificationListener<ManagementNotification>()
            {
                public void onNotification(ManagementNotification notification)
                {
                    logEvent(notification);
                }
            };
            try
            {
               muleContext.registerListener(l);
            }
            catch (NotificationException e)
            {
                throw new InitialisationException(e, this);
            }
            listeners.add(l);
        }

        if (!ignoreCustomNotifications)
        {
            ServerNotificationListener l = new CustomNotificationListener()
            {
                public void onNotification(ServerNotification notification)
                {
                    logEvent(notification);
                }
            };
            try
            {
               muleContext.registerListener(l);
            }
            catch (NotificationException e)
            {
                throw new InitialisationException(e, this);
            }
            listeners.add(l);
        }

        if (!ignoreConnectionNotifications)
        {
            ServerNotificationListener<ConnectionNotification> l
                = new ConnectionNotificationListener<ConnectionNotification>()
            {
                public void onNotification(ConnectionNotification notification)
                {
                    logEvent(notification);
                }
            };
            try
            {
               muleContext.registerListener(l);
            }
            catch (NotificationException e)
            {
                throw new InitialisationException(e, this);
            }
            listeners.add(l);
        }

        if (!ignoreMessageNotifications && !ignoreEndpointMessageNotifications)
        {
            ServerNotificationListener<EndpointMessageNotification> l =
                new EndpointMessageNotificationListener<EndpointMessageNotification>()
            {
                public void onNotification(EndpointMessageNotification notification)
                {
                    logEvent(notification);
                }
            };
            try
            {
               muleContext.registerListener(l);
            }
            catch (NotificationException e)
            {
                throw new InitialisationException(e, this);
            }
            listeners.add(l);
        }
       
        if (!ignoreMessageNotifications && !ignoreComponentMessageNotifications)
        {
            ServerNotificationListener<ComponentMessageNotification> l =
                new ComponentMessageNotificationListener<ComponentMessageNotification>()
            {
                public void onNotification(ComponentMessageNotification notification)
                {
                    logEvent(notification);
                }
            };
            try
            {
               muleContext.registerListener(l);
            }
            catch (NotificationException e)
            {
                throw new InitialisationException(e, this);
            }
            listeners.add(l);
        }

    }
View Full Code Here

        // first see if we're logging notifications to an endpoint
        try
        {
            if (endpoint == null)
            {
                throw new InitialisationException(CoreMessages.propertiesNotSet("endpoint"), this);
            }
            // Create a session for sending notifications
            session = new DefaultMuleSession(muleContext);
        }
        catch (Exception e)
        {
            throw new InitialisationException(e, this);
        }
    }
View Full Code Here

    {
        super.initialise();

        if (expression == null)
        {
            throw new InitialisationException(
                MessageFactory.createStaticMessage("An expression must be supplied to the StandardXPathExtractor"),
                this);
        }

        final Map<String, String> prefixToNamespaceMap = this.prefixToNamespaceMap;
View Full Code Here

       
        try
        {
            if (name == null)
            {
                throw new InitialisationException(
                    MessageFactory.createStaticMessage("Service has no name to identify it"), this);
            }
        }
        catch (Throwable e)
        {
            throw new InitialisationException(CoreMessages.objectFailedToInitialise("Service Queue"), e, this);
        }
        super.doInitialise();
    }
View Full Code Here

    public void start() throws MuleException
    {
        if (serverUri == null)
        {
            throw new InitialisationException(MessageFactory.createStaticMessage("serverUri has not been set, this agent has not been initialized properly."), this);
        }
       
        URI uri;
        try
        {
            uri = new URI(serverUri);
        }
        catch (URISyntaxException e)
        {
            throw new InitialisationException(e, this);
        }

        if (rmiRegistry == null)
        {
            try
            {
                if (createRegistry)
                {
                    try
                    {
                        rmiRegistry = LocateRegistry.createRegistry(uri.getPort());
                    }
                    catch (ExportException e)
                    {
                        logger.info("Registry on " + serverUri
                                    + " already bound. Attempting to use that instead");
                        rmiRegistry = LocateRegistry.getRegistry(uri.getHost(), uri.getPort());
                    }
                }
                else
                {
                    rmiRegistry = LocateRegistry.getRegistry(uri.getHost(), uri.getPort());
                }
            }
            catch (RemoteException e)
            {
                throw new InitialisationException(e, this);
            }
        }
    }
View Full Code Here

        }

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

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

            profilerName = jmxSupport.getObjectName(jmxSupport.getDomainName(muleContext) + ":" + PROFILER_OBJECT_NAME);

            // unregister existing YourKit MBean first if required
            unregisterMBeansIfNecessary();
            mBeanServer.registerMBean(new YourKitProfilerService(), profilerName);
        }
        catch(Exception e)
        {
            throw new InitialisationException(CoreMessages.failedToStart(this.getName()), e, this);
        }
    }
View Full Code Here

            muleContext.getRegistry().applyProcessorsAndLifecycle(objectToString);
            muleContext.getRegistry().applyProcessorsAndLifecycle(objectToByteArray);
        }
        catch (MuleException e)
        {
            throw new InitialisationException(e, this);
        }
    }
View Full Code Here

            {
                jndiContext = createInitialContext();
            }
            catch (NamingException 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.