public class OroServer extends java.lang.Object implements IServiceProvider
OroServer
is the application entry point. It initializes and starts
the various services, connectors and background tasks, as set up in the
oro-server
configuration file.OroServer does mainly two things:
Most services are related to access and management of a cognitive storage
backend. The main storage backend is an ontology, as implemented in the
OpenRobotsOntology
class. This class exposes a set of RPC services
(and hence implement the IServiceProvider
interface).
However, other services can be registred (like stats()
that returns
statistics on the server itself).
Amongst the tasks that are run in background, we can list:
laas.openrobots.ontology.modules.events
)MemoryManager
)
The communication with the server relies on standard TCP/IP sockets. The
ASCII protocole we use is documented here: SocketConnector
.
OroServer
has a main
function which expect a configuration
file.
For the server, the following options are currently available:
OpenRobotsOntology(Properties)
for others
options, specific to the ontologies. Have a look at the config file itself
for more details.Modifier and Type | Class and Description |
---|---|
class |
OroServer.OnShuttingDown |
Modifier and Type | Field and Description |
---|---|
static boolean |
BLINGBLING |
static java.lang.String |
DEFAULT_CONF
The default configuration file (set to "etc/oro-server/oro.conf").
|
static java.lang.String |
DEFAULT_LANGUAGE
Defines the standard language used in particular for labels retrieval.
This field can be set up in the configuration file with the language option.Expected values are ISO 2 characters language codes. |
static boolean |
DEMO_MODE |
static java.util.Set<java.lang.Class> |
discardedTypeFromServiceArgs
This set holds the types that should not be exposed to oro-server clients
but are required by some RPC methods (for instance to retrieve the
context when the query was received).
|
static boolean |
HAS_A_TTY |
static java.util.Date |
SERVER_START_TIME |
static java.util.Properties |
ServerParameters |
static VerboseLevel |
VERBOSITY |
static java.lang.String |
VERSION |
Constructor and Description |
---|
OroServer(java.lang.String confFile) |
Modifier and Type | Method and Description |
---|---|
void |
addNewServiceProviders(IServiceProvider provider) |
static java.lang.String |
formatParameters(java.lang.reflect.Method m)
Formats in a human-readable way the parameters of a method.
|
static java.util.Properties |
getConfiguration(java.lang.String configFileURI)
Read a configuration file and return to corresponding "Properties" object.
|
java.lang.String |
help() |
java.util.Map<java.lang.String,java.lang.String> |
listMethods() |
java.util.Set<java.lang.String> |
listSimpleMethods() |
static void |
main(java.lang.String[] args) |
java.lang.String |
makeHtmlDoc() |
static int |
nbExposedParameters(java.lang.reflect.Method m) |
void |
pushRequest(Request r) |
void |
reset() |
void |
runServer() |
void |
serverInitialization(java.util.Properties serverParameters) |
long |
size() |
java.util.Map<java.lang.String,java.lang.String> |
stats()
Returns several statistics on the server.
|
public static final java.lang.String DEFAULT_CONF
public static java.lang.String DEFAULT_LANGUAGE
language
option.public static boolean HAS_A_TTY
public static VerboseLevel VERBOSITY
public static boolean DEMO_MODE
public static java.util.Properties ServerParameters
public static boolean BLINGBLING
public static final java.lang.String VERSION
public static final java.util.Date SERVER_START_TIME
public static final java.util.Set<java.lang.Class> discardedTypeFromServiceArgs
public void addNewServiceProviders(IServiceProvider provider)
public void pushRequest(Request r)
public void runServer() throws java.lang.InterruptedException, OntologyServerException
java.lang.InterruptedException
OntologyServerException
public void serverInitialization(java.util.Properties serverParameters) throws OntologyServerException
OntologyServerException
public static void main(java.lang.String[] args) throws OntologyConnectorException, java.lang.InterruptedException, OntologyServerException
OntologyConnectorException
java.lang.InterruptedException
OntologyServerException
@RPCMethod(category="administration", desc="Reload the base ontologies, discarding all inserted of removed statements, in every models") public void reset() throws OntologyServerException
OntologyServerException
@RPCMethod(category="administration", desc="returns some statistics on the server") public java.util.Map<java.lang.String,java.lang.String> stats()
public long size()
@RPCMethod(desc="returns a human-friendly list of available methods with their signatures and short descriptions.") public java.lang.String help()
@RPCMethod(category="administration", desc="returns the list of available methods with their signatures and short descriptions as a map.") public java.util.Map<java.lang.String,java.lang.String> listMethods()
@RPCMethod(category="administration", desc="returns a raw list of available methods.") public java.util.Set<java.lang.String> listSimpleMethods()
@RPCMethod(category="administration", desc="returns a list of available methods in HTML format for inclusion in documentation.") public java.lang.String makeHtmlDoc()
public static java.lang.String formatParameters(java.lang.reflect.Method m)
discardedTypeFromServiceArgs
m
- The methodpublic static int nbExposedParameters(java.lang.reflect.Method m)
public static java.util.Properties getConfiguration(java.lang.String configFileURI)
configFileURI
- The path and filename of the configuration file.ORO is a part of the OpenRobots framework.
openrobots@laas.fr
LAAS-CNRS 2009-2011