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<?>
lastExceptionClassSeen
protected java.net.ServerSocket
serverSocket
protected java.nio.channels.ServerSocketChannel
serverSocketChannel
-
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 void
accept()
void
close()
Close theAcceptor
.private void
closeException(java.io.IOException exc)
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
.protected void
internalInitialize()
private void
otherException(java.lang.Throwable t)
private void
securityException(java.lang.SecurityException se)
private void
selectionKeyNotAcceptable()
private void
usingServerSocket(java.net.ServerSocket ss)
private void
usingServerSocketChannel(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: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.
-
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:Acceptor
Blocks 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:Acceptor
Close theAcceptor
.
-
getChannel
public java.nio.channels.SelectableChannel getChannel()
-
accept
protected void accept()
-
doWork
public void doWork()
Description copied from interface:Work
This 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)
-
-