KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > carol > rmi > jrmp > server > JUnicastServerRefSf


1 /**
2  * Copyright (C) 2002,2004 - INRIA (www.inria.fr)
3  *
4  * CAROL: Common Architecture for RMI ObjectWeb Layer
5  *
6  * This library is developed inside the ObjectWeb Consortium,
7  * http://www.objectweb.org
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22  * USA
23  *
24  * --------------------------------------------------------------------------
25  * $Id: JUnicastServerRefSf.java,v 1.5 2004/09/01 11:02:41 benoitf Exp $
26  * --------------------------------------------------------------------------
27  */

28 package org.objectweb.carol.rmi.jrmp.server;
29
30 //sun import
31
import java.io.ObjectOutput JavaDoc;
32 import java.rmi.server.RMIClientSocketFactory JavaDoc;
33 import java.rmi.server.RMIServerSocketFactory JavaDoc;
34 import java.rmi.server.RemoteRef JavaDoc;
35
36 import org.objectweb.carol.rmi.jrmp.interceptor.JClientRequestInterceptor;
37 import org.objectweb.carol.rmi.jrmp.interceptor.JInterceptorStore;
38 import org.objectweb.carol.rmi.jrmp.interceptor.JServerRequestInterceptor;
39
40 import sun.rmi.transport.LiveRef;
41
42 /**
43  * Class <code>JUnicastServerRefSf</code> implements the remote reference
44  * layer server-side behavior for remote objects exported with the JUnicastRefSf
45  * reference type.
46  * @author Guillaume Riviere (Guillaume.Riviere@inrialpes.fr)
47  * @version 1.0, 15/07/2002
48  */

49 public class JUnicastServerRefSf extends JUnicastServerRef {
50
51     /**
52      * constructor
53      */

54     public JUnicastServerRefSf() {
55     }
56
57     /**
58      * Constructor with interceptor Create a new Unicast Server RemoteRef.
59      * @param liveRef the live reference
60      * @param sis the server interceptor array
61      * @param cis the client interceptor array
62      */

63     public JUnicastServerRefSf(LiveRef ref, JServerRequestInterceptor[] sis, JClientRequestInterceptor[] cis) {
64         super(ref, sis, cis);
65     }
66
67     /**
68      * Constructor with interceptor and custum sckets factories
69      * @param port the port reference
70      * @param csf the client socket factory
71      * @param sf the server socket factory
72      * @param sis the server interceptor array
73      * @param cis the client interceptor array
74      */

75     public JUnicastServerRefSf(int port, RMIClientSocketFactory JavaDoc csf, RMIServerSocketFactory JavaDoc ssf,
76             JServerRequestInterceptor[] sis, JClientRequestInterceptor[] cis) {
77         super(new LiveRef(port, csf, ssf), sis, cis);
78     }
79
80     /**
81      * get the ref class name
82      * @return String the class name
83      */

84     public String JavaDoc getRefClass(ObjectOutput JavaDoc out) {
85         super.getRefClass(out);
86         return "org.objectweb.carol.rmi.jrmp.server.JUnicastServerRefSf";
87     }
88
89     /**
90      * use a different kind of RemoteRef instance
91      * @return remoet Ref the remote reference
92      */

93     protected RemoteRef JavaDoc getClientRef() {
94         return new JUnicastRefSf(ref, cis, JInterceptorStore.getJRMPInitializers(), -2);
95     }
96 }
Popular Tags