Skip to content

Commit 3d99268

Browse files
committed
docs: fix README.md formatting
1 parent e60e607 commit 3d99268

File tree

1 file changed

+51
-57
lines changed

1 file changed

+51
-57
lines changed

README.md

Lines changed: 51 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
ONCRPC4J
2-
========
1+
# ONCRPC4J
32

43
This is a part of dCache.ORG's NFSv4.1 work.
54

@@ -11,11 +10,9 @@ minimal changes.
1110

1211
The library supports *IPv6*, *RPCSEC_GSS* and compliant with [rfc1831](http://www.ietf.org/rfc/rfc1831.txt) and [rfc2203](http://www.ietf.org/rfc/rfc2203.txt).
1312

13+
## There are several options how to use *ONCRPC4J* in your application
1414

15-
### There are several options how to use *ONCRPC4J* in your application:###
16-
17-
Embedding service into an application
18-
-------------------------------------
15+
### Embedding service into an application
1916

2017
```java
2118
package me.mypackage;
@@ -56,7 +53,7 @@ public class Svcd {
5653
}
5754
```
5855

59-
###or as a spring bean###
56+
### or as a spring bean
6057

6158
```java
6259
package me.mypackage;
@@ -115,13 +112,11 @@ public class Svcd implements RpcDispatchable {
115112

116113
Notice, that included *SpringRunner* will try to instantiate and run bean with id __oncrpcsvc__.
117114

118-
119115
```sh
120-
$ java -cp $CLASSPATH org.dcache.oncrpc4j.spring.SpringRunner svc.xml
116+
java -cp $CLASSPATH org.dcache.oncrpc4j.spring.SpringRunner svc.xml
121117
```
122118

123-
Migration from ONCRPC4J-2.x
124-
---------------------------
119+
## Migration from ONCRPC4J-2.x
125120

126121
With version 3.0.0 a new package schema is introduced. As the change is not backward compatible with older
127122
version some minimal code changes are required.
@@ -146,12 +141,12 @@ org.dcache.xdr.GrizzlyXdrTransport => into org.dcache.oncrpc4j.grizzly.GrizzlyRp
146141

147142
org.dcache.xdr.XdrBuffer is removed. Use org.dcache.oncrpc4j.xdr.Xdr.
148143

149-
### Behavoir change ###
144+
### Behavior change
150145

151146
The Xdr#xdrEncodeByteBuffer changed to not flip provided byte buffer. As a result, the Xdr#xdrEncodeByteBuffer
152147
will encode data in the buffer from buffers current position up to the limit:
153148

154-
```
149+
```java
155150
ButeByffer buffer = ...;
156151
Xdr xdr = ...;
157152

@@ -160,9 +155,7 @@ buffer.flip();
160155
xdr.xdrEncodeByteBuffer(buffer);
161156
```
162157

163-
164-
Using RPCGEN to generate client and server stubs
165-
------------------------------------------------
158+
## Using RPCGEN to generate client and server stubs
166159

167160
Assume a service which calculates a the length of a string. It provides a single remote call *strlen* which takes a string as an argument ans returns it's length. Let describe that procedure according XDR language specification:
168161

@@ -174,11 +167,13 @@ program STRLEN {
174167
} = 1;
175168
} = 117;
176169
```
170+
177171
Here we define *STRLEN* program number to be *117* and version number *1*. Now we can generate stub files for client and server:
178172

179173
```sh
180-
$ java -jar oncrpc4j-rpcgen.jar -c StrlenClient strlen.x
174+
java -jar oncrpc4j-rpcgen.jar -c StrlenClient strlen.x
181175
```
176+
182177
Simply extend this class and implement abstract methods:
183178

184179
```java
@@ -248,11 +243,9 @@ public class StrlenClientApp {
248243

249244
Your RPC client and server are ready!
250245

251-
Use ONCRPC4J in your project
252-
==========================
246+
## Use ONCRPC4J in your project
253247

254-
As maven dependency
255-
------------------
248+
### As maven dependency
256249

257250
```xml
258251
<dependency>
@@ -271,8 +264,8 @@ As maven dependency
271264
</repositories>
272265
```
273266

274-
Accessing client subject inside RPC service
275-
-------------------------------------------
267+
## Accessing client subject inside RPC service
268+
276269
In some situation, OncRpcSvc can internally call other services which require client subject to be set in the
277270
context of the current thread. We use standard Java's Subject.doAs() mechanism to inject user subject
278271
into processing thread. As a result, the user subject can be extracted from AccessControlContext.
@@ -301,6 +294,7 @@ public class SubjectAvareSvcImpl implements RpcDispatchable {
301294
```
302295

303296
To avoid unnecessary overhead, subject propagation is not enabled by default:
297+
304298
```java
305299
OncRpcSvc service = new OncRpcSvcBuilder()
306300
.withTCP()
@@ -311,20 +305,18 @@ OncRpcSvc service = new OncRpcSvcBuilder()
311305
.build();
312306
```
313307

314-
Usage with JDK 9 module system
315-
==============================
308+
## Usage with JDK 9 module system
316309

317310
With the provided stable automatic module name __org.dcache.oncrpc4j__, **oncrpc4j**
318311
can be used in modular java9 application:
319-
```
312+
313+
```java
320314
module com.foo.bar {
321315
requires org.dcache.oncrpc4j;
322316
}
323317
```
324318

325-
326-
How to contribute
327-
=================
319+
## How to contribute
328320

329321

330322
**oncrpc4j** uses the linux kernel model of using git not only a source
@@ -337,37 +329,39 @@ The sign-off is a simple line at the end of the explanation for the
337329
patch, which certifies that you wrote it or otherwise have the right to
338330
pass it on as an open-source patch. The rules are pretty simple: if you
339331
can certify the below:
340-
```
341-
342-
Developer's Certificate of Origin 1.1
343-
344-
By making a contribution to this project, I certify that:
345-
346-
(a) The contribution was created in whole or in part by me and I
347-
have the right to submit it under the open source license
348-
indicated in the file; or
349-
350-
(b) The contribution is based upon previous work that, to the best
351-
of my knowledge, is covered under an appropriate open source
352-
license and I have the right under that license to submit that
353-
work with modifications, whether created in whole or in part
354-
by me, under the same open source license (unless I am
355-
permitted to submit under a different license), as indicated
356-
in the file; or
357-
358-
(c) The contribution was provided directly to me by some other
359-
person who certified (a), (b) or (c) and I have not modified
360-
it.
361-
362-
(d) I understand and agree that this project and the contribution
363-
are public and that a record of the contribution (including all
364-
personal information I submit with it, including my sign-off) is
365-
maintained indefinitely and may be redistributed consistent with
366-
this project or the open source license(s) involved.
367332

368333
```
334+
Developer's Certificate of Origin 1.1
335+
336+
By making a contribution to this project, I certify that:
337+
338+
(a) The contribution was created in whole or in part by me and I
339+
have the right to submit it under the open source license
340+
indicated in the file; or
341+
342+
(b) The contribution is based upon previous work that, to the best
343+
of my knowledge, is covered under an appropriate open source
344+
license and I have the right under that license to submit that
345+
work with modifications, whether created in whole or in part
346+
by me, under the same open source license (unless I am
347+
permitted to submit under a different license), as indicated
348+
in the file; or
349+
350+
(c) The contribution was provided directly to me by some other
351+
person who certified (a), (b) or (c) and I have not modified
352+
it.
353+
354+
(d) I understand and agree that this project and the contribution
355+
are public and that a record of the contribution (including all
356+
personal information I submit with it, including my sign-off) is
357+
maintained indefinitely and may be redistributed consistent with
358+
this project or the open source license(s) involved.
359+
```
360+
369361
then you just add a line saying ( git commit -s )
370362

371-
Signed-off-by: Random J Developer <[email protected]>
363+
```
364+
Signed-off-by: Random J Developer <[email protected]>
365+
```
372366

373367
using your real name (sorry, no pseudonyms or anonymous contributions.)

0 commit comments

Comments
 (0)