EMMA Coverage Report (generated Tue Feb 12 22:23:49 ICT 2008)
[all classes][net.sourceforge.hiveremoting.caucho]

COVERAGE SUMMARY FOR SOURCE FILE [HessianRemoteServiceInvoker.java]

nameclass, %method, %block, %line, %
HessianRemoteServiceInvoker.java0%   (0/1)0%   (0/2)0%   (0/77)0%   (0/19)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class HessianRemoteServiceInvoker0%   (0/1)0%   (0/2)0%   (0/77)0%   (0/19)
HessianRemoteServiceInvoker (PublishServiceContribution, SerializerFactory): ... 0%   (0/1)0%   (0/20)0%   (0/5)
invoke (InputStream, OutputStream): void 0%   (0/1)0%   (0/57)0%   (0/14)

1//  Copyright 2004-2007 Jean-Francois Poilpret
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14 
15package net.sourceforge.hiveremoting.caucho;
16 
17import java.io.IOException;
18import java.io.InputStream;
19import java.io.OutputStream;
20 
21import org.apache.hivemind.internal.ServicePoint;
22 
23import com.caucho.hessian.io.AbstractHessianOutput;
24import com.caucho.hessian.io.Hessian2Input;
25import com.caucho.hessian.io.Hessian2Output;
26import com.caucho.hessian.io.HessianOutput;
27import com.caucho.hessian.io.SerializerFactory;
28import com.caucho.hessian.server.HessianSkeleton;
29 
30/**
31 * @author Jean-Francois Poilpret
32 */
33public class HessianRemoteServiceInvoker extends AbstractRemoteServiceInvoker
34{
35        public HessianRemoteServiceInvoker(        PublishServiceContribution        contrib,
36                                                                                SerializerFactory                        factory)
37        {
38                super(contrib, factory);
39                ServicePoint service = contrib.getServiceId();
40                Class intf = service.getServiceInterface();
41                _skeleton = new HessianSkeleton(service.getService(intf), intf);
42        }
43 
44        //CSOFF: IllegalThrowsCheck
45        @Override protected void        invoke(InputStream is, OutputStream os)
46                throws Throwable
47        {
48                // Create in stream from HTTP request
49                Hessian2Input in = new Hessian2Input(is);
50 
51                // Check version of Hessian protocol used
52                int code = in.read();
53                if (code != 'c')
54                {
55                        throw new IOException("expected 'c' in hessian input at " + code);
56                }
57                int major = in.read();
58                int minor = in.read();
59                
60                // Create out stream for HTTP response
61                AbstractHessianOutput out;
62                if (major >= 2)
63                {
64                        out = new Hessian2Output(os);
65                }
66                else
67                {
68                        out = new HessianOutput(os);
69                }
70                
71                // Set special Serializer Factory
72                in.setSerializerFactory(_factory);
73                out.setSerializerFactory(_factory);
74                // Proceed with invocation
75                _skeleton.invoke(in, out);
76        }
77        //CSON: IllegalThrowsCheck
78 
79        protected final HessianSkeleton                _skeleton;
80}

[all classes][net.sourceforge.hiveremoting.caucho]
EMMA 2.0.5312 (C) Vladimir Roubtsov