public class DefaultServiceClient<T,S> extends java.lang.Object implements ServiceClient<T,S>
ServiceClient
.Modifier and Type | Method and Description |
---|---|
void |
call(T request,
ServiceResponseListener<S> listener)
Calls a method on the
ServiceServer . |
void |
connect(java.net.URI uri)
Connects to a
ServiceServer . |
GraphName |
getName() |
static <S,T> DefaultServiceClient<S,T> |
newDefault(GraphName nodeName,
ServiceDeclaration serviceDeclaration,
org.ros.message.MessageSerializer<S> serializer,
org.ros.message.MessageDeserializer<T> deserializer,
org.ros.message.MessageFactory messageFactory,
java.util.concurrent.ScheduledExecutorService executorService) |
T |
newMessage() |
void |
shutdown()
Stops the client (e.g.
|
java.lang.String |
toString() |
public static <S,T> DefaultServiceClient<S,T> newDefault(GraphName nodeName, ServiceDeclaration serviceDeclaration, org.ros.message.MessageSerializer<S> serializer, org.ros.message.MessageDeserializer<T> deserializer, org.ros.message.MessageFactory messageFactory, java.util.concurrent.ScheduledExecutorService executorService)
public void connect(java.net.URI uri)
ServiceClient
ServiceServer
.connect
in interface ServiceClient<T,S>
uri
- the URI
of the ServiceServer
to connect topublic void shutdown()
ServiceClient
shutdown
in interface ServiceClient<T,S>
public void call(T request, ServiceResponseListener<S> listener)
ServiceClient
ServiceServer
.call
in interface ServiceClient<T,S>
request
- the request messagelistener
- the ServiceResponseListener
that will handle the response
to this requestpublic GraphName getName()
getName
in interface ServiceClient<T,S>
ServiceClient
is connected topublic java.lang.String toString()
toString
in class java.lang.Object
public T newMessage()
newMessage
in interface ServiceClient<T,S>