|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eodisp.remote.jeri.jxta.JxtaServerEndpoint
public final class JxtaServerEndpoint
An implementation of the ServerEndpoint
abstraction that uses JXTA
sockets (instances of JxtaServerSocket
) for the
underlying communication mechanism.
Most of the implementation was copied from the the
TcpServerEndpoint
class.
All TcpServerEndpoint
instances in the same JVM use the same
peer and peer group advertisement. This information is statically received from
JxtaNetwork
.
JxtaServerEndpoint
uses the Jini(TM) extensible remote invocation
(Jini ERI) multiplexing protocol to map incoming requests to socket
connections.
JxtaEndpoint
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.jini.jeri.ServerEndpoint |
---|
net.jini.jeri.ServerEndpoint.ListenContext, net.jini.jeri.ServerEndpoint.ListenCookie, net.jini.jeri.ServerEndpoint.ListenEndpoint, net.jini.jeri.ServerEndpoint.ListenHandle |
Method Summary | |
---|---|
net.jini.core.constraint.InvocationConstraints |
checkConstraints(net.jini.core.constraint.InvocationConstraints constraints)
|
net.jini.jeri.Endpoint |
enumerateListenEndpoints(net.jini.jeri.ServerEndpoint.ListenContext listenContext)
Passes the ListenEndpoint for this JxtaServerEndpoint to
listenContext , which will ensure an active listen
operation on the endpoint, and returns a JxtaEndpoint
instance corresponding to the listen operation chosen by
listenContext . |
boolean |
equals(java.lang.Object obj)
Compares the specified object with this JxtaServerEndpoint
for equality. |
static JxtaServerEndpoint |
getInstance()
Returns a JxtaServerEndpoint instance. |
int |
hashCode()
Returns the hash code value for this JxtaServerEndpoint . |
java.lang.String |
toString()
Returns a string representation of this JxtaServerEndpoint . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static JxtaServerEndpoint getInstance()
JxtaServerEndpoint
instance. All information
about the peer and peer group is obtained statically from the
JxtaNetwork
class.
JxtaServerEndpoint
instancepublic net.jini.core.constraint.InvocationConstraints checkConstraints(net.jini.core.constraint.InvocationConstraints constraints) throws net.jini.io.UnsupportedConstraintException
checkConstraints
in interface net.jini.jeri.ServerCapabilities
java.lang.NullPointerException
net.jini.io.UnsupportedConstraintException
public net.jini.jeri.Endpoint enumerateListenEndpoints(net.jini.jeri.ServerEndpoint.ListenContext listenContext) throws java.io.IOException
ListenEndpoint
for this JxtaServerEndpoint
to
listenContext
, which will ensure an active listen
operation on the endpoint, and returns a JxtaEndpoint
instance corresponding to the listen operation chosen by
listenContext
.
This method invokes addListenEndpoint
on
listenContext
once, passing a ListenEndpoint
as described below. If addListenEndpoint
throws an
exception, then this method throws that exception. Otherwise, this method
returns a JxtaEndpoint
instance.
The ListenEndpoint
passed to
addListenEndpoint
behaves as follows:
ListenHandle
listen(RequestDispatcher)
:
Listens for requests received on this endpoint, dispatching them to the suppliedRequestDispatcher
in the form ofInboundRequest
instances.When the implementation of this method needs to create a new
ServerSocket
, it will do so by creating a new JxtaServerSocket with the following arguments:JxtaNetwork.getJeriPeerGroup()
andJxtaNetwork.getJeriPipeAdvertisement()
.Requests will be dispatched in a
PrivilegedAction
wrapped by aSecurityContext
obtained when this method was invoked, with theAccessControlContext
of thatSecurityContext
in effect.Dispatched requests will implement
populateContext
to populate the given collection with an element that implements theClientHost
interface. ThatClientHost
element implementsgetClientHost
to return the IP address of theSocket
that the request was received over (seeSocket.getInetAddress()
).Throws
IOException
if an I/O exception occurs while performing this operation.Throws
NullPointerException
ifrequestDispatcher
isnull
void
checkPermissions()
:
Does not do any checks at all.
boolean equals(Object)
:
Compares the specified object with thisListenEndpoint
for equality.This method returns
true
if and only if the specified object is also aListenEndpoint
produced by aJxtaServerEndpoint
and is not null.
enumerateListenEndpoints
in interface net.jini.jeri.ServerEndpoint
listenContext
- the ListenContext
to pass this
JxtaServerEndpoint
's
ListenEndpoint
to
JxtaEndpoint
instance for sending requests to
this JxtaServerEndpoint
's endpoint being listened
on
java.io.IOException
- if an I/O exception occurs while performing this operation
java.lang.IllegalArgumentException
java.lang.NullPointerException
public int hashCode()
JxtaServerEndpoint
.
Always returns the same value, because all JxtaServerEndpoints are the
same.
hashCode
in class java.lang.Object
JxtaServerEndpoint
.
Always returns 1
.public boolean equals(java.lang.Object obj)
JxtaServerEndpoint
for equality.
This method returns true
if and only if the specified
object is also a JxtaServerEndpoint
and is not null.
equals
in class java.lang.Object
obj
- the object to compare with
true
if obj
is equivalent to this
object; false
otherwisepublic java.lang.String toString()
JxtaServerEndpoint
.
toString
in class java.lang.Object
JxtaServerEndpoint
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |