Package org.exolab.jms.persistence

Examples of org.exolab.jms.persistence.DatabaseService


            // 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

    public OfflineConnection(Component parent, Configuration config)
            throws OfflineConnectionException {
        try {
            if (_instance == null) {
                _parent = parent;
                _database = new DatabaseService(config);
                _database.start();

                DatabaseConfiguration dbconfig =
                        config.getDatabaseConfiguration();
View Full Code Here

     */
    protected void init() throws JMSException {
        JmsDestination queue = getDestination();

        List handles;
        DatabaseService service = null;
        try {
            service = DatabaseService.getInstance();
            Connection connection = service.getConnection();
            service.getAdapter().removeExpiredMessageHandles(connection,
                    queue.getName());
            handles = service.getAdapter().getMessageHandles(connection, queue,
                    queue.getName());
        } catch (PersistenceException exception) {
            _log.error(exception, exception);
            try {
                if (service != null) {
                    service.rollback();
                }
            } catch (PersistenceException error) {
                _log.error(error, error);
            }
            throw new JMSException(exception.getMessage());
View Full Code Here

    public DataLoader(Configuration config) throws ServiceException {
        DBTool tool = new DBTool(config);
        tool.drop();
        tool.create();

        _service = new DatabaseService(config);
        _service.start();
        _adapter = _service.getAdapter();
        _connection = _service.getConnection();
        _topic1.setPersistent(true);
        _queue1.setPersistent(true);
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.