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 voidclose()Close theAcceptor.voiddoWork()This method denotes the actual work that is done by the work item.java.net.SocketgetAcceptedSocket()Blocks until a new Socket is available on the acceptor's port.java.nio.channels.SelectableChannelgetChannel()java.net.ServerSocketgetServerSocket()booleaninitialize()Used to initialize anAcceptor.booleanisLazy()booleanshouldRegisterAcceptEvent()Used to determine if theAcceptorshould 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:
isLazyin interfaceAcceptor- Overrides:
isLazyin classAcceptorBase
-
getAcceptedSocket
public java.net.Socket getAcceptedSocket()
Description copied from interface:AcceptorBlocks 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:AcceptorUsed to initialize anAcceptor. For example, initialization may mean to create aServerSocketChannel. Note: this must be prepared to be be called multiple times.- Returns:
truewhen it performs initializatin actions (typically the first call.
-
close
public void close()
Description copied from interface:AcceptorClose theAcceptor.
-
getServerSocket
public java.net.ServerSocket getServerSocket()
-
doWork
public void doWork()
Description copied from interface:WorkThis method denotes the actual work that is done by the work item.
-
shouldRegisterAcceptEvent
public boolean shouldRegisterAcceptEvent()
Description copied from interface:AcceptorUsed to determine if theAcceptorshould 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:
shouldRegisterAcceptEventin interfaceAcceptor- Overrides:
shouldRegisterAcceptEventin classAcceptorBase- Returns:
trueif theAcceptorshould be registered with a Selector.
-
-