Package com.sun.corba.se.impl.transport
Class SocketOrChannelAcceptorImpl
java.lang.Object
com.sun.corba.se.impl.transport.EventHandlerBase
com.sun.corba.se.impl.transport.SocketOrChannelAcceptorImpl
- All Implemented Interfaces:
Acceptor,EventHandler,LegacyServerSocketEndPointInfo,Work,CorbaAcceptor,SocketInfo,SocketOrChannelAcceptor
- Direct Known Subclasses:
SocketFactoryAcceptorImpl
public class SocketOrChannelAcceptorImpl
extends EventHandlerBase
implements CorbaAcceptor, SocketOrChannelAcceptor, Work, SocketInfo, LegacyServerSocketEndPointInfo
- Author:
- Harold Carr
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InboundConnectionCacheprotected longprotected Stringprotected booleanprotected intprotected Stringprotected intprotected ServerSocketprotected ServerSocketChannelprotected Stringprotected ORBUtilSystemExceptionFields inherited from class com.sun.corba.se.impl.transport.EventHandlerBase
orb, selectionKey, useSelectThreadToWait, useWorkerThreadForEvent, workFields inherited from interface com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo
BOOT_NAMING, DEFAULT_ENDPOINT, NO_NAMEFields inherited from interface com.sun.corba.se.spi.transport.SocketInfo
IIOP_CLEAR_TEXT -
Constructor Summary
ConstructorsConstructorDescriptionSocketOrChannelAcceptorImpl(ORB orb, int port) SocketOrChannelAcceptorImpl(ORB orb, int port, String name, String type) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept()Accept a connection request.voidaddToIORTemplate(IORTemplate iorTemplate, Policies policies, String codebase) voidclose()Close theAcceptor.createInputObject(Broker broker, MessageMediator messageMediator) Used to get aInputObjectfor the specific encoding represented by thisAcceptor.createMessageMediator(Broker broker, Connection connection) Used to get aMessageMediatorto hold internal data for a message received using the specific encoding, protocol, transport combination represented by thisAcceptor.createOutputObject(Broker broker, MessageMediator messageMediator) Used to get aOutputObjectfor the specific encoding represented by thisAcceptor.voiddoWork()This method denotes the actual work that is done by the work item.protected voidprotected voidfinishCreatingMessageMediator(Broker broker, Connection connection, MessageMediator messageMediator) Used to finish creating aMessageMediatorto with internal data for a message received using the specific encoding, protocol, transport combination represented by thisAcceptor.Get theInboundConnectionCacheused by thisAcceptorPEPt uses separate caches for each type ofAcceptoras given byAcceptor.getConnectionCacheType().PEPt uses separate caches for each type ofAcceptoras given bygetConnectionCacheType.longThis methods gets the time in millis in the work item, when this work item was enqueued in the work queue.Get theEventHandlerassociated with thisAcceptor.getHost()Get the host name of this end point.intintThe ORBD's proxy port of this end point.getName()This method will return the name of the work item.intgetPort()getType()e.g.: "CLEAR_TEXT", "SSL", ...booleanUsed to initialize anAcceptor.booleanUsed to determine if anAcceptorhas been initialized.protected voidvoidsetConnectionCache(InboundConnectionCache connectionCache) Set theInboundConnectionCacheto be used by thisAcceptor.voidsetEnqueueTime(long timeInMillis) This methods sets the time in millis in the work item, when this work item was enqueued in the work queue.voidsetLocatorPort(int port) booleanUsed to determine if theAcceptorshould register withSelectorto handle accept events.toString()protected StringMethods inherited from class com.sun.corba.se.impl.transport.EventHandlerBase
getSelectionKey, getWork, handleEvent, setSelectionKey, setUseSelectThreadToWait, setUseWorkerThreadForEvent, setWork, shouldUseSelectThreadToWait, shouldUseWorkerThreadForEvent
-
Field Details
-
serverSocketChannel
-
serverSocket
-
port
protected int port -
enqueueTime
protected long enqueueTime -
initialized
protected boolean initialized -
wrapper
-
connectionCache
-
type
-
name
-
hostname
-
locatorPort
protected int locatorPort
-
-
Constructor Details
-
SocketOrChannelAcceptorImpl
-
SocketOrChannelAcceptorImpl
-
SocketOrChannelAcceptorImpl
-
-
Method Details
-
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.- Specified by:
initializein interfaceAcceptor- Returns:
truewhen it performs initializatin actions (typically the first call.
-
internalInitialize
- Throws:
Exception
-
initialized
public boolean initialized()Description copied from interface:AcceptorUsed to determine if anAcceptorhas been initialized.- Specified by:
initializedin interfaceAcceptor- Returns:
true</code. if theAcceptorhas been initialized.
-
getConnectionCacheType
Description copied from interface:AcceptorPEPt uses separate caches for each type ofAcceptoras given bygetConnectionCacheType.- Specified by:
getConnectionCacheTypein interfaceAcceptor- Returns:
String
-
setConnectionCache
Description copied from interface:AcceptorSet theInboundConnectionCacheto be used by thisAcceptor. PEPt uses separate caches for each type ofAcceptoras given byAcceptor.getConnectionCacheType().Acceptor.setConnectionCache(com.sun.corba.se.pept.transport.InboundConnectionCache)andAcceptor.getConnectionCache()support an optimzation to avoid hashing to find that cache.- Specified by:
setConnectionCachein interfaceAcceptor- Parameters:
connectionCache- .
-
getConnectionCache
Description copied from interface:AcceptorGet theInboundConnectionCacheused by thisAcceptorPEPt uses separate caches for each type ofAcceptoras given byAcceptor.getConnectionCacheType().Acceptor.setConnectionCache(com.sun.corba.se.pept.transport.InboundConnectionCache)andAcceptor.getConnectionCache()support an optimzation to avoid hashing to find that cache.- Specified by:
getConnectionCachein interfaceAcceptor- Returns:
ConnectionCache
-
shouldRegisterAcceptEvent
public boolean shouldRegisterAcceptEvent()Description copied from interface:AcceptorUsed to determine if theAcceptorshould register withSelectorto handle accept events. For example, this may be false in the case of Solaris Doors which do not actively listen.- Specified by:
shouldRegisterAcceptEventin interfaceAcceptor- Returns:
trueif theAcceptorshould be registered withSelector
-
accept
public void accept()Description copied from interface:AcceptorAccept a connection request. This is called either when the selector gets an accept event for thisAcceptoror by aListenerThread. It results in aConnectionbeing created. -
close
public void close()Description copied from interface:AcceptorClose theAcceptor. -
getEventHandler
Description copied from interface:AcceptorGet theEventHandlerassociated with thisAcceptor.- Specified by:
getEventHandlerin interfaceAcceptor- Returns:
EventHandler
-
getObjectAdapterId
- Specified by:
getObjectAdapterIdin interfaceCorbaAcceptor
-
getObjectAdapterManagerId
- Specified by:
getObjectAdapterManagerIdin interfaceCorbaAcceptor
-
addToIORTemplate
- Specified by:
addToIORTemplatein interfaceCorbaAcceptor
-
getMonitoringName
- Specified by:
getMonitoringNamein interfaceCorbaAcceptor
-
getChannel
- Specified by:
getChannelin interfaceEventHandler
-
getInterestOps
public int getInterestOps()- Specified by:
getInterestOpsin interfaceEventHandler
-
getAcceptor
- Specified by:
getAcceptorin interfaceEventHandler
-
getConnection
- Specified by:
getConnectionin interfaceEventHandler
-
doWork
public void doWork()Description copied from interface:WorkThis method denotes the actual work that is done by the work item. -
setEnqueueTime
public void setEnqueueTime(long timeInMillis) Description copied from interface:WorkThis methods sets the time in millis in the work item, when this work item was enqueued in the work queue.- Specified by:
setEnqueueTimein interfaceWork
-
getEnqueueTime
public long getEnqueueTime()Description copied from interface:WorkThis methods gets the time in millis in the work item, when this work item was enqueued in the work queue.- Specified by:
getEnqueueTimein interfaceWork
-
createMessageMediator
Description copied from interface:AcceptorUsed to get aMessageMediatorto hold internal data for a message received using the specific encoding, protocol, transport combination represented by thisAcceptor.- Specified by:
createMessageMediatorin interfaceAcceptor- Returns:
MessageMediator
-
finishCreatingMessageMediator
public MessageMediator finishCreatingMessageMediator(Broker broker, Connection connection, MessageMediator messageMediator) Description copied from interface:AcceptorUsed to finish creating aMessageMediatorto with internal data for a message received using the specific encoding, protocol, transport combination represented by thisAcceptor.- Specified by:
finishCreatingMessageMediatorin interfaceAcceptor- Returns:
MessageMediator
-
createInputObject
Description copied from interface:AcceptorUsed to get aInputObjectfor the specific encoding represented by thisAcceptor.- Specified by:
createInputObjectin interfaceAcceptor- Returns:
InputObject
-
createOutputObject
Description copied from interface:AcceptorUsed to get aOutputObjectfor the specific encoding represented by thisAcceptor.- Specified by:
createOutputObjectin interfaceAcceptor- Returns:
OutputObject
-
getServerSocket
- Specified by:
getServerSocketin interfaceSocketOrChannelAcceptor
-
toString
-
toStringName
-
dprint
-
dprint
-
getType
Description copied from interface:LegacyServerSocketEndPointInfoe.g.: "CLEAR_TEXT", "SSL", ...- Specified by:
getTypein interfaceLegacyServerSocketEndPointInfo- Specified by:
getTypein interfaceSocketInfo
-
getHostName
Description copied from interface:LegacyServerSocketEndPointInfoGet the host name of this end point. Subcontracts must use this instead of InetAddress.getHostName() because this would take into account the value of the ORBServerHost property.- Specified by:
getHostNamein interfaceLegacyServerSocketEndPointInfo
-
getHost
- Specified by:
getHostin interfaceSocketInfo
-
getPort
public int getPort()- Specified by:
getPortin interfaceLegacyServerSocketEndPointInfo- Specified by:
getPortin interfaceSocketInfo
-
getLocatorPort
public int getLocatorPort()Description copied from interface:LegacyServerSocketEndPointInfoThe ORBD's proxy port of this end point. Note: Pre-ORT "port-exchange" model.- Specified by:
getLocatorPortin interfaceLegacyServerSocketEndPointInfo
-
setLocatorPort
public void setLocatorPort(int port) - Specified by:
setLocatorPortin interfaceLegacyServerSocketEndPointInfo
-
getName
Description copied from interface:WorkThis method will return the name of the work item.- Specified by:
getNamein interfaceLegacyServerSocketEndPointInfo- Specified by:
getNamein interfaceWork
-