|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Endpoint
An Endpoint represents an endpoint of a Pipe
. An Endpoint can be
created, and listened to, and connected to.
An Endpoint represents an end of a byte stream. Depending on how a Endpoint
gets created, it can be listened to or connected to. In both cases, the
endpoint returns a Pipe
. Hence, a Endpoint acts in fact as a
Pipe
factory: multiple Pipe
s can be created from it by
repeatedly listening for incoming connections. The behaviour is similar to
listening on a BSD socket.
Endpoints obtained from the AdvertService
cannot be listened to.
Pipe
s created from endpoints continue to live after the
Endpoint
instance is destroyed.
Method Summary | |
---|---|
Pipe |
connect()
Connect to the Endpoint . |
Pipe |
listen()
Listen for a new connection to the Endpoint . |
Pipe |
listen(int timeout)
Listen for a new connection to the Endpoint . |
void |
listen(PipeListener pipeListener)
Listen for a new connection to the Endpoint . |
void |
listen(PipeListener pipeListener,
int timeout)
Listen for a new connection to the Endpoint . |
Methods inherited from interface org.gridlab.gat.monitoring.Monitorable |
---|
addMetricListener, getMeasurement, getMetricDefinitionByName, getMetricDefinitions, removeMetricListener |
Methods inherited from interface org.gridlab.gat.advert.Advertisable |
---|
marshal |
Method Detail |
---|
Pipe connect() throws GATInvocationException
Endpoint
.
When a Endpoint
is obtained from an AdvertService
, it
can be used to create a Pipe
connected to the advertising
application, by calling connect on the Endpoint
instance.
Pipe
connected to the Endpoint
.
GATInvocationException
- if no connection could be made.Pipe listen() throws GATInvocationException
Endpoint
.
The creator of an Endpoint
can use the Endpoint
to create
Pipe
s, which represent incoming connections. This is done by
calling listen on the Endpoint
instance. This call is
synchronous, and blocks until a connection has been made.
Pipe
connected to the Endpoint
.
GATInvocationException
- if no connection could be made.Pipe listen(int timeout) throws GATInvocationException
Endpoint
.
The creator of an Endpoint
can use the Endpoint
to create
Pipe
s, which represent incoming connections. This is done by
calling listen on the Endpoint
instance. This call is
synchronous, and blocks until a connection has been made or until the
specified timeout expires.
timeout
- the specified timeout in milliseconds
Pipe
connected to the Endpoint
.
GATInvocationException
- if no connection could be made.void listen(PipeListener pipeListener) throws GATInvocationException
Endpoint
.
The creator of an Endpoint
can use the Endpoint
to create
Pipe
s, which represent incoming connections. This is done by
calling listen on the Endpoint
instance. This call is
asynchronous, and returns immediately. When a new connection has been
made, the pipeListener will be informed.
pipeListener
- the listener that will be informed
GATInvocationException
- if no connection could be made.void listen(PipeListener pipeListener, int timeout) throws GATInvocationException
Endpoint
.
The creator of an Endpoint
can use the Endpoint
to create
Pipe
s, which represent incoming connections. This is done by
calling listen on the Endpoint
instance. This call is
asynchronous, and returns immediately. When a new connection has been
made, the PipeListener
will be informed.
pipeListener
- the PipeListener
that will be informedtimeout
- the specified timeout in milliseconds
GATInvocationException
- if no connection could be made.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |