PageRenderTime 48ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/JGameSocketServer/src/test/java/com/glu/rpc/test/TestProto.java

http://flex-mmorpg-server.googlecode.com/
Java | 913 lines | 766 code | 136 blank | 11 comment | 65 complexity | 6781d80e8095ec85963a6cd28f01e8b4 MD5 | raw file
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. package com.glu.rpc.test;
  3. public final class TestProto {
  4. private TestProto() {
  5. }
  6. public static void registerAllExtensions(
  7. com.google.protobuf.ExtensionRegistry registry) {
  8. }
  9. public static final class User extends com.google.protobuf.GeneratedMessage {
  10. // Use User.newBuilder() to construct.
  11. private User() {
  12. }
  13. private static final User defaultInstance = new User();
  14. public static User getDefaultInstance() {
  15. return defaultInstance;
  16. }
  17. public User getDefaultInstanceForType() {
  18. return defaultInstance;
  19. }
  20. public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
  21. return com.glu.rpc.test.TestProto.internal_static_protobuf_rpc_User_descriptor;
  22. }
  23. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() {
  24. return com.glu.rpc.test.TestProto.internal_static_protobuf_rpc_User_fieldAccessorTable;
  25. }
  26. // optional string userName = 1;
  27. public static final int USERNAME_FIELD_NUMBER = 1;
  28. private boolean hasUserName;
  29. private java.lang.String userName_ = "";
  30. public boolean hasUserName() {
  31. return hasUserName;
  32. }
  33. public java.lang.String getUserName() {
  34. return userName_;
  35. }
  36. public final boolean isInitialized() {
  37. return true;
  38. }
  39. public void writeTo(com.google.protobuf.CodedOutputStream output)
  40. throws java.io.IOException {
  41. if (hasUserName()) {
  42. output.writeString(1, getUserName());
  43. }
  44. getUnknownFields().writeTo(output);
  45. }
  46. private int memoizedSerializedSize = -1;
  47. public int getSerializedSize() {
  48. int size = memoizedSerializedSize;
  49. if (size != -1)
  50. return size;
  51. size = 0;
  52. if (hasUserName()) {
  53. size += com.google.protobuf.CodedOutputStream
  54. .computeStringSize(1, getUserName());
  55. }
  56. size += getUnknownFields().getSerializedSize();
  57. memoizedSerializedSize = size;
  58. return size;
  59. }
  60. public static com.glu.rpc.test.TestProto.User parseFrom(
  61. com.google.protobuf.ByteString data)
  62. throws com.google.protobuf.InvalidProtocolBufferException {
  63. return newBuilder().mergeFrom(data).buildParsed();
  64. }
  65. public static com.glu.rpc.test.TestProto.User parseFrom(
  66. com.google.protobuf.ByteString data,
  67. com.google.protobuf.ExtensionRegistry extensionRegistry)
  68. throws com.google.protobuf.InvalidProtocolBufferException {
  69. return newBuilder().mergeFrom(data, extensionRegistry)
  70. .buildParsed();
  71. }
  72. public static com.glu.rpc.test.TestProto.User parseFrom(byte[] data)
  73. throws com.google.protobuf.InvalidProtocolBufferException {
  74. return newBuilder().mergeFrom(data).buildParsed();
  75. }
  76. public static com.glu.rpc.test.TestProto.User parseFrom(byte[] data,
  77. com.google.protobuf.ExtensionRegistry extensionRegistry)
  78. throws com.google.protobuf.InvalidProtocolBufferException {
  79. return newBuilder().mergeFrom(data, extensionRegistry)
  80. .buildParsed();
  81. }
  82. public static com.glu.rpc.test.TestProto.User parseFrom(
  83. java.io.InputStream input) throws java.io.IOException {
  84. return newBuilder().mergeFrom(input).buildParsed();
  85. }
  86. public static com.glu.rpc.test.TestProto.User parseFrom(
  87. java.io.InputStream input,
  88. com.google.protobuf.ExtensionRegistry extensionRegistry)
  89. throws java.io.IOException {
  90. return newBuilder().mergeFrom(input, extensionRegistry)
  91. .buildParsed();
  92. }
  93. public static com.glu.rpc.test.TestProto.User parseDelimitedFrom(
  94. java.io.InputStream input) throws java.io.IOException {
  95. return newBuilder().mergeDelimitedFrom(input).buildParsed();
  96. }
  97. public static com.glu.rpc.test.TestProto.User parseDelimitedFrom(
  98. java.io.InputStream input,
  99. com.google.protobuf.ExtensionRegistry extensionRegistry)
  100. throws java.io.IOException {
  101. return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
  102. .buildParsed();
  103. }
  104. public static com.glu.rpc.test.TestProto.User parseFrom(
  105. com.google.protobuf.CodedInputStream input)
  106. throws java.io.IOException {
  107. return newBuilder().mergeFrom(input).buildParsed();
  108. }
  109. public static com.glu.rpc.test.TestProto.User parseFrom(
  110. com.google.protobuf.CodedInputStream input,
  111. com.google.protobuf.ExtensionRegistry extensionRegistry)
  112. throws java.io.IOException {
  113. return newBuilder().mergeFrom(input, extensionRegistry)
  114. .buildParsed();
  115. }
  116. public static Builder newBuilder() {
  117. return Builder.create();
  118. }
  119. public Builder newBuilderForType() {
  120. return newBuilder();
  121. }
  122. public static Builder newBuilder(
  123. com.glu.rpc.test.TestProto.User prototype) {
  124. return newBuilder().mergeFrom(prototype);
  125. }
  126. public Builder toBuilder() {
  127. return newBuilder(this);
  128. }
  129. public static final class Builder extends
  130. com.google.protobuf.GeneratedMessage.Builder<Builder> {
  131. private com.glu.rpc.test.TestProto.User result;
  132. // Construct using com.glu.rpc.test.TestProto.User.newBuilder()
  133. private Builder() {
  134. }
  135. private static Builder create() {
  136. Builder builder = new Builder();
  137. builder.result = new com.glu.rpc.test.TestProto.User();
  138. return builder;
  139. }
  140. protected com.glu.rpc.test.TestProto.User internalGetResult() {
  141. return result;
  142. }
  143. public Builder clear() {
  144. if (result == null) {
  145. throw new IllegalStateException(
  146. "Cannot call clear() after build().");
  147. }
  148. result = new com.glu.rpc.test.TestProto.User();
  149. return this;
  150. }
  151. public Builder clone() {
  152. return create().mergeFrom(result);
  153. }
  154. public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
  155. return com.glu.rpc.test.TestProto.User.getDescriptor();
  156. }
  157. public com.glu.rpc.test.TestProto.User getDefaultInstanceForType() {
  158. return com.glu.rpc.test.TestProto.User.getDefaultInstance();
  159. }
  160. public boolean isInitialized() {
  161. return result.isInitialized();
  162. }
  163. public com.glu.rpc.test.TestProto.User build() {
  164. if (result != null && !isInitialized()) {
  165. throw new com.google.protobuf.UninitializedMessageException(
  166. result);
  167. }
  168. return buildPartial();
  169. }
  170. private com.glu.rpc.test.TestProto.User buildParsed()
  171. throws com.google.protobuf.InvalidProtocolBufferException {
  172. if (!isInitialized()) {
  173. throw new com.google.protobuf.UninitializedMessageException(
  174. result).asInvalidProtocolBufferException();
  175. }
  176. return buildPartial();
  177. }
  178. public com.glu.rpc.test.TestProto.User buildPartial() {
  179. if (result == null) {
  180. throw new IllegalStateException(
  181. "build() has already been called on this Builder.");
  182. }
  183. com.glu.rpc.test.TestProto.User returnMe = result;
  184. result = null;
  185. return returnMe;
  186. }
  187. public Builder mergeFrom(com.google.protobuf.Message other) {
  188. if (other instanceof com.glu.rpc.test.TestProto.User) {
  189. return mergeFrom((com.glu.rpc.test.TestProto.User) other);
  190. } else {
  191. super.mergeFrom(other);
  192. return this;
  193. }
  194. }
  195. public Builder mergeFrom(com.glu.rpc.test.TestProto.User other) {
  196. if (other == com.glu.rpc.test.TestProto.User
  197. .getDefaultInstance())
  198. return this;
  199. if (other.hasUserName()) {
  200. setUserName(other.getUserName());
  201. }
  202. this.mergeUnknownFields(other.getUnknownFields());
  203. return this;
  204. }
  205. public Builder mergeFrom(
  206. com.google.protobuf.CodedInputStream input,
  207. com.google.protobuf.ExtensionRegistry extensionRegistry)
  208. throws java.io.IOException {
  209. com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet
  210. .newBuilder(this.getUnknownFields());
  211. while (true) {
  212. int tag = input.readTag();
  213. switch (tag) {
  214. case 0:
  215. this.setUnknownFields(unknownFields.build());
  216. return this;
  217. default: {
  218. if (!parseUnknownField(input, unknownFields,
  219. extensionRegistry, tag)) {
  220. this.setUnknownFields(unknownFields.build());
  221. return this;
  222. }
  223. break;
  224. }
  225. case 10: {
  226. setUserName(input.readString());
  227. break;
  228. }
  229. }
  230. }
  231. }
  232. // optional string userName = 1;
  233. public boolean hasUserName() {
  234. return result.hasUserName();
  235. }
  236. public java.lang.String getUserName() {
  237. return result.getUserName();
  238. }
  239. public Builder setUserName(java.lang.String value) {
  240. if (value == null) {
  241. throw new NullPointerException();
  242. }
  243. result.hasUserName = true;
  244. result.userName_ = value;
  245. return this;
  246. }
  247. public Builder clearUserName() {
  248. result.hasUserName = false;
  249. result.userName_ = getDefaultInstance().getUserName();
  250. return this;
  251. }
  252. }
  253. static {
  254. com.glu.rpc.test.TestProto.getDescriptor();
  255. }
  256. }
  257. public static final class Result extends
  258. com.google.protobuf.GeneratedMessage {
  259. // Use Result.newBuilder() to construct.
  260. private Result() {
  261. }
  262. private static final Result defaultInstance = new Result();
  263. public static Result getDefaultInstance() {
  264. return defaultInstance;
  265. }
  266. public Result getDefaultInstanceForType() {
  267. return defaultInstance;
  268. }
  269. public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
  270. return com.glu.rpc.test.TestProto.internal_static_protobuf_rpc_Result_descriptor;
  271. }
  272. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() {
  273. return com.glu.rpc.test.TestProto.internal_static_protobuf_rpc_Result_fieldAccessorTable;
  274. }
  275. // optional string result = 1;
  276. public static final int RESULT_FIELD_NUMBER = 1;
  277. private boolean hasResult;
  278. private java.lang.String result_ = "";
  279. public boolean hasResult() {
  280. return hasResult;
  281. }
  282. public java.lang.String getResult() {
  283. return result_;
  284. }
  285. // optional bool success = 2;
  286. public static final int SUCCESS_FIELD_NUMBER = 2;
  287. private boolean hasSuccess;
  288. private boolean success_ = false;
  289. public boolean hasSuccess() {
  290. return hasSuccess;
  291. }
  292. public boolean getSuccess() {
  293. return success_;
  294. }
  295. public final boolean isInitialized() {
  296. return true;
  297. }
  298. public void writeTo(com.google.protobuf.CodedOutputStream output)
  299. throws java.io.IOException {
  300. if (hasResult()) {
  301. output.writeString(1, getResult());
  302. }
  303. if (hasSuccess()) {
  304. output.writeBool(2, getSuccess());
  305. }
  306. getUnknownFields().writeTo(output);
  307. }
  308. private int memoizedSerializedSize = -1;
  309. public int getSerializedSize() {
  310. int size = memoizedSerializedSize;
  311. if (size != -1)
  312. return size;
  313. size = 0;
  314. if (hasResult()) {
  315. size += com.google.protobuf.CodedOutputStream
  316. .computeStringSize(1, getResult());
  317. }
  318. if (hasSuccess()) {
  319. size += com.google.protobuf.CodedOutputStream.computeBoolSize(
  320. 2, getSuccess());
  321. }
  322. size += getUnknownFields().getSerializedSize();
  323. memoizedSerializedSize = size;
  324. return size;
  325. }
  326. public static com.glu.rpc.test.TestProto.Result parseFrom(
  327. com.google.protobuf.ByteString data)
  328. throws com.google.protobuf.InvalidProtocolBufferException {
  329. return newBuilder().mergeFrom(data).buildParsed();
  330. }
  331. public static com.glu.rpc.test.TestProto.Result parseFrom(
  332. com.google.protobuf.ByteString data,
  333. com.google.protobuf.ExtensionRegistry extensionRegistry)
  334. throws com.google.protobuf.InvalidProtocolBufferException {
  335. return newBuilder().mergeFrom(data, extensionRegistry)
  336. .buildParsed();
  337. }
  338. public static com.glu.rpc.test.TestProto.Result parseFrom(byte[] data)
  339. throws com.google.protobuf.InvalidProtocolBufferException {
  340. return newBuilder().mergeFrom(data).buildParsed();
  341. }
  342. public static com.glu.rpc.test.TestProto.Result parseFrom(byte[] data,
  343. com.google.protobuf.ExtensionRegistry extensionRegistry)
  344. throws com.google.protobuf.InvalidProtocolBufferException {
  345. return newBuilder().mergeFrom(data, extensionRegistry)
  346. .buildParsed();
  347. }
  348. public static com.glu.rpc.test.TestProto.Result parseFrom(
  349. java.io.InputStream input) throws java.io.IOException {
  350. return newBuilder().mergeFrom(input).buildParsed();
  351. }
  352. public static com.glu.rpc.test.TestProto.Result parseFrom(
  353. java.io.InputStream input,
  354. com.google.protobuf.ExtensionRegistry extensionRegistry)
  355. throws java.io.IOException {
  356. return newBuilder().mergeFrom(input, extensionRegistry)
  357. .buildParsed();
  358. }
  359. public static com.glu.rpc.test.TestProto.Result parseDelimitedFrom(
  360. java.io.InputStream input) throws java.io.IOException {
  361. return newBuilder().mergeDelimitedFrom(input).buildParsed();
  362. }
  363. public static com.glu.rpc.test.TestProto.Result parseDelimitedFrom(
  364. java.io.InputStream input,
  365. com.google.protobuf.ExtensionRegistry extensionRegistry)
  366. throws java.io.IOException {
  367. return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
  368. .buildParsed();
  369. }
  370. public static com.glu.rpc.test.TestProto.Result parseFrom(
  371. com.google.protobuf.CodedInputStream input)
  372. throws java.io.IOException {
  373. return newBuilder().mergeFrom(input).buildParsed();
  374. }
  375. public static com.glu.rpc.test.TestProto.Result parseFrom(
  376. com.google.protobuf.CodedInputStream input,
  377. com.google.protobuf.ExtensionRegistry extensionRegistry)
  378. throws java.io.IOException {
  379. return newBuilder().mergeFrom(input, extensionRegistry)
  380. .buildParsed();
  381. }
  382. public static Builder newBuilder() {
  383. return Builder.create();
  384. }
  385. public Builder newBuilderForType() {
  386. return newBuilder();
  387. }
  388. public static Builder newBuilder(
  389. com.glu.rpc.test.TestProto.Result prototype) {
  390. return newBuilder().mergeFrom(prototype);
  391. }
  392. public Builder toBuilder() {
  393. return newBuilder(this);
  394. }
  395. public static final class Builder extends
  396. com.google.protobuf.GeneratedMessage.Builder<Builder> {
  397. private com.glu.rpc.test.TestProto.Result result;
  398. // Construct using com.glu.rpc.test.TestProto.Result.newBuilder()
  399. private Builder() {
  400. }
  401. private static Builder create() {
  402. Builder builder = new Builder();
  403. builder.result = new com.glu.rpc.test.TestProto.Result();
  404. return builder;
  405. }
  406. protected com.glu.rpc.test.TestProto.Result internalGetResult() {
  407. return result;
  408. }
  409. public Builder clear() {
  410. if (result == null) {
  411. throw new IllegalStateException(
  412. "Cannot call clear() after build().");
  413. }
  414. result = new com.glu.rpc.test.TestProto.Result();
  415. return this;
  416. }
  417. public Builder clone() {
  418. return create().mergeFrom(result);
  419. }
  420. public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
  421. return com.glu.rpc.test.TestProto.Result.getDescriptor();
  422. }
  423. public com.glu.rpc.test.TestProto.Result getDefaultInstanceForType() {
  424. return com.glu.rpc.test.TestProto.Result.getDefaultInstance();
  425. }
  426. public boolean isInitialized() {
  427. return result.isInitialized();
  428. }
  429. public com.glu.rpc.test.TestProto.Result build() {
  430. if (result != null && !isInitialized()) {
  431. throw new com.google.protobuf.UninitializedMessageException(
  432. result);
  433. }
  434. return buildPartial();
  435. }
  436. private com.glu.rpc.test.TestProto.Result buildParsed()
  437. throws com.google.protobuf.InvalidProtocolBufferException {
  438. if (!isInitialized()) {
  439. throw new com.google.protobuf.UninitializedMessageException(
  440. result).asInvalidProtocolBufferException();
  441. }
  442. return buildPartial();
  443. }
  444. public com.glu.rpc.test.TestProto.Result buildPartial() {
  445. if (result == null) {
  446. throw new IllegalStateException(
  447. "build() has already been called on this Builder.");
  448. }
  449. com.glu.rpc.test.TestProto.Result returnMe = result;
  450. result = null;
  451. return returnMe;
  452. }
  453. public Builder mergeFrom(com.google.protobuf.Message other) {
  454. if (other instanceof com.glu.rpc.test.TestProto.Result) {
  455. return mergeFrom((com.glu.rpc.test.TestProto.Result) other);
  456. } else {
  457. super.mergeFrom(other);
  458. return this;
  459. }
  460. }
  461. public Builder mergeFrom(com.glu.rpc.test.TestProto.Result other) {
  462. if (other == com.glu.rpc.test.TestProto.Result
  463. .getDefaultInstance())
  464. return this;
  465. if (other.hasResult()) {
  466. setResult(other.getResult());
  467. }
  468. if (other.hasSuccess()) {
  469. setSuccess(other.getSuccess());
  470. }
  471. this.mergeUnknownFields(other.getUnknownFields());
  472. return this;
  473. }
  474. public Builder mergeFrom(
  475. com.google.protobuf.CodedInputStream input,
  476. com.google.protobuf.ExtensionRegistry extensionRegistry)
  477. throws java.io.IOException {
  478. com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet
  479. .newBuilder(this.getUnknownFields());
  480. while (true) {
  481. int tag = input.readTag();
  482. switch (tag) {
  483. case 0:
  484. this.setUnknownFields(unknownFields.build());
  485. return this;
  486. default: {
  487. if (!parseUnknownField(input, unknownFields,
  488. extensionRegistry, tag)) {
  489. this.setUnknownFields(unknownFields.build());
  490. return this;
  491. }
  492. break;
  493. }
  494. case 10: {
  495. setResult(input.readString());
  496. break;
  497. }
  498. case 16: {
  499. setSuccess(input.readBool());
  500. break;
  501. }
  502. }
  503. }
  504. }
  505. // optional string result = 1;
  506. public boolean hasResult() {
  507. return result.hasResult();
  508. }
  509. public java.lang.String getResult() {
  510. return result.getResult();
  511. }
  512. public Builder setResult(java.lang.String value) {
  513. if (value == null) {
  514. throw new NullPointerException();
  515. }
  516. result.hasResult = true;
  517. result.result_ = value;
  518. return this;
  519. }
  520. public Builder clearResult() {
  521. result.hasResult = false;
  522. result.result_ = getDefaultInstance().getResult();
  523. return this;
  524. }
  525. // optional bool success = 2;
  526. public boolean hasSuccess() {
  527. return result.hasSuccess();
  528. }
  529. public boolean getSuccess() {
  530. return result.getSuccess();
  531. }
  532. public Builder setSuccess(boolean value) {
  533. result.hasSuccess = true;
  534. result.success_ = value;
  535. return this;
  536. }
  537. public Builder clearSuccess() {
  538. result.hasSuccess = false;
  539. result.success_ = false;
  540. return this;
  541. }
  542. }
  543. static {
  544. com.glu.rpc.test.TestProto.getDescriptor();
  545. }
  546. }
  547. public static abstract class TestService implements
  548. com.google.protobuf.Service {
  549. protected TestService() {
  550. }
  551. public interface Interface {
  552. public abstract void testMethod(
  553. com.google.protobuf.RpcController controller,
  554. com.glu.rpc.test.TestProto.User request,
  555. com.google.protobuf.RpcCallback<com.glu.rpc.test.TestProto.Result> done);
  556. }
  557. public static com.google.protobuf.Service newReflectiveService(
  558. final Interface impl) {
  559. return new TestService() {
  560. @Override
  561. public void testMethod(
  562. com.google.protobuf.RpcController controller,
  563. com.glu.rpc.test.TestProto.User request,
  564. com.google.protobuf.RpcCallback<com.glu.rpc.test.TestProto.Result> done) {
  565. impl.testMethod(controller, request, done);
  566. }
  567. };
  568. }
  569. public static com.google.protobuf.BlockingService newReflectiveBlockingService(
  570. final BlockingInterface impl) {
  571. return new com.google.protobuf.BlockingService() {
  572. public final com.google.protobuf.Descriptors.ServiceDescriptor getDescriptorForType() {
  573. return getDescriptor();
  574. }
  575. public final com.google.protobuf.Message callBlockingMethod(
  576. com.google.protobuf.Descriptors.MethodDescriptor method,
  577. com.google.protobuf.RpcController controller,
  578. com.google.protobuf.Message request)
  579. throws com.google.protobuf.ServiceException {
  580. if (method.getService() != getDescriptor()) {
  581. throw new java.lang.IllegalArgumentException(
  582. "Service.callBlockingMethod() given method descriptor for "
  583. + "wrong service type.");
  584. }
  585. switch (method.getIndex()) {
  586. case 0:
  587. return impl.testMethod(controller,
  588. (com.glu.rpc.test.TestProto.User) request);
  589. default:
  590. throw new java.lang.AssertionError("Can't get here.");
  591. }
  592. }
  593. public final com.google.protobuf.Message getRequestPrototype(
  594. com.google.protobuf.Descriptors.MethodDescriptor method) {
  595. if (method.getService() != getDescriptor()) {
  596. throw new java.lang.IllegalArgumentException(
  597. "Service.getRequestPrototype() given method "
  598. + "descriptor for wrong service type.");
  599. }
  600. switch (method.getIndex()) {
  601. case 0:
  602. return com.glu.rpc.test.TestProto.User
  603. .getDefaultInstance();
  604. default:
  605. throw new java.lang.AssertionError("Can't get here.");
  606. }
  607. }
  608. public final com.google.protobuf.Message getResponsePrototype(
  609. com.google.protobuf.Descriptors.MethodDescriptor method) {
  610. if (method.getService() != getDescriptor()) {
  611. throw new java.lang.IllegalArgumentException(
  612. "Service.getResponsePrototype() given method "
  613. + "descriptor for wrong service type.");
  614. }
  615. switch (method.getIndex()) {
  616. case 0:
  617. return com.glu.rpc.test.TestProto.Result
  618. .getDefaultInstance();
  619. default:
  620. throw new java.lang.AssertionError("Can't get here.");
  621. }
  622. }
  623. };
  624. }
  625. public abstract void testMethod(
  626. com.google.protobuf.RpcController controller,
  627. com.glu.rpc.test.TestProto.User request,
  628. com.google.protobuf.RpcCallback<com.glu.rpc.test.TestProto.Result> done);
  629. public static final com.google.protobuf.Descriptors.ServiceDescriptor getDescriptor() {
  630. return com.glu.rpc.test.TestProto.getDescriptor().getServices()
  631. .get(0);
  632. }
  633. public final com.google.protobuf.Descriptors.ServiceDescriptor getDescriptorForType() {
  634. return getDescriptor();
  635. }
  636. public final void callMethod(
  637. com.google.protobuf.Descriptors.MethodDescriptor method,
  638. com.google.protobuf.RpcController controller,
  639. com.google.protobuf.Message request,
  640. com.google.protobuf.RpcCallback<com.google.protobuf.Message> done) {
  641. if (method.getService() != getDescriptor()) {
  642. throw new java.lang.IllegalArgumentException(
  643. "Service.callMethod() given method descriptor for wrong "
  644. + "service type.");
  645. }
  646. switch (method.getIndex()) {
  647. case 0:
  648. this.testMethod(controller, (com.glu.rpc.test.TestProto.User) request,
  649. com.google.protobuf.RpcUtil.<com.glu.rpc.test.TestProto.Result> specializeCallback(done));
  650. return;
  651. default:
  652. throw new java.lang.AssertionError("Can't get here.");
  653. }
  654. }
  655. public final com.google.protobuf.Message getRequestPrototype(
  656. com.google.protobuf.Descriptors.MethodDescriptor method) {
  657. if (method.getService() != getDescriptor()) {
  658. throw new java.lang.IllegalArgumentException(
  659. "Service.getRequestPrototype() given method "
  660. + "descriptor for wrong service type.");
  661. }
  662. switch (method.getIndex()) {
  663. case 0:
  664. return com.glu.rpc.test.TestProto.User.getDefaultInstance();
  665. default:
  666. throw new java.lang.AssertionError("Can't get here.");
  667. }
  668. }
  669. public final com.google.protobuf.Message getResponsePrototype(
  670. com.google.protobuf.Descriptors.MethodDescriptor method) {
  671. if (method.getService() != getDescriptor()) {
  672. throw new java.lang.IllegalArgumentException(
  673. "Service.getResponsePrototype() given method "
  674. + "descriptor for wrong service type.");
  675. }
  676. switch (method.getIndex()) {
  677. case 0:
  678. return com.glu.rpc.test.TestProto.Result.getDefaultInstance();
  679. default:
  680. throw new java.lang.AssertionError("Can't get here.");
  681. }
  682. }
  683. public static Stub newStub(com.google.protobuf.RpcChannel channel) {
  684. return new Stub(channel);
  685. }
  686. public static final class Stub extends
  687. com.glu.rpc.test.TestProto.TestService implements Interface {
  688. private Stub(com.google.protobuf.RpcChannel channel) {
  689. this.channel = channel;
  690. }
  691. private final com.google.protobuf.RpcChannel channel;
  692. public com.google.protobuf.RpcChannel getChannel() {
  693. return channel;
  694. }
  695. public void testMethod(
  696. com.google.protobuf.RpcController controller,
  697. com.glu.rpc.test.TestProto.User request,
  698. com.google.protobuf.RpcCallback<com.glu.rpc.test.TestProto.Result> done) {
  699. channel.callMethod(getDescriptor().getMethods().get(0),
  700. controller, request, com.glu.rpc.test.TestProto.Result
  701. .getDefaultInstance(),
  702. com.google.protobuf.RpcUtil.generalizeCallback(done,
  703. com.glu.rpc.test.TestProto.Result.class,
  704. com.glu.rpc.test.TestProto.Result
  705. .getDefaultInstance()));
  706. }
  707. }
  708. public static BlockingInterface newBlockingStub(
  709. com.google.protobuf.BlockingRpcChannel channel) {
  710. return new BlockingStub(channel);
  711. }
  712. public interface BlockingInterface {
  713. public com.glu.rpc.test.TestProto.Result testMethod(
  714. com.google.protobuf.RpcController controller,
  715. com.glu.rpc.test.TestProto.User request)
  716. throws com.google.protobuf.ServiceException;
  717. }
  718. private static final class BlockingStub implements BlockingInterface {
  719. private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) {
  720. this.channel = channel;
  721. }
  722. private final com.google.protobuf.BlockingRpcChannel channel;
  723. public com.glu.rpc.test.TestProto.Result testMethod(
  724. com.google.protobuf.RpcController controller,
  725. com.glu.rpc.test.TestProto.User request)
  726. throws com.google.protobuf.ServiceException {
  727. return (com.glu.rpc.test.TestProto.Result) channel
  728. .callBlockingMethod(
  729. getDescriptor().getMethods().get(0),
  730. controller, request,
  731. com.glu.rpc.test.TestProto.Result
  732. .getDefaultInstance());
  733. }
  734. }
  735. }
  736. private static com.google.protobuf.Descriptors.Descriptor internal_static_protobuf_rpc_User_descriptor;
  737. private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_protobuf_rpc_User_fieldAccessorTable;
  738. private static com.google.protobuf.Descriptors.Descriptor internal_static_protobuf_rpc_Result_descriptor;
  739. private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_protobuf_rpc_Result_fieldAccessorTable;
  740. public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
  741. return descriptor;
  742. }
  743. private static com.google.protobuf.Descriptors.FileDescriptor descriptor;
  744. static {
  745. String descriptorData = "\n\ntest.proto\022\014protobuf.rpc\"\030\n\004User\022\020\n\010us"
  746. + "erName\030\001 \001(\t\")\n\006Result\022\016\n\006result\030\001 \001(\t\022\017"
  747. + "\n\007success\030\002 \001(\0102E\n\013TestService\0226\n\nTestMe"
  748. + "thod\022\022.protobuf.rpc.User\032\024.protobuf.rpc."
  749. + "ResultB\035\n\020com.glu.rpc.testB\tTestProto";
  750. com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
  751. public com.google.protobuf.ExtensionRegistry assignDescriptors(
  752. com.google.protobuf.Descriptors.FileDescriptor root) {
  753. descriptor = root;
  754. internal_static_protobuf_rpc_User_descriptor = getDescriptor()
  755. .getMessageTypes().get(0);
  756. internal_static_protobuf_rpc_User_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  757. internal_static_protobuf_rpc_User_descriptor,
  758. new java.lang.String[] { "UserName", },
  759. com.glu.rpc.test.TestProto.User.class,
  760. com.glu.rpc.test.TestProto.User.Builder.class);
  761. internal_static_protobuf_rpc_Result_descriptor = getDescriptor()
  762. .getMessageTypes().get(1);
  763. internal_static_protobuf_rpc_Result_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  764. internal_static_protobuf_rpc_Result_descriptor,
  765. new java.lang.String[] { "Result", "Success", },
  766. com.glu.rpc.test.TestProto.Result.class,
  767. com.glu.rpc.test.TestProto.Result.Builder.class);
  768. return null;
  769. }
  770. };
  771. com.google.protobuf.Descriptors.FileDescriptor
  772. .internalBuildGeneratedFileFrom(
  773. descriptorData,
  774. new com.google.protobuf.Descriptors.FileDescriptor[] {},
  775. assigner);
  776. }
  777. }