public abstract class EndpointBasedServer extends EndpointBasedProvider implements UnicastDiscoveryServer
Modifier and Type | Class and Description |
---|---|
private static class |
EndpointBasedServer.ListenContextImpl
Listen context that listens on the endpoint it is given, and stores the
resulting handle.
|
private static class |
EndpointBasedServer.PrearrangedServerSocket
Server socket that returns a prearranged socket once from its accept
method, and then blocks on subsequent calls to accept until closed.
|
private static class |
EndpointBasedServer.PrearrangedServerSocketFactory
Server socket factory that returns a PrearrangedServerSocket for a
prearranged socket.
|
private static class |
EndpointBasedServer.ServerConnManagerImpl
Server connection manager that stores the connection it is given to
handle.
|
endpointInternals
formatName
Modifier | Constructor and Description |
---|---|
protected |
EndpointBasedServer(String formatName,
EndpointInternals endpointInternals)
Constructs instance with the given format name and object providing
access to non-public endpoint operations.
|
Modifier and Type | Method and Description |
---|---|
void |
checkUnicastDiscoveryConstraints(InvocationConstraints constraints)
Checks and returns normally if this server is capable of fulfilling the
given absolute constraints.
|
private static Subject |
getClientSubject(ServerConnection connection,
InboundRequestHandle handle)
Returns the subject that the client of the given connection has
authenticated as, or null if the client is not authenticated.
|
protected abstract ServerEndpoint |
getServerEndpoint(ServerSocketFactory factory)
Returns a server endpoint which uses the given server socket factory, if
non-null.
|
void |
handleUnicastDiscovery(UnicastResponse response,
Socket socket,
InvocationConstraints constraints,
ClientSubjectChecker checker,
Collection context,
ByteBuffer received,
ByteBuffer sent)
Handles the server side of unicast discovery, transmitting the given
response data over the provided socket using the given collection of
object stream context objects in a manner that satisfies the specified
absolute constraints and client subject checker (if any).
|
calcHandshakeHash, checkIntegrity
getFormatName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFormatName
protected EndpointBasedServer(String formatName, EndpointInternals endpointInternals)
public void checkUnicastDiscoveryConstraints(InvocationConstraints constraints) throws UnsupportedConstraintException
UnicastDiscoveryServer
null
constraints are
considered equivalent to empty constraints.checkUnicastDiscoveryConstraints
in interface UnicastDiscoveryServer
constraints
- the constraints to check, or null
UnsupportedConstraintException
- if unable to satisfy the
specified constraintspublic void handleUnicastDiscovery(UnicastResponse response, Socket socket, InvocationConstraints constraints, ClientSubjectChecker checker, Collection context, ByteBuffer received, ByteBuffer sent) throws IOException
UnicastDiscoveryServer
null
constraints are considered equivalent to empty
constraints.handleUnicastDiscovery
in interface UnicastDiscoveryServer
response
- the unicast response data to transmitsocket
- the socket on which to handle unicast discoveryconstraints
- the constraints to apply to unicast discovery, or
null
checker
- the object to use to check the client subject, or
null
context
- the collection of context information objects to use when
marshalling the registrar proxyreceived
- a buffer containing the data already receivedsent
- a buffer containing the data already sentIOException
- if an error occurs in interpreting received data or
in formatting data to sendUnsupportedConstraintException
- if unable to satisfy the
specified constraintsprotected abstract ServerEndpoint getServerEndpoint(ServerSocketFactory factory) throws UnsupportedConstraintException
UnsupportedConstraintException
private static Subject getClientSubject(ServerConnection connection, InboundRequestHandle handle)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.