Class ParserTable.TestLegacyORBSocketFactory
- All Implemented Interfaces:
ORBSocketFactory
- Enclosing class:
ParserTable
-
Field Summary
Fields inherited from interface com.sun.corba.ee.spi.legacy.connection.ORBSocketFactory
IIOP_CLEAR_TEXT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateServerSocket
(String type, int port) DEPRECATED.createSocket
(SocketInfo socketInfo) DEPRECATED.boolean
getEndPointInfo
(ORB orb, IOR ior, SocketInfo socketInfo) DEPRECATED.
-
Constructor Details
-
TestLegacyORBSocketFactory
public TestLegacyORBSocketFactory()
-
-
Method Details
-
equals
-
createServerSocket
Description copied from interface:ORBSocketFactory
DEPRECATED. DEPRECATED. DEPRECATED. DEPRECATED.This method is used by a server side ORB.
When an ORB needs to create a listen socket on which connection requests are accepted it calls
createServerSocket(String type, int port)
. The type argument says which type of socket should be created.The interpretation of the type argument is the responsibility of an instance of
ORBSocketFactory
, except in the case ofIIOP_CLEAR_TEXT
, in which case a standard server socket should be created.Multiple Server Port API:
In addition to the IIOP_CLEAR_TEXT listening port, it is possible to specify that an ORB listen on additional port of specific types.
This API allows one to specify that an ORB should create an X, or an X and a Y listen socket.
If X, to the user, means SSL, then one just plugs in an SSL socket factory.
Or, another example, if X and Y, to the user, means SSL without authentication and SSL with authentication respectively, then they plug in a factory which will either create an X or a Y socket depending on the type given to
createServerSocket(String type, int port)
.One specifies multiple listening ports (in addition to the default IIOP_CLEAR_TEXT port) using the
ORBConstants.LISTEN_SOCKET_PROPERTY
property.Example usage:
... \ -Dcom.sun.corba.ee.connection.ORBSocketFactoryClass=com.my.MySockFact \ -Dcom.sun.corba.ee.connection.ORBListenSocket=SSL:0,foo:1 \ ...
The meaning of the "type" (SSL and foo above) is controlled by the user.ORBListenSocket is only meaningful for servers.
The property value is interpreted as follows. For each type/number pair:
If number is 0 then use an emphemeral port for the listener of the associated type.
If number is greater then 0 use that port number.
An ORB creates a listener socket for each type specified by the user by calling
createServerSocket(String type, int port)
with the type specified by the user.After an ORB is initialized and the RootPOA has been resolved, it is then listening on all the end points which were specified. It may be necessary to add this additional end point information to object references exported by this ORB.
Each object reference will contain the ORB's default IIOP_CLEAR_TEXT end point in its IOP profile. To add additional end point information (i.e., an SSL port) to an IOR (i.e., an object reference) one needs to intercept IOR creation using an
PortableInterceptor::IORInterceptor
.Using PortableInterceptors (with a non-standard extension):
Register an
IORInterceptor
. Inside itsestablish_components
operation:com.sun.corba.ee.spi.legacy.interceptor.IORInfoExt ext; ext = (com.sun.corba.ee.spi.legacy.interceptor.IORInfoExt)info; int port = ext.getServerPort("myType");
Once you have the port you may add information to references created by the associated adapter by callingIORInfo::add_ior_component
Note: if one is using a POA and the lifespan policy of that POA is persistent then the port number returned by
getServerPort
may be the corresponding ORBD port, depending on whether the POA/ORBD protocol is the present port exchange or if, in the future, the protocol is based on object reference template exchange. In either case, the port returned will be correct for the protocol. (In more detail, if the port exchange protocol is used then getServerPort will return the ORBD's port since the port exchange happens before, at ORB initialization. If object reference exchange is used then the server's transient port will be returned since the templates are exchanged after adding components.)Persistent object reference support:
When creating persistent object references with alternate type/port info, ones needs to configure the ORBD to also support this alternate info. This is done as follows:
- Give the ORBD the same socket factory you gave to the client and server.
- specify ORBListenSocket ports of the same types that your servers support. You should probably specify explicit port numbers for ORBD if you embed these numbers inside IORs.
Note: when using the port exchange protocol the ORBD and servers will exchange port numbers for each given type so they know about each other. When using object reference template exchange the server's transient ports are contained in the template.
- specify your
BadServerIdHandler
(discussed below) using theORBConstants.BAD_SERVER_ID_HANDLER_CLASS_PROPERTY
Example:
-Dcom.sun.corba.ee.POA.ORBBadServerIdHandlerClass=corba.socketPersistent.MyBadServerIdHandler
TheBadServerIdHandler
...See
com.sun.corba.ee.impl.activation.ServerManagerImpl.handle
for example code on writing a bad server id handler. NOTE: This is an unsupported internal API. It will not exist in future releases.Secure connections to other services:
If one wants secure connections to other services such as Naming then one should configure them with the same
SOCKET_FACTORY_CLASS_PROPERTY
andLISTEN_SOCKET_PROPERTY
as used by other clients and servers in your distributed system.- Specified by:
createServerSocket
in interfaceORBSocketFactory
- Parameters:
type
- type of socket to createport
- port to create socket on- Returns:
- created socket
-
getEndPointInfo
Description copied from interface:ORBSocketFactory
DEPRECATED. DEPRECATED. DEPRECATED. DEPRECATED.This method is used by a client side ORB.
Each time a client invokes on an object reference, the reference's associated ORB will call
getEndPointInfo(ORB orb, IOR ior, SocketInfo socketInfo)
NOTE: The type of theior
argument is an internal representation for efficiency. If theORBSocketFactory
interface ever becomes standardized then theior
will most likely change to a standard type (e.g., a stringified ior, anorg.omg.IOP.IOR
, or ...).Typically, this method will look at tagged components in the given
ior
to determine what type of socket to create.Typically, the
ior
will contain a tagged component specifying an alternate port type and number.This method should return an
SocketInfo
object containing the type/host/port to be used for the connection. If there are no appropriate tagged components then this method should return anSocketInfo
object with the typeIIOP_CLEAR_TEXT
and host/port from the ior's IOP profile.If the ORB already has an existing connection to the returned type/host/port, then that connection is used. Otherwise the ORB calls
createSocket(SocketInfo socketInfo)
The
orb
argument is useful for handling theior
argument.The
SocketInfo
given togetEndPointInfo
is either null or an object obtained fromGetEndPointInfoAgainException
- Specified by:
getEndPointInfo
in interfaceORBSocketFactory
- Parameters:
orb
- ORB to use for getting socketior
- IOR to look at tagged components ofsocketInfo
- information on socket- Returns:
- the endpoint info
-
createSocket
Description copied from interface:ORBSocketFactory
DEPRECATED. DEPRECATED. DEPRECATED. DEPRECATED.This method is used by a client side ORB.
This method should return a client socket of the given type/host/port.
Note: the
SocketInfo
is the same instance as was returned bygetSocketInfo
so extra cookie info may be attached.If this method throws GetEndPointInfoAgainException then the ORB calls
getEndPointInfo
again, passing it theSocketInfo
object contained in the exception.- Specified by:
createSocket
in interfaceORBSocketFactory
- Parameters:
socketInfo
- socket information- Returns:
- client socket
-