Package com.sun.corba.se.pept.transport
Interface Acceptor
- All Known Subinterfaces:
CorbaAcceptor
- All Known Implementing Classes:
ParserTable.TestAcceptor1,ParserTable.TestAcceptor2,SocketFactoryAcceptorImpl,SocketOrChannelAcceptorImpl
public interface Acceptor
The primary PEPt server-side plug-in point and enabler for altenate encodings, protocols and transports.
Acceptor is a factory for client-side
artifacts used to receive a message (and possibly send a response).
- Author:
- Harold Carr
-
Method Summary
Modifier and TypeMethodDescriptionvoidaccept()Accept a connection request.voidclose()Close theAcceptor.createInputObject(Broker broker, MessageMediator messageMediator) Used to get aInputObjectfor the specific encoding represented by thisAcceptor.createMessageMediator(Broker xbroker, Connection xconnection) 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.finishCreatingMessageMediator(Broker broker, Connection xconnection, 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 bygetConnectionCacheType().PEPt uses separate caches for each type ofAcceptoras given bygetConnectionCacheType.Get theEventHandlerassociated with thisAcceptor.booleanUsed to initialize anAcceptor.booleanUsed to determine if anAcceptorhas been initialized.voidsetConnectionCache(InboundConnectionCache connectionCache) Set theInboundConnectionCacheto be used by thisAcceptor.booleanUsed to determine if theAcceptorshould register withSelectorto handle accept events.
-
Method Details
-
initialize
boolean initialize()Used 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.
-
initialized
boolean initialized()Used to determine if anAcceptorhas been initialized.- Returns:
true</code. if theAcceptorhas been initialized.
-
getConnectionCacheType
String getConnectionCacheType()PEPt uses separate caches for each type ofAcceptoras given bygetConnectionCacheType.- Returns:
String
-
setConnectionCache
Set theInboundConnectionCacheto be used by thisAcceptor. PEPt uses separate caches for each type ofAcceptoras given bygetConnectionCacheType().setConnectionCache(com.sun.corba.se.pept.transport.InboundConnectionCache)andgetConnectionCache()support an optimzation to avoid hashing to find that cache.- Parameters:
connectionCache- .
-
getConnectionCache
InboundConnectionCache getConnectionCache()Get theInboundConnectionCacheused by thisAcceptorPEPt uses separate caches for each type ofAcceptoras given bygetConnectionCacheType().setConnectionCache(com.sun.corba.se.pept.transport.InboundConnectionCache)andgetConnectionCache()support an optimzation to avoid hashing to find that cache.- Returns:
ConnectionCache
-
shouldRegisterAcceptEvent
boolean shouldRegisterAcceptEvent()Used 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.- Returns:
trueif theAcceptorshould be registered withSelector
-
accept
void accept()Accept a connection request. This is called either when the selector gets an accept event for thisAcceptoror by aListenerThread. It results in aConnectionbeing created. -
close
void close()Close theAcceptor. -
getEventHandler
EventHandler getEventHandler()Get theEventHandlerassociated with thisAcceptor.- Returns:
EventHandler
-
createMessageMediator
Used to get aMessageMediatorto hold internal data for a message received using the specific encoding, protocol, transport combination represented by thisAcceptor.- Returns:
MessageMediator
-
finishCreatingMessageMediator
MessageMediator finishCreatingMessageMediator(Broker broker, Connection xconnection, MessageMediator messageMediator) Used to finish creating aMessageMediatorto with internal data for a message received using the specific encoding, protocol, transport combination represented by thisAcceptor.- Returns:
MessageMediator
-
createInputObject
Used to get aInputObjectfor the specific encoding represented by thisAcceptor.- Returns:
InputObject
-
createOutputObject
Used to get aOutputObjectfor the specific encoding represented by thisAcceptor.- Returns:
OutputObject
-