at.ac.tuwien.infosys.sm4all.copal.api.context
Class Context

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.context.Context

public class Context
extends Object

This class is used to read definitions of ContextEventTypes and ContextQuerys from a XML configuration file that can be found in classpath.

Author:
sanjin

Constructor Summary
Context(ClassLoader classLoader, String fileName)
          Use specified ClassLoader to find the XML configuration file with specified name.
 
Method Summary
 ProcessedEventQuery[] createQueries(ContextQueryFactory factory)
          Creates all defined ProcessedEventQuerys with specified ContextQueryFactory.
 XMLContextEventType[] getDefinedEventTypes()
          Returns the defined XMLContextEventTypes in the XML configuration file or an empty array if there was problem reading the file.
 String[] getDefinedQueries()
          Returns the defined ContextQuerys in the XML configuration file or empty array if there was problem reading the file.
 XMLContextEventType[] registerEventTypes(ContextEventTypeRegistry eventTypeRegistry)
          Registers all defined XMLContextEventTypes with specified ContextEventTypeRegistry and return all XMLContextEventTypes that were successfully registered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Context

public Context(ClassLoader classLoader,
               String fileName)
Use specified ClassLoader to find the XML configuration file with specified name.

Parameters:
classLoader - the class loader.
fileName - the name of the configuration file.
Method Detail

getDefinedEventTypes

public XMLContextEventType[] getDefinedEventTypes()
Returns the defined XMLContextEventTypes in the XML configuration file or an empty array if there was problem reading the file.

Returns:
the defined XMLContextEventTypes in the XML configuration file or an empty array if there was problem reading the file.

getDefinedQueries

public String[] getDefinedQueries()
Returns the defined ContextQuerys in the XML configuration file or empty array if there was problem reading the file.

Returns:
the defined ContextQuerys in the XML configuration file or empty array if there was problem reading the file.

registerEventTypes

public XMLContextEventType[] registerEventTypes(ContextEventTypeRegistry eventTypeRegistry)
Registers all defined XMLContextEventTypes with specified ContextEventTypeRegistry and return all XMLContextEventTypes that were successfully registered.

Parameters:
eventTypeRegistry - the event type registry with which to register defined XMLContextEventTypes.
Returns:
successfully registered XMLContextEventTypes.

createQueries

public ProcessedEventQuery[] createQueries(ContextQueryFactory factory)
Creates all defined ProcessedEventQuerys with specified ContextQueryFactory.

Parameters:
factory - the ContextQueryFactory with which to create defined ProcessedEventQuerys.
Returns:
created ProcessedEventQuerys.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.