• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java Discharge类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.apache.qpid.proton.amqp.transaction.Discharge的典型用法代码示例。如果您正苦于以下问题:Java Discharge类的具体用法?Java Discharge怎么用?Java Discharge使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

Discharge类属于org.apache.qpid.proton.amqp.transaction包,在下文中一共展示了Discharge类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: newInstance

点赞 3

import org.apache.qpid.proton.amqp.transaction.Discharge; //导入依赖的package包/类
public Discharge newInstance(Object described)
{
    List l = (List) described;

    Discharge o = new Discharge();

    if(l.isEmpty())
    {
        throw new DecodeException("The txn-id field cannot be omitted");
    }

    switch(2 - l.size())
    {

        case 0:
            o.setFail( (Boolean) l.get( 1 ) );
        case 1:
            o.setTxnId( (Binary) l.get( 0 ) );
    }


    return o;
}
 

开发者ID:apache,
项目名称:qpid-proton-j,
代码行数:24,
代码来源:DischargeType.java

示例2: commit

点赞 3

import org.apache.qpid.proton.amqp.transaction.Discharge; //导入依赖的package包/类
public void commit(AsyncResult<Void> request) throws Exception {
    if (current == null) {
        throw new IllegalStateException("Rollback called with no active Transaction.");
    }

    preCommit();

    Message message = session.getMessageFactory().createMessage();
    Discharge discharge = new Discharge();
    discharge.setFail(false);
    discharge.setTxnId((Binary) current.getProviderHint());
    message.setBody(new AmqpValue(discharge));

    pendingDelivery = endpoint.delivery(tagGenerator.getNextTag());
    pendingDelivery.setContext(COMMIT_MARKER);
    pendingRequest = request;

    sendTxCommand(message);
}
 

开发者ID:fusesource,
项目名称:hawtjms,
代码行数:20,
代码来源:AmqpTransactionContext.java

示例3: rollback

点赞 3

import org.apache.qpid.proton.amqp.transaction.Discharge; //导入依赖的package包/类
public void rollback(AsyncResult<Void> request) throws Exception {
    if (current == null) {
        throw new IllegalStateException("Rollback called with no active Transaction.");
    }

    preRollback();

    Message message = session.getMessageFactory().createMessage();
    Discharge discharge = new Discharge();
    discharge.setFail(true);
    discharge.setTxnId((Binary) current.getProviderHint());
    message.setBody(new AmqpValue(discharge));

    pendingDelivery = endpoint.delivery(tagGenerator.getNextTag());
    pendingDelivery.setContext(ROLLBACK_MARKER);
    pendingRequest = request;

    sendTxCommand(message);
}
 

开发者ID:fusesource,
项目名称:hawtjms,
代码行数:20,
代码来源:AmqpTransactionContext.java

示例4: wrap

点赞 2

import org.apache.qpid.proton.amqp.transaction.Discharge; //导入依赖的package包/类
@Override
protected List wrap(Discharge val)
{
    return new DischargeWrapper(val);
}
 

开发者ID:apache,
项目名称:qpid-proton-j,
代码行数:6,
代码来源:DischargeType.java

示例5: DischargeWrapper

点赞 2

import org.apache.qpid.proton.amqp.transaction.Discharge; //导入依赖的package包/类
public DischargeWrapper(Discharge discharge)
{
    _discharge = discharge;
}
 

开发者ID:apache,
项目名称:qpid-proton-j,
代码行数:5,
代码来源:DischargeType.java

示例6: getTypeClass

点赞 2

import org.apache.qpid.proton.amqp.transaction.Discharge; //导入依赖的package包/类
public Class<Discharge> getTypeClass()
{
    return Discharge.class;
}
 

开发者ID:apache,
项目名称:qpid-proton-j,
代码行数:5,
代码来源:DischargeType.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)