Package org.exolab.jms.service

Examples of org.exolab.jms.service.ServiceException


        // bind each persistent destination in JNDI
        Context context;
        try {
            context = _names.getInitialContext();
        } catch (NamingException exception) {
            throw new ServiceException("Failed to get initial JNDI context",
                                       exception);
        }

        List destinations;
        try {
            destinations = _destinations.getDestinations();
        } catch (JMSException exception) {
            throw new ServiceException("Failed to get destinations",
                                       exception);
        }

        for (Iterator i = destinations.iterator(); i.hasNext();) {
            JmsDestination destination = (JmsDestination) i.next();
            if (destination.getPersistent()) {
                try {
                    ContextHelper.rebind(context, destination.getName(),
                                         destination);
                } catch (NamingException exception) {
                    throw new ServiceException("Failed to add destination "
                                               + destination.getName()
                                               + " to JNDI", exception);
                }
            }
        }
View Full Code Here


                addToUserCache(user);
            }
        } catch (Exception exception) {
            _log.error("Failed to initialise UserManager", exception);
            rollback();
            throw new ServiceException(exception);
        }

        registerConfiguredUsers();
    }
View Full Code Here

     *
     * @throws ServiceException if the service fails to start
     */
    protected void doStart() throws ServiceException {
        if (_destinations == null) {
            throw new ServiceException(
                    "Cannot start service: DestinationManager not initialised");
        }
    }
View Full Code Here

                // no-op
            }
            throw exception;
        } catch (Exception exception) {
            // rethrow as an appropriate exception
            throw new ServiceException("Failed to start the DatabaseService",
                    exception);
        }
    }
View Full Code Here

    protected void doStart() throws ServiceException {
        try {
            Context context = _names.getInitialContext();
            initConnectors(context);
        } catch (NamingException exception) {
            throw new ServiceException(exception.getMessage(), exception);
        }
    }
View Full Code Here

        String className = resource.getServer().getImplementationClass();
        Class clazz;
        try {
            clazz = Class.forName(className);
        } catch (ClassNotFoundException exception) {
            throw new ServiceException("Failed to load class " + className);
        }

        if (!ServerConnector.class.isAssignableFrom(clazz)) {
            throw new ServiceException(
                    "Class " + className
                    + " does not implement ServerConnector");
        }
        try {
            SchemeType scheme = connector.getScheme();
            Constructor ctor = clazz.getConstructor(new Class[]{
                SchemeType.class, Configuration.class,
                Authenticator.class, ServerConnectionFactory.class,
                AdminConnectionManager.class, NameService.class,
                ThreadPoolFactory.class});
            server = (ServerConnector) ctor.newInstance(new Object[]{
                scheme, _config, _authenticator, _factory, _manager, _names,
                _threads});
        } catch (NoSuchMethodException ignore) {
            // fall back to the default constructor
            try {
                server = (ServerConnector) clazz.newInstance();
            } catch (Exception exception) {
                throw new ServiceException(exception.getMessage(), exception);
            }
        } catch (Exception exception) {
            throw new ServiceException(exception.getMessage(), exception);
        }

        _log.debug("Created an instance of " + className
                   + " as a server interface");
View Full Code Here

     *
     * @throws ServiceException if the service fails to start
     */
    protected void doStart() throws ServiceException {
        if (_consumers == null) {
            throw new ServiceException(
                    "ConsumerManager hasn't been initialised");
        }
        init();
        _collector.register(this);
    }
View Full Code Here

            iter = _database.getAdapter().getAllDestinations(connection);
            _database.commit();
        } catch (PersistenceException exception) {
            _log.error(exception, exception);
            rollback();
            throw new ServiceException("Failed to get destinations", exception);
        }

        while (iter.hasMoreElements()) {
            // add each destination to the cache
            JmsDestination dest = (JmsDestination) iter.nextElement();
View Full Code Here

                }
            }
            _database.commit();
        } catch (Exception exception) {
            rollback();
            throw new ServiceException("Failed to initialise ConsumerManager",
                                       exception);
        }
    }
View Full Code Here

TOP

Related Classes of org.exolab.jms.service.ServiceException

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.