org.apache.geronimo.yoko
Class SocketFactory

java.lang.Object
  extended by org.apache.geronimo.yoko.SocketFactory
All Implemented Interfaces:
org.apache.yoko.orb.OCI.IIOP.ConnectionHelper

public class SocketFactory
extends Object
implements org.apache.yoko.orb.OCI.IIOP.ConnectionHelper

Socket factory instance used to interface openejb2 with the Yoko ORB. Also enables the ORB for SSL-type connections.


Constructor Summary
SocketFactory()
           
 
Method Summary
 Socket createSelfConnection(InetAddress address, int port)
          Create a loopback connection to the hosting ORB.
 ServerSocket createServerSocket(int port, int backlog)
          Create a server socket listening on the given port.
 ServerSocket createServerSocket(int port, int backlog, InetAddress address)
          Create a server socket for this connection.
 Socket createSocket(IOR ior, Policy[] policies, InetAddress address, int port)
          Create a client socket of the appropriate type using the provided IOR and Policy information.
 void init(ORB orb, String configName)
          Initialize the socket factory instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketFactory

public SocketFactory()
Method Detail

init

public void init(ORB orb,
                 String configName)
Initialize the socket factory instance.

Specified by:
init in interface org.apache.yoko.orb.OCI.IIOP.ConnectionHelper
Parameters:
orb - The hosting ORB.
configName - The initialization parameter passed to the socket factor. This contains the abstract name of our configurator, which we retrieve from a registry.

createSocket

public Socket createSocket(IOR ior,
                           Policy[] policies,
                           InetAddress address,
                           int port)
                    throws IOException
Create a client socket of the appropriate type using the provided IOR and Policy information.

Specified by:
createSocket in interface org.apache.yoko.orb.OCI.IIOP.ConnectionHelper
Parameters:
ior - The target IOR of the connection.
policies - Policies in effect for this ORB.
address - The target address of the connection.
port - The connection port.
Returns:
A Socket (either plain or SSL) configured for connection to the target.
Throws:
IOException
ConnectException

createSelfConnection

public Socket createSelfConnection(InetAddress address,
                                   int port)
                            throws IOException
Create a loopback connection to the hosting ORB.

Specified by:
createSelfConnection in interface org.apache.yoko.orb.OCI.IIOP.ConnectionHelper
Parameters:
address - The address information for the server.
port - The target port.
Returns:
An appropriately configured socket based on the listener characteristics.
Throws:
IOException
ConnectException

createServerSocket

public ServerSocket createServerSocket(int port,
                                       int backlog)
                                throws IOException
Create a server socket listening on the given port.

Specified by:
createServerSocket in interface org.apache.yoko.orb.OCI.IIOP.ConnectionHelper
Parameters:
port - The target listening port.
backlog - The desired backlog value.
Returns:
An appropriate server socket for this connection.
Throws:
IOException
ConnectException

createServerSocket

public ServerSocket createServerSocket(int port,
                                       int backlog,
                                       InetAddress address)
                                throws IOException
Create a server socket for this connection.

Specified by:
createServerSocket in interface org.apache.yoko.orb.OCI.IIOP.ConnectionHelper
Parameters:
port - The target listener port.
backlog - The requested backlog value for the connection.
address - The host address information we're publishing under.
Returns:
An appropriately configured ServerSocket for this connection.
Throws:
IOException
ConnectException


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.