KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > legacy > connection > SocketFactoryContactInfoImpl


1 /*
2  * @(#)SocketFactoryContactInfoImpl.java 1.13 04/06/21
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.impl.legacy.connection;
9
10 import com.sun.corba.se.pept.transport.Connection;
11
12 import com.sun.corba.se.spi.orb.ORB;
13 import com.sun.corba.se.spi.ior.IOR;
14 import com.sun.corba.se.spi.logging.CORBALogDomains;
15 import com.sun.corba.se.spi.transport.CorbaContactInfoList;
16 import com.sun.corba.se.spi.transport.SocketInfo;
17
18 import com.sun.corba.se.impl.logging.ORBUtilSystemException;
19 import com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl;
20
21
22 /**
23  * @author Harold Carr
24  */

25 public class SocketFactoryContactInfoImpl
26     extends
27     SocketOrChannelContactInfoImpl
28 {
29     protected ORBUtilSystemException wrapper;
30     protected SocketInfo socketInfo;
31
32     // XREVISIT
33
// See SocketOrChannelAcceptorImpl.createMessageMediator
34
// See SocketFactoryContactInfoImpl.constructor()
35
// See SocketOrChannelContactInfoImpl.constructor()
36
public SocketFactoryContactInfoImpl()
37     {
38     }
39
40     public SocketFactoryContactInfoImpl(
41         ORB orb,
42     CorbaContactInfoList contactInfoList,
43     IOR effectiveTargetIOR,
44     short addressingDisposition,
45     SocketInfo cookie)
46     {
47     super(orb, contactInfoList);
48     this.effectiveTargetIOR = effectiveTargetIOR;
49         this.addressingDisposition = addressingDisposition;
50
51     wrapper = ORBUtilSystemException.get( orb,
52         CORBALogDomains.RPC_TRANSPORT ) ;
53
54     socketInfo =
55         orb.getORBData().getLegacySocketFactory()
56             .getEndPointInfo(orb, effectiveTargetIOR, cookie);
57
58     socketType = socketInfo.getType();
59     hostname = socketInfo.getHost();
60     port = socketInfo.getPort();
61     }
62
63     ////////////////////////////////////////////////////
64
//
65
// pept.transport.ContactInfo
66
//
67

68     public Connection createConnection()
69     {
70     Connection connection =
71         new SocketFactoryConnectionImpl(
72                 orb, this,
73         orb.getORBData().connectionSocketUseSelectThreadToWait(),
74         orb.getORBData().connectionSocketUseWorkerThreadForEvent());
75     return connection;
76     }
77
78     ////////////////////////////////////////////////////
79
//
80
// java.lang.Object
81
//
82

83     public String JavaDoc toString()
84     {
85     return
86         "SocketFactoryContactInfoImpl["
87         + socketType + " "
88         + hostname + " "
89         + port
90         + "]";
91     }
92 }
93
94 // End of file.
95
Popular Tags