⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jmssessionstubimpl.java

📁 一个java方面的消息订阅发送的源码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:

    /**
     * Remove a message consumer.
     *
     * @param consumerId the identity of the consumer to remove
     * @throws JMSException for any JMS error
     */
    public void removeConsumer(long consumerId) throws JMSException {
        _session.removeConsumer(consumerId);
    }

    /**
     * Unsubscribe a durable subscription.
     *
     * @param name the name used to identify the subscription
     * @throws JMSException for any JMS error
     */
    public void unsubscribe(String name) throws JMSException {
        _session.unsubscribe(name);
    }

    /**
     * Start message delivery to this session.
     *
     * @throws JMSException for any JMS error
     */
    public void start() throws JMSException {
        _session.start();
    }

    /**
     * Stop message delivery to this session.
     *
     * @throws JMSException for any JMS error
     */
    public void stop() throws JMSException {
        _session.stop();
    }

    /**
     * Enable or disable asynchronous message delivery for a particular
     * consumer.
     *
     * @param consumerId the consumer identifier
     * @param enable     true to enable; false to disable
     * @throws JMSException for any JMS error
     */
    public void enableAsynchronousDelivery(long consumerId, boolean enable)
            throws JMSException {
        _session.enableAsynchronousDelivery(consumerId, enable);
    }

    /**
     * Recover the session. This means all unacknowledged messages are resent
     * with the redelivery flag set
     *
     * @throws JMSException if the session cannot be recovered
     */
    public void recover() throws JMSException {
        _session.recover();
    }

    /**
     * Commit the session.
     *
     * @throws JMSException if the session cannot be committed
     */
    public void commit() throws JMSException {
        _session.commit();
    }

    /**
     * Rollback the session.
     *
     * @throws JMSException if the session cannot be rolled back
     */
    public void rollback() throws JMSException {
        _session.rollback();
    }

    /**
     * Start work on behalf of a transaction branch specified in xid. If TMJOIN
     * is specified, the start is for joining a transaction previously seen by
     * the resource manager.
     *
     * @param xid   the xa transaction identity
     * @param flags One of TMNOFLAGS, TMJOIN, or TMRESUME
     * @throws XAException if there is a problem completing the call
     */
    public void start(Xid xid, int flags) throws XAException {
        _session.start(xid, flags);
    }

    /**
     * Ask the resource manager to prepare for a transaction commit of the
     * transaction specified in xid.
     *
     * @param xid the xa transaction identity
     * @return XA_RDONLY or XA_OK
     * @throws XAException if there is a problem completing the call
     */
    public int prepare(Xid xid) throws XAException {
        return _session.prepare(xid);
    }

    /**
     * Commits an XA transaction that is in progress.
     *
     * @param xid      the xa transaction identity
     * @param onePhase true if it is a one phase commit
     * @throws XAException if there is a problem completing the call
     */
    public void commit(Xid xid, boolean onePhase) throws XAException {
        _session.commit(xid, onePhase);
    }

    /**
     * Ends the work performed on behalf of a transaction branch. The resource
     * manager disassociates the XA resource from the transaction branch
     * specified and let the transaction be completedCommits an XA transaction
     * that is in progress.
     *
     * @param xid   the xa transaction identity
     * @param flags one of TMSUCCESS, TMFAIL, or TMSUSPEND
     * @throws XAException if there is a problem completing the call
     */
    public void end(Xid xid, int flags) throws XAException {
        _session.end(xid, flags);
    }

    /**
     * Tell the resource manager to forget about a heuristically completed
     * transaction branch.
     *
     * @param xid the xa transaction identity
     * @throws XAException if there is a problem completing the call
     */
    public void forget(Xid xid) throws XAException {
        _session.forget(xid);
    }

    /**
     * Inform the resource manager to roll back work done on behalf of a
     * transaction branch.
     *
     * @param xid the xa transaction identity
     * @throws XAException if there is a problem completing the call
     */
    public void rollback(Xid xid) throws XAException {
        _session.rollback(xid);
    }

    /**
     * Obtain a list of prepared transaction branches from a resource manager.
     * The transaction manager calls this method during recovery to obtain the
     * list of transaction branches that are currently in prepared or
     * heuristically completed states.
     *
     * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
     * @return the set of Xids to recover
     * @throws XAException - if there is a problem completing the call
     */
    public Xid[] recover(int flag) throws XAException {
        return _session.recover(flag);
    }

    /**
     * Return the transaction timeout for this instance of the resource
     * manager.
     *
     * @return the timeout in seconds
     * @throws XAException if there is a problem completing the call
     */
    public int getTransactionTimeout() throws XAException {
        return _session.getTransactionTimeout();
    }

    /**
     * Set the current transaction timeout value for this XAResource instance.
     *
     * @param seconds timeout in seconds
     * @return if the new transaction timeout was accepted
     * @throws XAException if there is a problem completing the call
     */
    public boolean setTransactionTimeout(int seconds) throws XAException {
        return _session.setTransactionTimeout(seconds);
    }

    /**
     * Return the identity of the associated resource manager.
     *
     * @return the identity of the resource manager
     * @throws XAException if there is a problem completing the call
     */
    public String getResourceManagerId() throws XAException {
        return _session.getResourceManagerId();
    }

    /**
     * Set the message listener for this session.
     *
     * @param listener the message listener
     */
    public void setMessageListener(JmsMessageListener listener) {
        _listener = listener;
    }

    /**
     * Deliver a message.
     *
     * @param message the message to deliver
     * @throws RemoteException if the message can't be delivered
     */
    public void onMessage(Message message) throws RemoteException {
        _listener.onMessage(message);
    }

    /**
     * Inform the session that there is a message available for a particular
     * consumer.
     *
     * @param consumerId the consumer identity
     * @throws RemoteException if the session can't be notified
     */
    public void onMessageAvailable(long consumerId) throws RemoteException {
        _listener.onMessageAvailable(consumerId);
    }

    /**
     * Rethrows a <code>RemoteException</code> as a <code>JMSException</code>.
     *
     * @param exception the exception to rethrow
     * @throws JMSException the rethrown exception
     */
    private void rethrow(RemoteException exception) throws JMSException {
        JMSException error = new JMSException(exception.getMessage());
        error.setLinkedException(exception);
        throw error;
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -