Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 //  The contents of this file are subject to the Mozilla Public License
 //  Version 1.1 (the "License"); you may not use this file except in
 //  compliance with the License. You may obtain a copy of the License
 //  at
 //  Software distributed under the License is distributed on an "AS IS"
 //  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 //  the License for the specific language governing rights and
 //  limitations under the License.
//  The Original Code is RabbitMQ.
//  The Initial Developer of the Original Code is VMware, Inc.
//  Copyright (c) 2007-2011 VMware, Inc.  All rights reserved.
package com.rabbitmq.client.impl;
Base class for AMQP method objects, specialized by autogenerated code in
public abstract class Method implements com.rabbitmq.client.Method {
    public abstract int protocolClassId(); /* properly an unsigned short */

    public abstract int protocolMethodId(); /* properly an unsigned short */

    public abstract String protocolMethodName();

Tell if content is present.

true if the wire-protocol for this method should involve a content header and body, or false if it should just involve a single method frame.
    public abstract boolean hasContent();

Visitor support (double-dispatch mechanism).

visitor the visitor object
the result of the "visit" operation
Throws: if an error is encountered
    public abstract Object visit(MethodVisitor visitorthrows IOException;

Private API - Autogenerated writer for this method.

writer interface to an object to write the method arguments
Throws: if an error is encountered
    public abstract void writeArgumentsTo(MethodArgumentWriter writerthrows IOException;

Public API - debugging utility

buffer the buffer to append debug data to
    public void appendArgumentDebugStringTo(StringBuilder buffer) {
    @Override public String toString() {
        StringBuilder sb = new StringBuilder();
        return sb.toString();
    public Frame toFrame(int channelNumberthrows IOException {
        Frame frame = new Frame(.channelNumber);
        DataOutputStream bodyOut = frame.getOutputStream();
        MethodArgumentWriter argWriter = new MethodArgumentWriter(new ValueWriter(bodyOut));
        return frame;
New to GrepCode? Check out our FAQ X