Package org.exolab.jms.persistence

Examples of org.exolab.jms.persistence.DatabaseService$State


     *
     * @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

            // if the message is not cached then try and retrieve it from the
            // database and cache it.
            if (message == null) {
                // fault in at least the next message from the database
                try {
                    DatabaseService service = DatabaseService.getInstance();
                    PersistenceAdapter adapter = service.getAdapter();
                    Connection connection = service.getConnection();
                    message = adapter.getMessage(connection, messageId);
                } catch (PersistenceException exception) {
                    final String msg = "Failed to retrieve message";
                    _log.error(msg, exception);
                    throw new JMSException(msg + ": " + exception.getMessage());
View Full Code Here

    public synchronized void destroy(MessageRef reference) throws JMSException {
        final String messageId = reference.getMessageId();
        if (_references.remove(messageId) != null) {
            if (reference.isPersistent()) {
                try {
                    DatabaseService service = DatabaseService.getInstance();
                    Connection connection = service.getConnection();
                    PersistenceAdapter adapter = service.getAdapter();
                    adapter.removeMessage(connection, messageId);
                } catch (Exception exception) {
                    _log.error("Failed to remove message", exception);
                    throw new JMSException("Failed to remove message: "
                            + exception.getMessage());
View Full Code Here

TOP

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

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.