01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: *
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: /**
20: * @author Victor A. Martynov
21: * @version $Revision: 1.1.2.3 $
22: */package org.apache.harmony.rmi.remoteref;
23:
24: import java.io.ObjectOutput;
25: import java.rmi.activation.ActivationID;
26: import java.rmi.server.ObjID;
27: import java.rmi.server.RMIClientSocketFactory;
28: import java.rmi.server.RMIServerSocketFactory;
29:
30: import org.apache.harmony.rmi.transport.Endpoint;
31:
32: /**
33: *
34: * @author Victor A. Martynov
35: * @version $Revision: 1.1.2.3 $
36: *
37: * ActivatableServerRef
38: */
39: public class ActivatableServerRef extends UnicastServerRef2 {
40:
41: private static final long serialVersionUID = 460723133775318075L;
42:
43: private ActivationID aid;
44:
45: /**
46: * Constructor intended to create ActivatableServerRef on the given port.
47: *
48: * @param aid Activation identifier of this ActivatableRef
49: * @param port Port on which ActivatableServerRef will be exported.
50: * @param csf Client socket factory.
51: * @param ssf Server socket factory.
52: */
53: public ActivatableServerRef(ActivationID aid, int port,
54: RMIClientSocketFactory csf, RMIServerSocketFactory ssf) {
55: super (port, csf, ssf, new ObjID());
56: this .aid = aid;
57: }
58:
59: /**
60: * Constructor intended to create ActivatableServerRef on the given port.
61: * @param aid Activation identifier of this ActivatableRef
62: * @param port Port on which ActivatableServerRef will be exported.
63: */
64: public ActivatableServerRef(ActivationID aid, int port) {
65: this (aid, port, null, null);
66: }
67:
68: /**
69: *
70: * @param out
71: *
72: * @return The String "ActivatableServerRef" that indicates which Serialization
73: * rules should be applied to this remote reference.
74: */
75: public String getRefClass(ObjectOutput out) {
76: return "ActivatableServerRef"; //$NON-NLS-1$
77: }
78:
79: /**
80: *
81: * @return The instance of the ActivatableRef instance with the same Activation identifier as this ActivatableServerRef.
82: */
83: protected UnicastRef getClientRef(Endpoint ep, ObjID obj_id) {
84: return new ActivatableRef(aid,
85: new UnicastRef2(ep, obj_id, true));
86: }
87: }
|