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. package com.sun.corba.se.impl.legacy.connection;
  8. import com.sun.corba.se.pept.transport.Connection;
  9. import com.sun.corba.se.spi.orb.ORB;
  10. import com.sun.corba.se.spi.ior.IOR;
  11. import com.sun.corba.se.spi.logging.CORBALogDomains;
  12. import com.sun.corba.se.spi.transport.CorbaContactInfoList;
  13. import com.sun.corba.se.spi.transport.SocketInfo;
  14. import com.sun.corba.se.impl.logging.ORBUtilSystemException;
  15. import com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl;
  16. /**
  17. * @author Harold Carr
  18. */
  19. public class SocketFactoryContactInfoImpl
  20. extends
  21. SocketOrChannelContactInfoImpl
  22. {
  23. protected ORBUtilSystemException wrapper;
  24. protected SocketInfo socketInfo;
  25. // XREVISIT
  26. // See SocketOrChannelAcceptorImpl.createMessageMediator
  27. // See SocketFactoryContactInfoImpl.constructor()
  28. // See SocketOrChannelContactInfoImpl.constructor()
  29. public SocketFactoryContactInfoImpl()
  30. {
  31. }
  32. public SocketFactoryContactInfoImpl(
  33. ORB orb,
  34. CorbaContactInfoList contactInfoList,
  35. IOR effectiveTargetIOR,
  36. short addressingDisposition,
  37. SocketInfo cookie)
  38. {
  39. super(orb, contactInfoList);
  40. this.effectiveTargetIOR = effectiveTargetIOR;
  41. this.addressingDisposition = addressingDisposition;
  42. wrapper = ORBUtilSystemException.get( orb,
  43. CORBALogDomains.RPC_TRANSPORT ) ;
  44. socketInfo =
  45. orb.getORBData().getLegacySocketFactory()
  46. .getEndPointInfo(orb, effectiveTargetIOR, cookie);
  47. socketType = socketInfo.getType();
  48. hostname = socketInfo.getHost();
  49. port = socketInfo.getPort();
  50. }
  51. ////////////////////////////////////////////////////
  52. //
  53. // pept.transport.ContactInfo
  54. //
  55. public Connection createConnection()
  56. {
  57. Connection connection =
  58. new SocketFactoryConnectionImpl(
  59. orb, this,
  60. orb.getORBData().connectionSocketUseSelectThreadToWait(),
  61. orb.getORBData().connectionSocketUseWorkerThreadForEvent());
  62. return connection;
  63. }
  64. ////////////////////////////////////////////////////
  65. //
  66. // java.lang.Object
  67. //
  68. public String toString()
  69. {
  70. return
  71. "SocketFactoryContactInfoImpl["
  72. + socketType + " "
  73. + hostname + " "
  74. + port
  75. + "]";
  76. }
  77. }
  78. // End of file.