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, work
IIOP_CLEAR_TEXT
BOOT_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, shouldUseWorkerThreadForEvent
protected 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()
Acceptor
Acceptor
.
For example, initialization may mean to create a
ServerSocketChannel
.
Note: this must be prepared to be be called multiple times.initialize
in interface Acceptor
true
when it performs initializatin
actions (typically the first call.public boolean initialized()
Acceptor
Acceptor
has been initialized.initialized
in interface Acceptor
trueAcceptor
has been
initialized.public String getConnectionCacheType()
Acceptor
Acceptor
as given by getConnectionCacheType
.getConnectionCacheType
in interface Acceptor
String
public void setConnectionCache(InboundConnectionCache connectionCache)
Acceptor
InboundConnectionCache
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 Acceptor
public InboundConnectionCache getConnectionCache()
Acceptor
InboundConnectionCache
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 Acceptor
ConnectionCache
public boolean shouldRegisterAcceptEvent()
Acceptor
Acceptor
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 Acceptor
true
if the Acceptor
should be
registered with
Selector
public void accept()
Acceptor
Acceptor
or by a
ListenerThread
.
It results in a
Connection
being created.public void close()
Acceptor
Acceptor
.public EventHandler getEventHandler()
Acceptor
EventHandler
associated with this Acceptor
.getEventHandler
in interface Acceptor
EventHandler
public String getObjectAdapterId()
getObjectAdapterId
in interface CorbaAcceptor
public String getObjectAdapterManagerId()
getObjectAdapterManagerId
in interface CorbaAcceptor
public void addToIORTemplate(IORTemplate iorTemplate, Policies policies, String codebase)
addToIORTemplate
in interface CorbaAcceptor
public String getMonitoringName()
getMonitoringName
in interface CorbaAcceptor
public SelectableChannel getChannel()
getChannel
in interface EventHandler
public int getInterestOps()
getInterestOps
in interface EventHandler
public Acceptor getAcceptor()
getAcceptor
in interface EventHandler
public Connection getConnection()
getConnection
in interface EventHandler
public void doWork()
Work
public void setEnqueueTime(long timeInMillis)
Work
setEnqueueTime
in interface Work
public long getEnqueueTime()
Work
getEnqueueTime
in interface Work
public MessageMediator createMessageMediator(Broker broker, Connection connection)
Acceptor
MessageMediator
to hold internal data for a message received using the specific
encoding, protocol, transport combination represented by this
Acceptor
.createMessageMediator
in interface Acceptor
MessageMediator
public MessageMediator finishCreatingMessageMediator(Broker broker, Connection connection, MessageMediator messageMediator)
Acceptor
MessageMediator
to with internal data for a message received using the specific
encoding, protocol, transport combination represented by this
Acceptor
.finishCreatingMessageMediator
in interface Acceptor
MessageMediator
public InputObject createInputObject(Broker broker, MessageMediator messageMediator)
Acceptor
InputObject
for the specific encoding represented by this
Acceptor
.createInputObject
in interface Acceptor
InputObject
public OutputObject createOutputObject(Broker broker, MessageMediator messageMediator)
Acceptor
OutputObject
for the specific encoding represented by this
Acceptor
.createOutputObject
in interface Acceptor
OutputObject
public ServerSocket getServerSocket()
getServerSocket
in interface SocketOrChannelAcceptor
protected String toStringName()
protected void dprint(String msg)
public String getType()
LegacyServerSocketEndPointInfo
getType
in interface LegacyServerSocketEndPointInfo
getType
in interface SocketInfo
public String getHostName()
LegacyServerSocketEndPointInfo
getHostName
in interface LegacyServerSocketEndPointInfo
public String getHost()
getHost
in interface SocketInfo
public int getPort()
getPort
in interface LegacyServerSocketEndPointInfo
getPort
in interface SocketInfo
public int getLocatorPort()
LegacyServerSocketEndPointInfo
getLocatorPort
in interface LegacyServerSocketEndPointInfo
public void setLocatorPort(int port)
setLocatorPort
in interface LegacyServerSocketEndPointInfo
Copyright © 2019 JBoss by Red Hat. All rights reserved.