Skip to content

Commit 74c7849

Browse files
author
Emile Joubert
committed
Merged heads
2 parents ceb96dc + 6f9e744 commit 74c7849

File tree

3 files changed

+23
-32
lines changed

3 files changed

+23
-32
lines changed

projects/client/Apigen/src/apigen/Apigen.cs

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ public void EmitContentHeaderFactory(MethodInfo method) {
857857
EmitLine(" {");
858858
if (Attribute(method, typeof(AmqpUnsupportedAttribute)) != null)
859859
{
860-
EmitLine(String.Format(" return default({0});", method.ReturnType));
860+
EmitLine(String.Format(" throw new UnsupportedMethodException(\"" + method.Name + "\");"));
861861
}
862862
else
863863
{
@@ -1134,35 +1134,26 @@ public void EmitAsynchronousHandlers(ArrayList asynchronousHandlers) {
11341134
string implClass = MangleMethodClass(amqpClass, amqpMethod);
11351135

11361136
EmitLine(" case "+((amqpClass.Index << 16) | amqpMethod.Index)+": {");
1137-
ParameterInfo[] parameters = method.GetParameters();
1137+
ParameterInfo[] parameters = method.GetParameters();
11381138
if (parameters.Length > 0) {
1139-
EmitLine(" "+implClass+" __impl = ("+implClass+") __method;");
1139+
EmitLine(" "+implClass+" __impl = ("+implClass+") __method;");
11401140
EmitLine(" "+method.Name+"(");
11411141
int remaining = parameters.Length;
11421142
foreach (ParameterInfo pi in parameters) {
1143+
if (Attribute(pi, typeof(AmqpContentHeaderMappingAttribute)) != null) {
1144+
Emit(" ("+pi.ParameterType+") cmd.Header");
1145+
} else if (Attribute(pi, typeof(AmqpContentBodyMappingAttribute)) != null) {
1146+
Emit(" cmd.Body");
1147+
} else {
1148+
AmqpFieldMappingAttribute fieldMapping =
1149+
Attribute(pi, typeof(AmqpFieldMappingAttribute)) as AmqpFieldMappingAttribute;
1150+
Emit(" __impl.m_"+(fieldMapping == null
1151+
? pi.Name
1152+
: fieldMapping.m_fieldName));
1153+
}
11431154
remaining--;
1144-
if (Attribute(pi, typeof(AmqpUnsupportedAttribute)) == null)
1145-
{
1146-
if (Attribute(pi, typeof(AmqpContentHeaderMappingAttribute)) != null)
1147-
{
1148-
Emit(" (" + pi.ParameterType + ") cmd.Header");
1149-
}
1150-
else if (Attribute(pi, typeof(AmqpContentBodyMappingAttribute)) != null)
1151-
{
1152-
Emit(" cmd.Body");
1153-
}
1154-
else
1155-
{
1156-
AmqpFieldMappingAttribute fieldMapping =
1157-
Attribute(pi, typeof(AmqpFieldMappingAttribute)) as AmqpFieldMappingAttribute;
1158-
Emit(" __impl.m_" + (fieldMapping == null
1159-
? pi.Name
1160-
: fieldMapping.m_fieldName));
1161-
}
1162-
if (remaining > 0)
1163-
{
1164-
EmitLine(",");
1165-
}
1155+
if (remaining > 0) {
1156+
EmitLine(",");
11661157
}
11671158
}
11681159
EmitLine(");");

projects/client/RabbitMQ.Client/src/client/api/IModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,11 @@ BasicGetResult BasicGet(string queue,
386386
void TxRollback();
387387

388388
///<summary>(Spec method) Enable DTX mode for this session.</summary>
389-
[AmqpMethodDoNotImplement("RabbitMQ.Client.Framing.v0_9_1")]
389+
[AmqpUnsupported("RabbitMQ.Client.Framing.v0_9_1")]
390390
void DtxSelect();
391391

392392
///<summary>(Spec method)</summary>
393-
[AmqpMethodDoNotImplement("RabbitMQ.Client.Framing.v0_9_1")]
393+
[AmqpUnsupported("RabbitMQ.Client.Framing.v0_9_1")]
394394
void DtxStart(string dtxIdentifier);
395395

396396
///<summary>Close this session.</summary>
@@ -701,7 +701,7 @@ void _Private_ConnectionOpen(string virtualHost,
701701
bool insist);
702702

703703
///<summary>Handle an incoming Connection.OpenOk.</summary>
704-
void HandleConnectionOpenOk([AmqpUnsupported("RabbitMQ.Client.Framing.v0_9_1")]
704+
void HandleConnectionOpenOk([AmqpFieldMapping("RabbitMQ.Client.Framing.v0_9_1", "reserved1")]
705705
string knownHosts);
706706

707707
///<summary>Handle an incoming Connection.Redirect.</summary>

projects/client/RabbitMQ.Client/src/client/impl/ModelBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ public event CallbackExceptionEventHandler CallbackException
146146
m_callbackException -= value;
147147
}
148148
}
149-
}
150-
149+
}
150+
151151
public IBasicConsumer DefaultConsumer { get; set; }
152152

153153
public ISession m_session;
@@ -806,8 +806,8 @@ public abstract void BasicReject(ulong deliveryTag,
806806
public abstract void TxCommit();
807807
public abstract void TxRollback();
808808

809-
public virtual void DtxSelect() { }
810-
public virtual void DtxStart(string dtxIdentifier) { }
809+
public abstract void DtxSelect();
810+
public abstract void DtxStart(string dtxIdentifier);
811811

812812
void IDisposable.Dispose()
813813
{

0 commit comments

Comments
 (0)