KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > tools > remote > caucho > burlap > BurlapCauchoOutput


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package mx4j.tools.remote.caucho.burlap;
10
11 import java.io.IOException JavaDoc;
12 import java.io.OutputStream JavaDoc;
13
14 import com.caucho.burlap.io.BurlapOutput;
15 import mx4j.tools.remote.caucho.CauchoOutput;
16 import mx4j.tools.remote.caucho.serialization.JMXSerializerFactory;
17
18 /**
19  * @version $Revision: 1.3 $
20  */

21 class BurlapCauchoOutput implements CauchoOutput
22 {
23    private final BurlapOutput output;
24
25    BurlapCauchoOutput(OutputStream JavaDoc stream)
26    {
27       this.output = new BurlapOutput();
28       output.setSerializerFactory(new JMXSerializerFactory());
29       output.init(stream);
30    }
31
32    public void startReply() throws IOException JavaDoc
33    {
34       output.startReply();
35    }
36
37    public void completeReply() throws IOException JavaDoc
38    {
39       output.completeReply();
40    }
41
42    public void startCall() throws IOException JavaDoc
43    {
44       output.startCall();
45    }
46
47    public void completeCall() throws IOException JavaDoc
48    {
49       output.completeCall();
50    }
51
52    public void writeHeader(String JavaDoc header) throws IOException JavaDoc
53    {
54       output.writeHeader(header);
55    }
56
57    public void writeMethod(String JavaDoc methodName) throws IOException JavaDoc
58    {
59       output.writeMethod(methodName);
60    }
61
62    public void writeObject(Object JavaDoc object) throws IOException JavaDoc
63    {
64       output.writeObject(object);
65    }
66
67    public void writeFault(Throwable JavaDoc fault) throws IOException JavaDoc
68    {
69       output.writeFault(fault.getClass().getName(), fault.getMessage(), fault);
70    }
71 }
72
Popular Tags