public class SocketConnector extends java.lang.Object implements IConnector, java.lang.Runnable
oro-server
RPC methods.method_name [parameter1] [parameter2] [...] #end#parameters can be either:
ok [return_value] #end#
error [name of the exception, if available] [human-readable error message - that *may* spend over several lines] #end#
EventModule#registerEvent(String, String, Set, IEventConsumer)
),
the server may send the following type of message when the event it triggered.
event [event_id] [event_return_value] #end#The
event_id
will match the id returned at event registration. The
return values depend on the type of event. Details are provided on the IWatcher.EventType
page.
> help
> listMethods > #end#
> add > [human rdf:type Human, human rdfs:label "Ramses", myself sees Ramses] > #end#
> find > [?humans rdf:type Human, myself sees ?humans] > #end#
> registerEvent > new_instance //event type > on_true //triggering type > [Human] > #end#The server answer ok, with a unique ID bound to this so-called "event watcher"
> ok > 4565-4587995-112355-21446 > #end#If a new human appears in the ontology, the server send this kind of notification
> event > 4565-4587995-112355-21446 > [ramses] > #end#Please refer to
IWatcher.EventType
page for the list of event types and
IWatcher.TriggeringType
for the list of ways the trigger an
event.Modifier and Type | Class and Description |
---|---|
class |
SocketConnector.ClientWorker
Inner class that is forked at incoming connections.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_KEEP_ALIVE_SOCKET_DURATION
Maximum time (in seconds) the server should keep alive a socket when inactive.
|
static java.lang.String |
DEFAULT_PORT |
static java.lang.String |
MESSAGE_TERMINATOR |
Constructor and Description |
---|
SocketConnector(java.util.Properties params,
java.util.HashMap<java.lang.String,IService> registredServices,
OroServer server) |
Modifier and Type | Method and Description |
---|---|
void |
clearServiceList() |
void |
finalizeConnector() |
void |
initializeConnector() |
void |
refreshServiceList(java.util.Map<java.lang.String,IService> registredServices) |
void |
run()
When called, should wait for one request, answer it and return.
|
public static final java.lang.String DEFAULT_KEEP_ALIVE_SOCKET_DURATION
public static final java.lang.String DEFAULT_PORT
public static final java.lang.String MESSAGE_TERMINATOR
public void finalizeConnector() throws OntologyConnectorException
finalizeConnector
in interface IConnector
OntologyConnectorException
public void initializeConnector() throws OntologyConnectorException
initializeConnector
in interface IConnector
OntologyConnectorException
public void run()
IConnector
run
in interface java.lang.Runnable
run
in interface IConnector
public void refreshServiceList(java.util.Map<java.lang.String,IService> registredServices)
refreshServiceList
in interface IConnector
public void clearServiceList()
clearServiceList
in interface IConnector
ORO is a part of the OpenRobots framework.
openrobots@laas.fr
LAAS-CNRS 2009-2011