public class SocketOrChannelAcceptorImpl extends EventHandlerBase implements CorbaAcceptor, SocketOrChannelAcceptor, Work, SocketInfo, LegacyServerSocketEndPointInfo
| Modifier and Type | Field and Description |
|---|---|
protected InboundConnectionCache |
connectionCache |
protected long |
enqueueTime |
protected String |
hostname |
protected boolean |
initialized |
protected int |
locatorPort |
protected String |
name |
protected int |
port |
protected ServerSocket |
serverSocket |
protected ServerSocketChannel |
serverSocketChannel |
protected String |
type |
protected ORBUtilSystemException |
wrapper |
orb, selectionKey, useSelectThreadToWait, useWorkerThreadForEvent, workIIOP_CLEAR_TEXTBOOT_NAMING, DEFAULT_ENDPOINT, NO_NAME| Constructor and Description |
|---|
SocketOrChannelAcceptorImpl(ORB orb) |
SocketOrChannelAcceptorImpl(ORB orb,
int port) |
SocketOrChannelAcceptorImpl(ORB orb,
int port,
String name,
String type) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept()
Accept a connection request.
|
void |
addToIORTemplate(IORTemplate iorTemplate,
Policies policies,
String codebase) |
void |
close()
Close the
Acceptor. |
InputObject |
createInputObject(Broker broker,
MessageMediator messageMediator)
Used to get a
InputObject
for the specific encoding represented by this
Acceptor. |
MessageMediator |
createMessageMediator(Broker broker,
Connection connection)
Used to get a
MessageMediator
to hold internal data for a message received using the specific
encoding, protocol, transport combination represented by this
Acceptor. |
OutputObject |
createOutputObject(Broker broker,
MessageMediator messageMediator)
Used to get a
OutputObject
for the specific encoding represented by this
Acceptor. |
void |
doWork()
This method denotes the actual work that is done by the work item.
|
protected void |
dprint(String msg) |
protected void |
dprint(String msg,
Throwable t) |
MessageMediator |
finishCreatingMessageMediator(Broker broker,
Connection connection,
MessageMediator messageMediator)
Used to finish creating a
MessageMediator
to with internal data for a message received using the specific
encoding, protocol, transport combination represented by this
Acceptor. |
Acceptor |
getAcceptor() |
SelectableChannel |
getChannel() |
Connection |
getConnection() |
InboundConnectionCache |
getConnectionCache()
Get the
InboundConnectionCache
used by this Acceptor
PEPt uses separate caches for each type of Acceptor
as given by Acceptor.getConnectionCacheType(). |
String |
getConnectionCacheType()
PEPt uses separate caches for each type of
Acceptor
as given by getConnectionCacheType. |
long |
getEnqueueTime()
This methods gets the time in millis in the work item, when this
work item was enqueued in the work queue.
|
EventHandler |
getEventHandler()
Get the
EventHandler
associated with this Acceptor. |
String |
getHost() |
String |
getHostName()
Get the host name of this end point.
|
int |
getInterestOps() |
int |
getLocatorPort()
The ORBD's proxy port of this end point.
|
String |
getMonitoringName() |
String |
getName()
This method will return the name of the work item.
|
String |
getObjectAdapterId() |
String |
getObjectAdapterManagerId() |
int |
getPort() |
ServerSocket |
getServerSocket() |
String |
getType()
e.g.: "CLEAR_TEXT", "SSL", ...
|
boolean |
initialize()
Used to initialize an
Acceptor. |
boolean |
initialized()
Used to determine if an
Acceptor has been initialized. |
protected void |
internalInitialize() |
void |
setConnectionCache(InboundConnectionCache connectionCache)
Set the
InboundConnectionCache
to be used by this Acceptor. |
void |
setEnqueueTime(long timeInMillis)
This methods sets the time in millis in the work item, when this
work item was enqueued in the work queue.
|
void |
setLocatorPort(int port) |
boolean |
shouldRegisterAcceptEvent()
Used to determine if the
Acceptor should register
with
Selector
to handle accept events. |
String |
toString() |
protected String |
toStringName() |
getSelectionKey, getWork, handleEvent, setSelectionKey, setUseSelectThreadToWait, setUseWorkerThreadForEvent, setWork, shouldUseSelectThreadToWait, shouldUseWorkerThreadForEventprotected ServerSocketChannel serverSocketChannel
protected ServerSocket serverSocket
protected int port
protected long enqueueTime
protected boolean initialized
protected ORBUtilSystemException wrapper
protected InboundConnectionCache connectionCache
protected String type
protected String name
protected String hostname
protected int locatorPort
public SocketOrChannelAcceptorImpl(ORB orb)
public SocketOrChannelAcceptorImpl(ORB orb, int port)
public boolean initialize()
AcceptorAcceptor.
For example, initialization may mean to create a
ServerSocketChannel.
Note: this must be prepared to be be called multiple times.initialize in interface Acceptortrue when it performs initializatin
actions (typically the first call.public boolean initialized()
AcceptorAcceptor has been initialized.initialized in interface AcceptortrueAcceptor has been
initialized.public String getConnectionCacheType()
AcceptorAcceptor
as given by getConnectionCacheType.getConnectionCacheType in interface AcceptorStringpublic void setConnectionCache(InboundConnectionCache connectionCache)
AcceptorInboundConnectionCache
to be used by this Acceptor.
PEPt uses separate caches for each type of Acceptor
as given by Acceptor.getConnectionCacheType().
Acceptor.setConnectionCache(com.sun.corba.se.pept.transport.InboundConnectionCache) and Acceptor.getConnectionCache() support
an optimzation to avoid hashing to find that cache.setConnectionCache in interface Acceptorpublic InboundConnectionCache getConnectionCache()
AcceptorInboundConnectionCache
used by this Acceptor
PEPt uses separate caches for each type of Acceptor
as given by Acceptor.getConnectionCacheType().
Acceptor.setConnectionCache(com.sun.corba.se.pept.transport.InboundConnectionCache) and Acceptor.getConnectionCache() support
an optimzation to avoid hashing to find that cache.getConnectionCache in interface AcceptorConnectionCachepublic boolean shouldRegisterAcceptEvent()
AcceptorAcceptor should register
with
Selector
to handle accept events.
For example, this may be false in the case of Solaris Doors
which do not actively listen.shouldRegisterAcceptEvent in interface Acceptortrue if the Acceptor should be
registered with
Selectorpublic void accept()
AcceptorAcceptor or by a
ListenerThread.
It results in a
Connection
being created.public void close()
AcceptorAcceptor.public EventHandler getEventHandler()
AcceptorEventHandler
associated with this Acceptor.getEventHandler in interface AcceptorEventHandlerpublic String getObjectAdapterId()
getObjectAdapterId in interface CorbaAcceptorpublic String getObjectAdapterManagerId()
getObjectAdapterManagerId in interface CorbaAcceptorpublic void addToIORTemplate(IORTemplate iorTemplate, Policies policies, String codebase)
addToIORTemplate in interface CorbaAcceptorpublic String getMonitoringName()
getMonitoringName in interface CorbaAcceptorpublic SelectableChannel getChannel()
getChannel in interface EventHandlerpublic int getInterestOps()
getInterestOps in interface EventHandlerpublic Acceptor getAcceptor()
getAcceptor in interface EventHandlerpublic Connection getConnection()
getConnection in interface EventHandlerpublic void doWork()
Workpublic void setEnqueueTime(long timeInMillis)
WorksetEnqueueTime in interface Workpublic long getEnqueueTime()
WorkgetEnqueueTime in interface Workpublic MessageMediator createMessageMediator(Broker broker, Connection connection)
AcceptorMessageMediator
to hold internal data for a message received using the specific
encoding, protocol, transport combination represented by this
Acceptor.createMessageMediator in interface AcceptorMessageMediatorpublic MessageMediator finishCreatingMessageMediator(Broker broker, Connection connection, MessageMediator messageMediator)
AcceptorMessageMediator
to with internal data for a message received using the specific
encoding, protocol, transport combination represented by this
Acceptor.finishCreatingMessageMediator in interface AcceptorMessageMediatorpublic InputObject createInputObject(Broker broker, MessageMediator messageMediator)
AcceptorInputObject
for the specific encoding represented by this
Acceptor.createInputObject in interface AcceptorInputObjectpublic OutputObject createOutputObject(Broker broker, MessageMediator messageMediator)
AcceptorOutputObject
for the specific encoding represented by this
Acceptor.createOutputObject in interface AcceptorOutputObjectpublic ServerSocket getServerSocket()
getServerSocket in interface SocketOrChannelAcceptorprotected String toStringName()
protected void dprint(String msg)
public String getType()
LegacyServerSocketEndPointInfogetType in interface LegacyServerSocketEndPointInfogetType in interface SocketInfopublic String getHostName()
LegacyServerSocketEndPointInfogetHostName in interface LegacyServerSocketEndPointInfopublic String getHost()
getHost in interface SocketInfopublic int getPort()
getPort in interface LegacyServerSocketEndPointInfogetPort in interface SocketInfopublic int getLocatorPort()
LegacyServerSocketEndPointInfogetLocatorPort in interface LegacyServerSocketEndPointInfopublic void setLocatorPort(int port)
setLocatorPort in interface LegacyServerSocketEndPointInfoCopyright © 2018 JBoss by Red Hat. All rights reserved.