org.universAAL.context.che
Class Hub

Package class diagram package Hub
java.lang.Object
  extended by org.universAAL.context.che.Hub
All Implemented Interfaces:
OntologyListener

public class Hub
extends Object
implements OntologyListener

Central class that takes care of starting and stopping application. It used to be the Activator class before splitting the OSGi logic.

Author:
alfiva

Nested Class Summary
static class Hub.Log
          helper class to simplify the calls to LogUtils of MW.
 
Field Summary
static String COMMENTS
          This is prepended to the above file.
static String PROPS_FILE
          Name of the config properties file.
 
Constructor Summary
Hub()
          Default constructor.
 
Method Summary
static Hub.Log getLog(Class cl)
          Gets a Log helper class.
static Properties getProperties()
          Gets the properties of the CHe.
 void ontologyAdded(String ontURI)
          Notification when a new ontology is added.
 void ontologyRemoved(String ontURI)
          Notification when an existing ontology is removed.
static void setProperties(Properties prop)
          Sets the properties of the CHe.
 void setuAALParser(MessageContentSerializer service)
          Set the turtle-uaal parser.
 void start(ModuleContext context)
          To be called when application starts.
 void stop()
          To be called when application stops.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPS_FILE

public static final String PROPS_FILE
Name of the config properties file.

See Also:
Constant Field Values

COMMENTS

public static final String COMMENTS
This is prepended to the above file.

See Also:
Constant Field Values
Constructor Detail

Hub

public Hub()
Default constructor.

Method Detail

start

public void start(ModuleContext context)
To be called when application starts. Used to be Activator.start().

Parameters:
context - uaal module context

stop

public final void stop()
                throws Exception
To be called when application stops. Used to be Activator.stop().

Throws:
Exception

setuAALParser

public void setuAALParser(MessageContentSerializer service)
Set the turtle-uaal parser. Make sure it's set at least once before start().

Parameters:
service - The parser

setProperties

public static void setProperties(Properties prop)
Sets the properties of the CHe.

Parameters:
prop - The Properties object containing ALL of the properties of the CHe
See Also:
getProperties()

getProperties

public static Properties getProperties()
Gets the properties of the CHe.

Returns:
The properties of the CHe
See Also:
setProperties(Properties)

getLog

public static Hub.Log getLog(Class cl)
Gets a Log helper class.

Parameters:
cl - Class that asks for a logger
Returns:
the logger

ontologyAdded

public void ontologyAdded(String ontURI)
Description copied from interface: OntologyListener
Notification when a new ontology is added.

Specified by:
ontologyAdded in interface OntologyListener
Parameters:
ontURI - the URI of the new ontology.

ontologyRemoved

public void ontologyRemoved(String ontURI)
Description copied from interface: OntologyListener
Notification when an existing ontology is removed.

Specified by:
ontologyRemoved in interface OntologyListener
Parameters:
ontURI - the URI of the ontology.


Copyright © 2014 universAAL Consortium. All Rights Reserved.