Package org.exolab.jms.persistence

Examples of org.exolab.jms.persistence.DatabaseService


                    dataSource.setDatabaseName(dbPath);
                    connection = dataSource.getConnection();

                } else {
                    Configuration config = ConfigurationReader.read(configPath);
                    DatabaseService dbService = new DatabaseService(config);
                    dbService.start();

                    PersistenceAdapter adapter = dbService.getAdapter();
                    connection = adapter.getConnection();
                }
                IDatabaseConnection dbConnection
                        = new DatabaseConnection(connection);
                IDataSet fullDataSet = dbConnection.createDataSet();
View Full Code Here


     *
     * @throws JMSException for any persistence error
     */
    public void add() throws JMSException {
        try {
            DatabaseService service = DatabaseService.getInstance();
            Connection connection = service.getConnection();
            service.getAdapter().addMessageHandle(connection, this);
        } catch (PersistenceException exception) {
            final String msg = "Failed to make handle persistent";
            _log.error(msg, exception);
            throw new JMSException(msg + ": " + exception.getMessage());
        }
View Full Code Here

     *
     * @throws JMSException for any persistence error
     */
    public void update() throws JMSException {
        try {
            DatabaseService service = DatabaseService.getInstance();
            Connection connection = service.getConnection();
            service.getAdapter().updateMessageHandle(connection, this);
        } catch (PersistenceException exception) {
            final String msg = "Failed to update persistent handle";
            _log.error(msg, exception);
            throw new JMSException(msg + ": " + exception.getMessage());
        }
View Full Code Here

     *
     * @throws JMSException for any error
     */
    public void destroy() throws JMSException {
        try {
            DatabaseService service = DatabaseService.getInstance();
            Connection connection = service.getConnection();
            service.getAdapter().removeMessageHandle(connection, this);
        } catch (PersistenceException exception) {
            final String msg = "Failed to destroy persistent handle";
            _log.error(msg, exception);
            throw new JMSException(msg + ": " + exception.getMessage());
        }
View Full Code Here

            throw new IllegalArgumentException("Argument 'config' is null");
        }
        if (database == null) {
            throw new IllegalArgumentException("Argument 'database' is null");
        }
        _database = new DatabaseService(config);
        _dataSource = new EmbeddedDataSource();
        _dataSource.setDatabaseName(database);
        _dataSource.setCreateDatabase("create");
        init(config, delete);
    }
View Full Code Here

        // register this with the available caches. Note that the consumer
        // may begin receiving messages immediately.
        init();

        DatabaseService service = DatabaseService.getInstance();
        Connection connection = service.getConnection();

        // remove expired messages
        service.getAdapter().removeExpiredMessageHandles(connection, _name);

        TopicDestinationCache cache = (TopicDestinationCache)
                getDestinationManager().getDestinationCache(topic);
        // @todo - broken for wildcard subscriptions
        // getMessageHandles() needs to return all handles for a given
View Full Code Here

     *
     * @throws JMSException for any persistence error
     */
    public void add() throws JMSException {
        try {
            DatabaseService service = DatabaseService.getInstance();
            Connection connection = service.getConnection();
            service.getAdapter().addMessageHandle(connection, this);
        } catch (PersistenceException exception) {
            final String msg = "Failed to make handle persistent";
            _log.error(msg, exception);
            throw new JMSException(msg + ": " + exception.getMessage());
        }
View Full Code Here

     *
     * @throws JMSException for any persistence error
     */
    public void update() throws JMSException {
        try {
            DatabaseService service = DatabaseService.getInstance();
            Connection connection = service.getConnection();
            service.getAdapter().updateMessageHandle(connection, this);
        } catch (PersistenceException exception) {
            final String msg = "Failed to update persistent handle";
            _log.error(msg, exception);
            throw new JMSException(msg + ": " + exception.getMessage());
        }
View Full Code Here

     * @throws JMSException for any error
     */
    public void destroy() throws JMSException {
        if (_persistent) {
            try {
                DatabaseService service = DatabaseService.getInstance();
                Connection connection = service.getConnection();
                service.getAdapter().removeMessageHandle(connection, this);
            } catch (PersistenceException exception) {
                final String msg = "Failed to destroy persistent handle";
                _log.error(msg, exception);
                throw new JMSException(msg + ": " + exception.getMessage());
            }
View Full Code Here

     * @return a list of {@link MessageHandle} instances
     * @throws JMSException         for any JMS error
     */
    public List getDurableMessageHandles(String name)
            throws JMSException, PersistenceException {
        DatabaseService service = DatabaseService.getInstance();
        Connection connection = service.getConnection();
        Vector handles = service.getAdapter().getMessageHandles(
                connection, getDestination(), name);
        List result = new ArrayList(handles.size());

        MessageCache cache = getMessageCache();

View Full Code Here

TOP

Related Classes of org.exolab.jms.persistence.DatabaseService

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.