Package com.sun.corba.ee.impl.transport
Class AcceptorLazyImpl
- java.lang.Object
-
- com.sun.corba.ee.impl.transport.EventHandlerBase
-
- com.sun.corba.ee.impl.transport.AcceptorBase
-
- com.sun.corba.ee.impl.transport.AcceptorLazyImpl
-
- All Implemented Interfaces:
LegacyServerSocketEndPointInfo
,Work
,Acceptor
,EventHandler
,SocketInfo
public class AcceptorLazyImpl extends AcceptorBase
A version of an Acceptor that does not own the ServerSocket. Instead, SelectableChannels obtained from the ServerSocket are given to the processSocket method
-
-
Field Summary
-
Fields inherited from class com.sun.corba.ee.impl.transport.AcceptorBase
connectionCache, enqueueTime, hostname, initialized, locatorPort, name, port, type, wrapper
-
Fields inherited from class com.sun.corba.ee.impl.transport.EventHandlerBase
orb, selectionKey, useSelectThreadToWait, useWorkerThreadForEvent, work
-
Fields inherited from interface com.sun.corba.ee.spi.legacy.connection.LegacyServerSocketEndPointInfo
BOOT_NAMING, DEFAULT_ENDPOINT, NO_NAME
-
Fields inherited from interface com.sun.corba.ee.spi.transport.SocketInfo
IIOP_CLEAR_TEXT, SSL_PREFIX
-
-
Constructor Summary
Constructors Constructor Description AcceptorLazyImpl(ORB orb, int port, java.lang.String name, java.lang.String type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close theAcceptor
.void
doWork()
This method denotes the actual work that is done by the work item.java.net.Socket
getAcceptedSocket()
Blocks until a new Socket is available on the acceptor's port.java.nio.channels.SelectableChannel
getChannel()
java.net.ServerSocket
getServerSocket()
boolean
initialize()
Used to initialize anAcceptor
.boolean
isLazy()
boolean
shouldRegisterAcceptEvent()
Used to determine if theAcceptor
should register with a Selector to handle accept events.-
Methods inherited from class com.sun.corba.ee.impl.transport.AcceptorBase
addToIORTemplate, createOutputObject, getAcceptor, getConnection, getConnectionCache, getConnectionCacheType, getEnqueueTime, getEventHandler, getHost, getHostName, getInterestOps, getInterfaceName, getLocatorPort, getMonitoringName, getName, getPort, getType, initialized, makeIIOPProfileTemplate, processSocket, setConnectionCache, setEnqueueTime, setLocatorPort, toString, toStringName
-
Methods inherited from class com.sun.corba.ee.impl.transport.EventHandlerBase
getSelectionKey, getWork, handleEvent, setSelectionKey, setUseSelectThreadToWait, setUseWorkerThreadForEvent, setWork, shouldUseSelectThreadToWait, shouldUseWorkerThreadForEvent
-
-
-
-
Constructor Detail
-
AcceptorLazyImpl
public AcceptorLazyImpl(ORB orb, int port, java.lang.String name, java.lang.String type)
-
-
Method Detail
-
isLazy
public boolean isLazy()
- Specified by:
isLazy
in interfaceAcceptor
- Overrides:
isLazy
in classAcceptorBase
-
getAcceptedSocket
public java.net.Socket getAcceptedSocket()
Description copied from interface:Acceptor
Blocks until a new Socket is available on the acceptor's port.- Returns:
- the new socket
-
getChannel
public java.nio.channels.SelectableChannel getChannel()
-
initialize
public boolean initialize()
Description copied from interface:Acceptor
Used to initialize anAcceptor
. For example, initialization may mean to create aServerSocketChannel
. Note: this must be prepared to be be called multiple times.- Returns:
true
when it performs initializatin actions (typically the first call.
-
close
public void close()
Description copied from interface:Acceptor
Close theAcceptor
.
-
getServerSocket
public java.net.ServerSocket getServerSocket()
-
doWork
public void doWork()
Description copied from interface:Work
This method denotes the actual work that is done by the work item.
-
shouldRegisterAcceptEvent
public boolean shouldRegisterAcceptEvent()
Description copied from interface:Acceptor
Used to determine if theAcceptor
should register with a Selector to handle accept events. For example, this may be false in the case of Solaris Doors which do not actively listen.- Specified by:
shouldRegisterAcceptEvent
in interfaceAcceptor
- Overrides:
shouldRegisterAcceptEvent
in classAcceptorBase
- Returns:
true
if theAcceptor
should be registered with a Selector.
-
-