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

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.helpers.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

Field Summary
static String COPAL_NAMESPACE_URI
          The namespace URI used by the XML configuration file.
 
Constructor Summary
Context(ClassLoader classLoader, String fileName)
          Use specified ClassLoader to find the XML configuration file with specified name.
 
Method Summary
 ProcessedEventQuery[] createQueries(ContextQueryFactory queryFactory)
          Try to create all defined ProcessedEventQuerys with specified ContextQueryFactory and return all ProcessedEventQuerys that were successfully created.
 XMLContextEventType[] getDefinedEventTypes()
           
 String[] getDefinedQueries()
           
 XMLContextEventType[] registerEventTypes(ContextEventTypeRegistry eventTypeRegistry)
          Try to register 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
 

Field Detail

COPAL_NAMESPACE_URI

public static final String COPAL_NAMESPACE_URI
The namespace URI used by the XML configuration file.

See Also:
Constant Field Values
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.

getDefinedQueries

public String[] getDefinedQueries()
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)
Try to register 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 queryFactory)
Try to create all defined ProcessedEventQuerys with specified ContextQueryFactory and return all ProcessedEventQuerys that were successfully created.

Parameters:
queryFactory - the query factory with which to create defined ProcessedEventQuerys.
Returns:
successfully created ProcessedEventQuerys.


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