Package com.sun.corba.ee.impl.transport
Class AcceptorImpl
- java.lang.Object
-
- com.sun.corba.ee.impl.transport.EventHandlerBase
-
- com.sun.corba.ee.impl.transport.AcceptorBase
-
- com.sun.corba.ee.impl.transport.AcceptorImpl
-
- All Implemented Interfaces:
LegacyServerSocketEndPointInfo,Work,Acceptor,EventHandler,SocketInfo
- Direct Known Subclasses:
AcceptorAcceptOnlyImpl,SocketFactoryAcceptorImpl
public class AcceptorImpl extends AcceptorBase
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<?>lastExceptionClassSeenprotected java.net.ServerSocketserverSocketprotected java.nio.channels.ServerSocketChannelserverSocketChannel-
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 AcceptorImpl(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 protected voidaccept()voidclose()Close theAcceptor.private voidcloseException(java.io.IOException exc)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.protected voidinternalInitialize()private voidotherException(java.lang.Throwable t)private voidsecurityException(java.lang.SecurityException se)private voidselectionKeyNotAcceptable()private voidusingServerSocket(java.net.ServerSocket ss)private voidusingServerSocketChannel(java.nio.channels.ServerSocketChannel ssc)-
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, isLazy, makeIIOPProfileTemplate, processSocket, setConnectionCache, setEnqueueTime, setLocatorPort, shouldRegisterAcceptEvent, toString, toStringName
-
Methods inherited from class com.sun.corba.ee.impl.transport.EventHandlerBase
getSelectionKey, getWork, handleEvent, setSelectionKey, setUseSelectThreadToWait, setUseWorkerThreadForEvent, setWork, shouldUseSelectThreadToWait, shouldUseWorkerThreadForEvent
-
-
-
-
Constructor Detail
-
AcceptorImpl
public AcceptorImpl(ORB orb, int port, java.lang.String name, java.lang.String type)
-
-
Method Detail
-
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.
-
internalInitialize
protected void internalInitialize() throws java.lang.Exception- Throws:
java.lang.Exception
-
usingServerSocket
@InfoMethod private void usingServerSocket(java.net.ServerSocket ss)
-
usingServerSocketChannel
@InfoMethod private void usingServerSocketChannel(java.nio.channels.ServerSocketChannel ssc)
-
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
-
closeException
@InfoMethod private void closeException(java.io.IOException exc)
-
close
public void close()
Description copied from interface:AcceptorClose theAcceptor.
-
getChannel
public java.nio.channels.SelectableChannel getChannel()
-
accept
protected void accept()
-
doWork
public void doWork()
Description copied from interface:WorkThis method denotes the actual work that is done by the work item.
-
getServerSocket
public java.net.ServerSocket getServerSocket()
-
selectionKeyNotAcceptable
@InfoMethod private void selectionKeyNotAcceptable()
-
securityException
@InfoMethod private void securityException(java.lang.SecurityException se)
-
otherException
@InfoMethod private void otherException(java.lang.Throwable t)
-
-