eu.semiramis.policyManager.pdp.impl
Class ContextHandlerFactory

java.lang.Object
  extended by eu.semiramis.policyManager.pdp.impl.ContextHandlerFactory

public class ContextHandlerFactory
extends java.lang.Object

Factory for ContextHandler objects.

The implementation class of objects returned by the factory can be configured using the property name ContextHandler.CONTEXT_HANDLER_CLASS_PROPERTY.

Author:
Paolo Roccetti

Field Summary
static java.lang.String CONTEXT_HANDLER_CONFIGURATION_FILE
          Name of the default configuration file for the ContextHandler
static java.lang.Class DEFAULT_CONTEXT_HANDLER_CLASS
           
 
Constructor Summary
ContextHandlerFactory()
           
 
Method Summary
static ContextHandler createContextHandler()
          Creates a new ContextHandler basing on the default configuration file
static ContextHandler createContextHandler(java.util.Properties properties)
          Creates a new ContextHandler basing on the custom configuration object provided
static ContextHandler createContextHandler(java.lang.String configurationFileName)
          Creates a new ContextHandler basing on the custom configuration file provided
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTEXT_HANDLER_CONFIGURATION_FILE

public static final java.lang.String CONTEXT_HANDLER_CONFIGURATION_FILE
Name of the default configuration file for the ContextHandler

See Also:
Constant Field Values

DEFAULT_CONTEXT_HANDLER_CLASS

public static final java.lang.Class DEFAULT_CONTEXT_HANDLER_CLASS
Constructor Detail

ContextHandlerFactory

public ContextHandlerFactory()
Method Detail

createContextHandler

public static ContextHandler createContextHandler()
                                           throws java.lang.ClassNotFoundException,
                                                  java.lang.IllegalAccessException,
                                                  java.lang.InstantiationException,
                                                  ConfigurationException,
                                                  java.io.IOException,
                                                  java.net.URISyntaxException
Creates a new ContextHandler basing on the default configuration file

Returns:
the new ContextHandler
Throws:
java.lang.ClassNotFoundException - if the ContextHandler implementation class cannot be found
java.lang.IllegalAccessException - if the ContextHandler implementation class cannot be instantiated
java.lang.InstantiationException - if the ContextHandler implementation class cannot be instantiated
ConfigurationException - if an exception occurs in configuring the ContextHandler implementation
java.net.URISyntaxException - if the resource name is not well formed
java.io.IOException - if the load operation fails

createContextHandler

public static ContextHandler createContextHandler(java.lang.String configurationFileName)
                                           throws java.lang.ClassNotFoundException,
                                                  java.lang.IllegalAccessException,
                                                  java.lang.InstantiationException,
                                                  ConfigurationException,
                                                  java.io.IOException,
                                                  java.net.URISyntaxException
Creates a new ContextHandler basing on the custom configuration file provided

Parameters:
configurationFileName - the configuration file name
Returns:
the new ContextHandler
Throws:
java.lang.ClassNotFoundException - if the ContextHandler implementation class cannot be found
java.lang.IllegalAccessException - if the ContextHandler implementation class cannot be instantiated
java.lang.InstantiationException - if the ContextHandler implementation class cannot be instantiated
ConfigurationException - if an exception occurs in configuring the ContextHandler implementation
java.net.URISyntaxException - if the resource name is not well formed
java.io.IOException - if the load operation fails
java.lang.Exception - if an exception occurs when loading the properties

createContextHandler

public static ContextHandler createContextHandler(java.util.Properties properties)
                                           throws ConfigurationException
Creates a new ContextHandler basing on the custom configuration object provided

Parameters:
properties - the custom configuration properties object
Returns:
the new ContextHandler
Throws:
java.lang.ClassNotFoundException - if the ContextHandler implementation class cannot be found
java.lang.IllegalAccessException - if the ContextHandler implementation class cannot be instantiated
java.lang.InstantiationException - if the ContextHandler implementation class cannot be instantiated
ConfigurationException - if an exception occurs in configuring the ContextHandler implementation